org.apache.felix.servicebinder
Class InstanceManager.StateChangeMulticaster

java.lang.Object
  extended by org.apache.felix.servicebinder.InstanceManager.StateChangeMulticaster
All Implemented Interfaces:
EventListener, InstanceReferenceListener
Enclosing class:
InstanceManager

public static class InstanceManager.StateChangeMulticaster
extends Object
implements InstanceReferenceListener

Version:
X.XX Feb 3, 2004 * @author Humberto Cervantes

Field Summary
protected  InstanceReferenceListener a
           
protected  InstanceReferenceListener b
           
 
Constructor Summary
protected InstanceManager.StateChangeMulticaster(InstanceReferenceListener a, InstanceReferenceListener b)
           
 
Method Summary
static InstanceReferenceListener add(InstanceReferenceListener a, InstanceReferenceListener b)
           
 void invalidating(InstanceReferenceEvent e)
          This method is called when an InstanceReference's underlying object is going to be invalidated.
static InstanceReferenceListener remove(InstanceReferenceListener a, InstanceReferenceListener b)
           
 void validated(InstanceReferenceEvent e)
          This method is called when an InstanceReference's underlying object becomes valid, i.e., the instance is available for use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

a

protected InstanceReferenceListener a

b

protected InstanceReferenceListener b
Constructor Detail

InstanceManager.StateChangeMulticaster

protected InstanceManager.StateChangeMulticaster(InstanceReferenceListener a,
                                                 InstanceReferenceListener b)
Method Detail

validated

public void validated(InstanceReferenceEvent e)
Description copied from interface: InstanceReferenceListener
This method is called when an InstanceReference's underlying object becomes valid, i.e., the instance is available for use. This event is fired during the following sequence of steps:

  1. Instance created.
  2. Dependencies bound, if any.
  3. Services registered, if any.
  4. Lifecycle.activate() is called, if the instance implements the Lifecycle interface.
  5. Fire InstanceReferenceListener.validated().

Specified by:
validated in interface InstanceReferenceListener
Parameters:
e - the associated instance reference event.

invalidating

public void invalidating(InstanceReferenceEvent e)
Description copied from interface: InstanceReferenceListener
This method is called when an InstanceReference's underlying object is going to be invalidated. This event is fired during the following sequence of steps:

  1. Fire InstanceReferenceListener.invalidating().
  2. Call Lifecycle.deactivate(), if the instance implements the Lifecycle interface.
  3. Unregister services, if any.
  4. Unbind dependencies, if any.
  5. Dispose instance.

Note: Care must be taken during this callback, because the underlying object associated with the instance reference may not be fully functioning. For example, this event might be fired in direct response to a dependent service shutting down, which then instigates the invalidation of the underlying object instance.

Specified by:
invalidating in interface InstanceReferenceListener
Parameters:
e - the associated instance reference event.

add

public static InstanceReferenceListener add(InstanceReferenceListener a,
                                            InstanceReferenceListener b)

remove

public static InstanceReferenceListener remove(InstanceReferenceListener a,
                                               InstanceReferenceListener b)


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.