de.laures.cewolf
Class Configuration

java.lang.Object
  extended by de.laures.cewolf.Configuration

public class Configuration
extends java.lang.Object

This class represents the configuration of the Cewolf framework. It is designed as singleton and resists in application context.

Since:
0.8
Author:
glaures

Field Summary
private  boolean debugged
           
private static java.lang.String DEFAULT_OVERLIB_URL
           
private static java.lang.String DEFAULT_STORAGE
           
static java.lang.String KEY
           
private  java.lang.String overlibURL
           
private  java.util.Map parameters
           
private  Storage storage
           
private  java.lang.String storageClassName
           
 
Constructor Summary
private Configuration()
           
protected Configuration(javax.servlet.ServletContext ctx)
          package protected constructor triggered by servlet
 
Method Summary
static Configuration getInstance(javax.servlet.ServletContext ctx)
          Factory method.
 java.lang.String getOverlibURL()
          Returns the location of the overlib.js relative to webapp's root.
 java.util.Map getParameters()
          Get the initialization parameters from Cewolf servlet.
 Storage getStorage()
           
private  void initStorage(javax.servlet.ServletContext ctx)
           
 boolean isDebugged()
          Checks if debugging is configured to be turned on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY

public static final java.lang.String KEY

DEFAULT_OVERLIB_URL

private static final java.lang.String DEFAULT_OVERLIB_URL
See Also:
Constant Field Values

DEFAULT_STORAGE

private static final java.lang.String DEFAULT_STORAGE
See Also:
Constant Field Values

overlibURL

private java.lang.String overlibURL

debugged

private boolean debugged

storageClassName

private java.lang.String storageClassName

storage

private Storage storage

parameters

private java.util.Map parameters
Constructor Detail

Configuration

protected Configuration(javax.servlet.ServletContext ctx)
package protected constructor triggered by servlet


Configuration

private Configuration()
Method Detail

initStorage

private void initStorage(javax.servlet.ServletContext ctx)
                  throws CewolfException
Throws:
CewolfException

getInstance

public static Configuration getInstance(javax.servlet.ServletContext ctx)
Factory method. If no Configuration had been initialized before, a new one is created, stored in ctx and returned to the caller.

Parameters:
ctx - the servlet context from where to retrieve the Configuration object.
Returns:
the config object

isDebugged

public boolean isDebugged()
Checks if debugging is configured to be turned on. Configured by init param debug in web.xml.

Returns:
true if a debugging is on, else false

getOverlibURL

public java.lang.String getOverlibURL()
Returns the location of the overlib.js relative to webapp's root. Configured by init param overliburl in web.xml. Defaults to overlib.js

Returns:
String

getStorage

public Storage getStorage()

getParameters

public java.util.Map getParameters()
Get the initialization parameters from Cewolf servlet.

Returns:
The parameter map (String->String) values