|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.felix.servicebinder.InstanceManager
public class InstanceManager
A InstanceManager is created for every component instance. * * When the InstanceManager is instantiated, a collection of DependencyManagers is * created. Each dependency manager corresponds to a required service * * A InstanceManager follows a sequence of clearly defined steps. * * 1.- Creation : the binder instance is created, its state becomes CREATED. This step is further divided * in the following substeps: * - The binder instance checks if all of the dependencies are valid, if this * is false, it returns. * - If the dependendencies are valid, its state becomes executing. The object from * the instance class is created (if this object receives a ServiceBinderContext as * a parameter in its constructor, the context is passed to it. * - The validate() method is called on the dependency managers, this will cause * calls on the binding methods to occur * - The binder instance adds itself to the list of binder instances in the activator * - The binder instance registers the services implemented by the instance object. * * 2.- Disposal : * * @author Felix Project Team
| Nested Class Summary | |
|---|---|
static class |
InstanceManager.StateChangeMulticaster
|
| Nested classes/interfaces inherited from interface org.apache.felix.servicebinder.InstanceReference |
|---|
InstanceReference.ValueHolder |
| Field Summary |
|---|
| Fields inherited from interface org.apache.felix.servicebinder.InstanceReference |
|---|
INSTANCE_BUNDLE, INSTANCE_DEPENDENCIES, INSTANCE_METADATA, INSTANCE_STATE |
| Fields inherited from interface org.apache.felix.servicebinder.architecture.Instance |
|---|
INSTANCE_CREATED, INSTANCE_DESTROYED, INSTANCE_INVALID, INSTANCE_VALID |
| 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. |
protected void |
fireInstanceReferenceInvalidating()
Fires an event when the instance reference is invalidating |
protected void |
fireInstanceReferenceValidated()
Fires an event when the instance reference has been validated |
Object |
get(String name)
Get a property associated with this instance. |
long |
getBundleId()
Get the state |
Instance[] |
getChildInstances()
Get a list of child instances in case this is a factory |
Dependency[] |
getDependencies()
Get an array of dependencies for this instance. |
InstanceMetadata |
getInstanceMetadata()
Returns the InstanceMetadata |
Object |
getObject()
Get the object that is implementing this descriptor |
int |
getState()
Get the state |
void |
put(String name,
Object obj)
Associate a property with this instance. |
void |
removeInstanceReferenceListener(InstanceReferenceListener l)
Removes an instance reference listener. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public InstanceMetadata getInstanceMetadata()
getInstanceMetadata in interface Instancepublic Object getObject()
getObject in interface InstanceReferencepublic int getState()
getState in interface Instancepublic long getBundleId()
getBundleId in interface Instancepublic Object get(String name)
get in interface InstanceReferencename - the name of the property to retrieve.
public void put(String name,
Object obj)
put in interface InstanceReferencename - the name of the property to add.obj - the value of the property.public void addInstanceReferenceListener(InstanceReferenceListener l)
addInstanceReferenceListener in interface InstanceReferencel - the listener to add.public void removeInstanceReferenceListener(InstanceReferenceListener l)
removeInstanceReferenceListener in interface InstanceReferencel - the listener to remove.protected void fireInstanceReferenceValidated()
protected void fireInstanceReferenceInvalidating()
public Dependency[] getDependencies()
getDependencies in interface Instancepublic Instance[] getChildInstances()
getChildInstances in interface Instance
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||