|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ObjectBuilder
Service that builds simple objects instances (not HiveMind services) but can inject dependencies into them, according to contributions to a specific configuration point.
Note this service does not cache any created objects.
Method Summary | ||
---|---|---|
void |
addObjectBuilderListener(ObjectBuilderListener listener)
Add a listener to the creation of POJO instances. |
|
|
create(java.lang.String name,
java.lang.Object... args)
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 |
removeObjectBuilderListener(ObjectBuilderListener listener)
Remove a listener from the list of listeners that are notified of the creation of POJO instances. |
Method Detail |
---|
<T> T create(java.lang.String name, java.lang.Object... args)
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.
name
- the unique id of the object definition in the
ObjectBuilderObjects
.args
- 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.<T> T get(java.lang.String name, java.lang.Object... args)
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.
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).void addObjectBuilderListener(ObjectBuilderListener listener)
listener
- listener to be notified whenever a new POJO instance is
createdvoid removeObjectBuilderListener(ObjectBuilderListener listener)
listener
- listener to be removed from the list
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |