|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.resources.impl.ResourcesFactoryBase
public abstract class ResourcesFactoryBase
Convenience base class for ResourcesFactory
implementations.
This implementation caches the Resources
instances returned by
a protected createResources()
method, which must be implemented
by concrete subclasses.
JDBCResourcesFactory
,
PropertyResourcesFactory
,
ResourceBundleResourcesFactory
,
WebappResourcesFactoryBase
,
WebappPropertyResourcesFactory
,
WebappXMLResourcesFactory
,
XMLResourcesFactory
,
Serialized FormConstructor Summary | |
---|---|
ResourcesFactoryBase()
|
Method Summary | |
---|---|
protected abstract Resources |
createResources(String name,
String config)
Create and return a new Resources instance with the
specified logical name, after calling its init()
method and delegating the relevant properties. |
Resources |
getResources(String name)
Create (if necessary) and return a Resources instance
for the specified logical name, with a default configuration. |
Resources |
getResources(String name,
String config)
Create (if necessary) and return a Resources instance
for the specified logical name, with a configuration based on
the specified configuration String. |
boolean |
isReturnNull()
Return the returnNull property value that will be
configured on Resources instances created by this factory. |
void |
release()
Release any internal references to Resources instances
that have been returned previously, after calling the
destroy() method on each such instance. |
void |
setReturnNull(boolean returnNull)
Set the returnNull property value that will be
configured on Resources instances created by this factory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourcesFactoryBase()
Method Detail |
---|
public boolean isReturnNull()
Return the returnNull
property value that will be
configured on Resources
instances created by this factory.
isReturnNull
in interface ResourcesFactory
public void setReturnNull(boolean returnNull)
Set the returnNull
property value that will be
configured on Resources
instances created by this factory.
setReturnNull
in interface ResourcesFactory
returnNull
- The new value to delegatepublic Resources getResources(String name)
Create (if necessary) and return a Resources
instance
for the specified logical name, with a default configuration.
The default implementation of this method treats the name as the
configuration String as well, and calls the
getResources(String,String)
method.
getResources
in interface ResourcesFactory
name
- Logical name of the Resources
instance to
be returned
ResourcesException
- if a Resources
instance
of the specified logical name cannot be returned.public Resources getResources(String name, String config)
Create (if necessary) and return a Resources
instance
for the specified logical name, with a configuration based on
the specified configuration String.
getResources
in interface ResourcesFactory
name
- Logical name of the Resources
instance to
be returnedconfig
- Configuration string for this resource (meaning
is dependent upon the ResourcesFactory
implementation
being utilized), or null
for the default
configuration
ResourcesException
- if a Resources
instance
of the specified logical name cannot be returned.public void release()
Release any internal references to Resources
instances
that have been returned previously, after calling the
destroy()
method on each such instance.
release
in interface ResourcesFactory
ResourcesException
- if a problem occurred while releasingprotected abstract Resources createResources(String name, String config)
Create and return a new Resources
instance with the
specified logical name, after calling its init()
method and delegating the relevant properties. Concrete
subclasses MUST implement this method.
name
- Logical name of the Resources
instance to createconfig
- Configuration string for this resource (if any)
ResourcesException
- if a Resources
instance
of the specified logical name cannot be created.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |