|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.hiveutils.service.impl.ObjectBuilderImpl
public class ObjectBuilderImpl
Implementation of the ObjectBuilder
service.
Constructor Summary | |
---|---|
ObjectBuilderImpl(org.apache.commons.logging.Log logger,
java.util.Map<java.lang.String,ObjectContribution> config,
org.apache.hivemind.schema.Translator objectTranslator,
org.apache.hivemind.service.EventLinker linker)
|
Method Summary | ||
---|---|---|
void |
addObjectBuilderListener(ObjectBuilderListener listener)
Add a listener to the creation of POJO instances. |
|
|
create(java.lang.String name,
java.lang.Object... userArgs)
Creates an object according to its definition in hiveutils.ObjectBuilderObjects configuration point. |
|
|
get(java.lang.String name,
java.lang.Object... args)
Returns a cached object if it has been already created according to its definition in hiveutils.ObjectBuilderObjects configuration point. |
|
void |
injectListeners(java.lang.Object object,
ObjectContribution contrib)
|
|
void |
removeObjectBuilderListener(ObjectBuilderListener listener)
Remove a listener from the list of listeners that are notified of the creation of POJO instances. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectBuilderImpl(org.apache.commons.logging.Log logger, java.util.Map<java.lang.String,ObjectContribution> config, org.apache.hivemind.schema.Translator objectTranslator, org.apache.hivemind.service.EventLinker linker)
Method Detail |
---|
public void addObjectBuilderListener(ObjectBuilderListener listener)
ObjectBuilder
addObjectBuilderListener
in interface ObjectBuilder
listener
- listener to be notified whenever a new POJO instance is
createdpublic void removeObjectBuilderListener(ObjectBuilderListener listener)
ObjectBuilder
removeObjectBuilderListener
in interface ObjectBuilder
listener
- listener to be removed from the listpublic <T> T get(java.lang.String name, java.lang.Object... args)
ObjectBuilder
hiveutils.ObjectBuilderObjects
configuration point. If the object has not
been constructed yet (by a call to one of create
methods), then no object
will be returned.
get
in interface ObjectBuilder
name
- the unique id of the object definition in the
ObjectBuilderObjects
.args
- additional arguments that have been provided to the constructor when the
object was created (args are at positions according to the object definition)
name
, and cached, or null
if name
does not exist
in the configuration, or if this object was not created yet, or if it was created but not
cached (defined as per its configuration).public <T> T create(java.lang.String name, java.lang.Object... userArgs)
ObjectBuilder
hiveutils.ObjectBuilderObjects
configuration point.
According to the definition, any necessary dependencies will be injected
(in constructor or through setters).
Repeated calls with the same name
will create a new object
every time, except if this object is configured to be cached.
create
in interface ObjectBuilder
name
- the unique id of the object definition in the
ObjectBuilderObjects
.userArgs
- additional arguments to be provided to the constructor
(at a position according to the object definition)
name
,
or null
if name
does not exist in the
configuration.public void injectListeners(java.lang.Object object, ObjectContribution contrib)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |