|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface InstanceReference
This interface creates a level of indirection for the objects created by a factory. This is necessary because it might not be possible for a factory to create the actual object instance at the time of the call to Factory.createInstance() due to unfulfilled dependencies. In such a scenario, this interface can be used to listen for the object instance to become available.
| Nested Class Summary | |
|---|---|
static interface |
InstanceReference.ValueHolder
A simple interface that enabled deferred value creation for the InstanceReference.get() and InstanceReference.put() methods. |
| Field Summary | |
|---|---|
static String |
INSTANCE_BUNDLE
|
static String |
INSTANCE_DEPENDENCIES
|
static String |
INSTANCE_METADATA
|
static String |
INSTANCE_STATE
|
| Method Summary | |
|---|---|
void |
addInstanceReferenceListener(InstanceReferenceListener l)
Adds an instance reference listener to listen for changes to the availability of the underlying object associated with this instance reference. |
Object |
get(String name)
Get a property associated with this instance. |
Object |
getObject()
Gets the actual object associated with this instance refernce. |
void |
put(String name,
Object value)
Associate a property with this instance. |
void |
removeInstanceReferenceListener(InstanceReferenceListener l)
Removes an instance reference listener. |
| Field Detail |
|---|
static final String INSTANCE_STATE
static final String INSTANCE_METADATA
static final String INSTANCE_BUNDLE
static final String INSTANCE_DEPENDENCIES
| Method Detail |
|---|
Object get(String name)
name - the name of the property to retrieve.
void put(String name,
Object value)
name - the name of the property to add.value - the value of the property.Object getObject()
void addInstanceReferenceListener(InstanceReferenceListener l)
l - the listener to add.void removeInstanceReferenceListener(InstanceReferenceListener l)
l - the listener to remove.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||