|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.makumba.commons.NamedResourceFactory
public abstract class NamedResourceFactory
This models a factory for named resources. Normally a subclass should just implement
makeResource(name)
, which is called whenever the
NamedResources
is requested an object that it doesn't hold. Still, there are some
special cases:
NamedResources
keeps objects in a hashtable. If the key for that hashtable
corresponding to a certain name is not the name itself, the getHashObject(name)
method should be redefined.
makeResource(name, hashName)
method should be redefined,
instead of makeResource(name)
configureResource(name, hashName,
resource)
should be redefined to do further resource adjustments.
Field Summary | |
---|---|
protected Object |
supplementary
|
Constructor Summary | |
---|---|
NamedResourceFactory()
|
Method Summary | |
---|---|
protected void |
configureResource(Object name,
Object hashName,
Object resource)
This method is called immediately after the resource is built, but before making it accessible to other threads, and before the resource being returned to the client that requested it. |
protected Object |
getHashObject(Object name)
This method builds the hash object from the name of the object. |
protected Object |
makeResource(Object name)
This method should make the resource with the given name. |
protected Object |
makeResource(Object name,
Object hashName)
If the hash object for the resource is different from the name, this is the method used to build the named resource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Object supplementary
Constructor Detail |
---|
public NamedResourceFactory()
Method Detail |
---|
protected Object makeResource(Object name) throws Throwable
name
- the name of the resource to be made
Throwable
protected Object makeResource(Object name, Object hashName) throws Throwable
name
- name of the resource to be madehashName
- name of the hash for the object
Throwable
protected Object getHashObject(Object name) throws Throwable
name
- the name of the object
Throwable
protected void configureResource(Object name, Object hashName, Object resource) throws Throwable
name
- the name of the objecthashName
- the hash name of the objectresource
- the resource
Throwable
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |