org.apache.felix.ipojo.architecture
Class InstanceDescription

java.lang.Object
  extended by org.apache.felix.ipojo.architecture.InstanceDescription
All Implemented Interfaces:
InstanceStateListener
Direct Known Subclasses:
PrimitiveInstanceDescription

public class InstanceDescription
extends Object
implements InstanceStateListener

Instance Description.

Author:
Felix Project Team

Field Summary
protected  HandlerDescription[] m_handlers
          The list of handlers plugged on the component instance.
protected  ComponentInstance m_instance
          The Underlying component instance.
protected  ComponentTypeDescription m_type
          Component Type of the instance.
 
Constructor Summary
InstanceDescription(ComponentTypeDescription desc, ComponentInstance ci)
          Creates the instance description.
 
Method Summary
 void addHandler(HandlerDescription desc)
          Adds an handler description to the list.
 long getBundleId()
          Gets the bundle id of the bundle containing the component type of the instance.
 ComponentTypeDescription getComponentDescription()
          Gets the component type description of the described instance.
 Element getDescription()
          Gets the instance description.
 HandlerDescription getHandlerDescription(String handler)
          Gets a handler description by specifying the handler qualified name.
 HandlerDescription[] getHandlers()
          Gets the plugged handler list.
 String getName()
          Gets the instance name.
 int getState()
          Gets the state of the described instance.
 void stateChanged(ComponentInstance instance, int newState)
          The underlying instance state changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_handlers

protected HandlerDescription[] m_handlers
The list of handlers plugged on the component instance.


m_instance

protected ComponentInstance m_instance
The Underlying component instance.


m_type

protected ComponentTypeDescription m_type
Component Type of the instance.

Constructor Detail

InstanceDescription

public InstanceDescription(ComponentTypeDescription desc,
                           ComponentInstance ci)
Creates the instance description.

Parameters:
ci - the state of the instance.
desc - the component type description of this instance.
Method Detail

getName

public String getName()
Gets the instance name.

Returns:
the name of the instance.

getComponentDescription

public ComponentTypeDescription getComponentDescription()
Gets the component type description of the described instance.

Returns:
: the component type description of this instance.

getHandlers

public HandlerDescription[] getHandlers()
Gets the plugged handler list.

Returns:
the live handler list

addHandler

public void addHandler(HandlerDescription desc)
Adds an handler description to the list.

Parameters:
desc - : the handler description to add

getHandlerDescription

public HandlerDescription getHandlerDescription(String handler)
Gets a handler description by specifying the handler qualified name.

Parameters:
handler - the handler name
Returns:
the handler description or null if not found

getState

public int getState()
Gets the state of the described instance.

Returns:
the state of the instance.

getBundleId

public long getBundleId()
Gets the bundle id of the bundle containing the component type of the instance.

Returns:
the bundle id owning the component implementation class.

getDescription

public Element getDescription()
Gets the instance description.

Returns:
the instance description

stateChanged

public void stateChanged(ComponentInstance instance,
                         int newState)
The underlying instance state changes.

Specified by:
stateChanged in interface InstanceStateListener
Parameters:
instance - the instance
newState - the new state
See Also:
InstanceStateListener.stateChanged(org.apache.felix.ipojo.ComponentInstance, int)


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