|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.turbine.services.BaseInitable org.apache.turbine.services.BaseService org.apache.turbine.services.TurbineBaseService org.apache.turbine.services.resources.TurbineResourceService org.apache.jetspeed.services.resources.JetspeedResourceService
This service subclasses TurbineResourceService
and
provides functionality for overriding properties in default resource
files. This override behavior is extended to non-string properties
To override properties:
services.ResourceService.classname = org.apache.jetspeed.services.resources.JetspeedResourceService
properties
init parameter in web.xml to my.properties
resources
init parameter in web.xml to
org.apache.jetspeed.services.resources.JetspeedResourceService
Important note on overriding services.Order of initializing services may be important. Overriding a service may change this order. It is important that services attempt to initialize dependent services in their early init methods. For example, to make sure that ServletService is running, invoke the following code:
TurbineServices.getInstance().initService(ServletService.SERVICE_NAME, conf);
Also, ${variable} substitution is extended to non-string properties. For example, the following property references are valid:
confRoot=/WEB-INF/conf psmlMapFile=${confRoot}/psml-mapping.xml registryMapFile=${confRoot}/registry-mapping.xml defaultRefresh=60 registryRefresh=${defaultRefresh} psmlRefresh=${defaultRefresh}
Field Summary |
Fields inherited from class org.apache.turbine.services.BaseService |
name, properties, serviceBroker |
Fields inherited from class org.apache.turbine.services.BaseInitable |
initableBroker, isInitialized |
Fields inherited from interface org.apache.turbine.services.resources.ResourceService |
SERVICE_NAME |
Constructor Summary | |
JetspeedResourceService()
|
Method Summary | |
boolean |
getBoolean(java.lang.String name)
The purpose of this method is to get the configuration resource with the given name as a boolean value. |
boolean |
getBoolean(java.lang.String name,
boolean def)
The purppose of this method is to get the configuration resource with the given name as a boolean value, or a default value. |
double |
getDouble(java.lang.String name)
The purpose of this method is to get the configuration resource with the given name as a double. |
double |
getDouble(java.lang.String name,
double def)
The purpose of this method is to get the configuration resource with the given name as a double, or a default value. |
float |
getFloat(java.lang.String name)
The purpose of this method is to get the configuration resource with the given name as a float. |
float |
getFloat(java.lang.String name,
float def)
The purpose of this method is to get the configuration resource with the given name as a float, or a default value. |
int |
getInt(java.lang.String name)
The purpose of this method is to get the configuration resource with the given name as an integer. |
int |
getInt(java.lang.String name,
int def)
The purpose of this method is to get the configuration resource with the given name as an integer, or a default value. |
long |
getLong(java.lang.String name)
The purpose of this method is to get the configuration resource with the given name as a long. |
long |
getLong(java.lang.String name,
long def)
The purpose of this method is to get the configuration resource with the given name as a long, or a default value. |
org.apache.turbine.services.resources.ResourceService |
getResources(java.lang.String prefix)
The purpose of this method is to extract a subset of configuraton resources sharing a common name prefix. |
void |
init()
This method is called when the Service is initialized It provides a way to override properties at runtime. |
void |
init(javax.servlet.ServletConfig config)
|
protected java.lang.String |
makeFileNamePath(java.lang.String propsDir,
java.lang.String fileName)
|
Methods inherited from class org.apache.turbine.services.resources.TurbineResourceService |
getConfiguration, getConfiguration, getKeys, getKeys, getString, getString, getStringArray, getVector, getVector, init, interpolate, setProperties, setPropertiesFileName, setProperty |
Methods inherited from class org.apache.turbine.services.TurbineBaseService |
init, shutdown |
Methods inherited from class org.apache.turbine.services.BaseService |
getName, getProperties, getServiceBroker, setName, setServiceBroker |
Methods inherited from class org.apache.turbine.services.BaseInitable |
getInit, getInitableBroker, setInit, setInitableBroker |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.turbine.services.Service |
getName, getProperties, setName, setServiceBroker |
Methods inherited from interface org.apache.turbine.services.Initable |
getInit, setInitableBroker, shutdown |
Constructor Detail |
public JetspeedResourceService()
Method Detail |
public boolean getBoolean(java.lang.String name)
name
- The resource name.
public boolean getBoolean(java.lang.String name, boolean def)
name
- The resource name.def
- The default value of the resource.
public double getDouble(java.lang.String name)
name
- The resoource name.
public double getDouble(java.lang.String name, double def)
name
- The resource name.def
- The default value of the resource.
public float getFloat(java.lang.String name)
name
- The resource name.
public float getFloat(java.lang.String name, float def)
name
- The resource name.def
- The default value of the resource.
public int getInt(java.lang.String name)
name
- The resource name.
public int getInt(java.lang.String name, int def)
name
- The resource name.def
- The default value of the resource.
public long getLong(java.lang.String name)
name
- The resource name.
public long getLong(java.lang.String name, long def)
name
- The resource name.def
- The default value of the resource.
public org.apache.turbine.services.resources.ResourceService getResources(java.lang.String prefix)
prefix
- the common name prefix
public void init() throws org.apache.turbine.services.InitializationException
org.apache.turbine.services.InitializationException
public void init(javax.servlet.ServletConfig config) throws org.apache.turbine.services.InitializationException
org.apache.turbine.services.InitializationException
protected java.lang.String makeFileNamePath(java.lang.String propsDir, java.lang.String fileName)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |