org.apache.felix.ipojo.architecture

## Class InstanceDescription

- java.lang.Object
- - org.apache.felix.ipojo.architecture.InstanceDescription

All Implemented Interfaces:
  InstanceStateListener

Direct Known Subclasses:
  PrimitiveInstanceDescription

    public class InstanceDescription
    extends java.lang.Object
    implements InstanceStateListener

Instance Description.

Author:
  Felix Project Team

### Field Summary

Fields
`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

Constructors
Constructor and Description
`InstanceDescription(ComponentTypeDescription desc, ComponentInstance ci)` Creates the instance description.

### Method Summary

All Methods Instance Methods Concrete Methods
`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.
`org.apache.felix.ipojo.metadata.Element` `getDescription()` Gets the instance description.
`HandlerDescription` `getHandlerDescription(java.lang.String handler)` Gets a handler description by specifying the handler qualified name.
`HandlerDescription[]` `getHandlers()` Gets the plugged handler list.
`ComponentInstance` `getInstance()` Gets the underlying component instance
`java.lang.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 final ComponentInstance m_instance

The Underlying component instance.

#### m_type

    protected final 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

#### getInstance

    public ComponentInstance getInstance()

Gets the underlying component instance

Returns:
  the component instance.

#### getName

    public java.lang.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(java.lang.String handler)

Gets a handler description by specifying the handler qualified name. This method ignores case of the given handler 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 org.apache.felix.ipojo.metadata.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)`