org.apache.felix.ipojo
Interface ComponentInstance

All Known Implementing Classes:
HandlerManager, InstanceManager

public interface ComponentInstance

The component instance class manages one instance of a component type.

Author:
Felix Project Team

Field Summary
static int DISPOSED
          Component Instance State : DISPOSED.
static int INVALID
          Component Instance State : INVALID.
static int STOPPED
          Component Instance State : STOPPED.
static int VALID
          Component Instance State : VALID.
 
Method Summary
 void addInstanceStateListener(InstanceStateListener listener)
          Add an instance state listener on the current instance.
 void dispose()
          Dispose the component instance.
 org.osgi.framework.BundleContext getContext()
          Return the bundle context of this instance.
 ComponentFactory getFactory()
          Return the factory which create this instance.
 InstanceDescription getInstanceDescription()
          Return the instance description.
 java.lang.String getInstanceName()
          Return the name of the instance.
 int getState()
          Return the actual state of the instance.
 boolean isStarted()
          Check if the instance is started.
 void reconfigure(java.util.Dictionary configuration)
          Re-configure an instance.
 void removeInstanceStateListener(InstanceStateListener listener)
          Remove an instance state listener on the current instance.
 void start()
          Start the component instance.
 void stop()
          Stop the component instance.
 

Field Detail

DISPOSED

static final int DISPOSED
Component Instance State : DISPOSED. The instance was destroyed.

See Also:
Constant Field Values

STOPPED

static final int STOPPED
Component Instance State : STOPPED. The component instance is not started.

See Also:
Constant Field Values

INVALID

static final int INVALID
Component Instance State : INVALID. The component is invalid when it start or when a component dependency is invalid.

See Also:
Constant Field Values

VALID

static final int VALID
Component Instance State : VALID. The component is resolved when it is running and all its component dependencies are valid.

See Also:
Constant Field Values
Method Detail

start

void start()
Start the component instance.


stop

void stop()
Stop the component instance. A stopped instance can be re-started.


dispose

void dispose()
Dispose the component instance. A disposed instance cannot be re-started.


getState

int getState()
Return the actual state of the instance.

Returns:
the actual state of the component instance.

getInstanceDescription

InstanceDescription getInstanceDescription()
Return the instance description.

Returns:
the instance description of the current instance

getFactory

ComponentFactory getFactory()
Return the factory which create this instance.

Returns:
the factory of the component instance.

getContext

org.osgi.framework.BundleContext getContext()
Return the bundle context of this instance.

Returns:
the context of the component instance

getInstanceName

java.lang.String getInstanceName()
Return the name of the instance.

Returns:
the name of the component instance

isStarted

boolean isStarted()
Check if the instance is started.

Returns:
true if getState returns INVALID or VALID.

reconfigure

void reconfigure(java.util.Dictionary configuration)
Re-configure an instance. Do nothing if the instance does not support dynamic reconfiguration. The reconfiguration does not stop the instance.

Parameters:
configuration - : the new configuration.

addInstanceStateListener

void addInstanceStateListener(InstanceStateListener listener)
Add an instance state listener on the current instance.

Parameters:
listener - : the listener to add.

removeInstanceStateListener

void removeInstanceStateListener(InstanceStateListener listener)
Remove an instance state listener on the current instance.

Parameters:
listener - : the listener to remove.