org.apache.felix.ipojo.handlers.context

## Class BundleContextHandler

- java.lang.Object
- - org.apache.felix.ipojo.Handler
  - - org.apache.felix.ipojo.PrimitiveHandler
    - - org.apache.felix.ipojo.handlers.context.BundleContextHandler

All Implemented Interfaces:
  ConstructorInjector, FieldInterceptor, MethodInterceptor

    public class BundleContextHandler
    extends PrimitiveHandler

A handler injecting the bundle context in the implementation code.

Since:
  1.11.2

### Field Summary

### Fields inherited from class org.apache.felix.ipojo.PrimitiveHandler

`HANDLER_TYPE`

### Fields inherited from class org.apache.felix.ipojo.Handler

`HANDLER_LEVEL_PROPERTY, HANDLER_NAME_PROPERTY, HANDLER_NAMESPACE_PROPERTY, HANDLER_TYPE_PROPERTY, m_instance, m_isValid`

### Constructor Summary

Constructors
Constructor and Description
`BundleContextHandler()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `configure(org.apache.felix.ipojo.metadata.Element metadata, java.util.Dictionary configuration)` Configures the handler.
`void` `onCreation(java.lang.Object instance)` Callback method called when an instance of the component is created, but before someone can use it.
`void` `start()` Starts the handler This method starts the management.
`void` `stop()` Stops the handler This method stops the management.

### Methods inherited from class org.apache.felix.ipojo.PrimitiveHandler

`attach, getConstructorParameter, getConstructorParameterType, getFactory, getHandler, getInstanceManager, getLogger, getPojoMetadata, onEntry, onError, onExit, onFinally, onGet, onSet, setFactory`

### Methods inherited from class org.apache.felix.ipojo.Handler

`debug, error, error, getDescription, getHandlerManager, getValidity, info, initializeComponentFactory, isValid, reconfigure, setValidity, stateChanged, warn, warn`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### BundleContextHandler

    public BundleContextHandler()

### Method Detail

#### configure

    public void configure(org.apache.felix.ipojo.metadata.Element metadata,
                          java.util.Dictionary configuration)
                   throws ConfigurationException

Configures the handler. This method collects all `context` element.

Specified by:
  `configure` in class `Handler`
Parameters:
  `metadata` - the metadata of the component
  `configuration` - the instance configuration
Throws:
  `ConfigurationException` - if the metadata are not correct.

#### stop

    public void stop()

Stops the handler This method stops the management.

Specified by:
  `stop` in class `Handler`

#### start

    public void start()

Starts the handler This method starts the management.

Specified by:
  `start` in class `Handler`

#### onCreation

    public void onCreation(java.lang.Object instance)

Callback method called when an instance of the component is created, but before someone can use it. Injects the bundle context in all declared bundle callbacks.

Overrides:
  `onCreation` in class `PrimitiveHandler`
Parameters:
  `instance` - the created instance