org.apache.felix.ipojo.handlers.providedservice.strategy

## Class ConfigurableCreationStrategy

- java.lang.Object
- - org.apache.felix.ipojo.handlers.providedservice.CreationStrategy
  - - org.apache.felix.ipojo.handlers.providedservice.strategy.ConfigurableCreationStrategy

All Implemented Interfaces:
  org.osgi.framework.ServiceFactory

    public abstract class ConfigurableCreationStrategy
    extends CreationStrategy

This `CreationStrategy` is here to ease customization of the strategy by hiding all the reflection stuff.

Author:
  Felix Project Team

### Constructor Summary

Constructors
Constructor and Description
`ConfigurableCreationStrategy()`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`java.lang.Object` `getService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration registration)` Method called when a bundle want to access a service.
`protected abstract IPOJOServiceFactory` `getServiceFactory(InstanceManager manager)` User provided `CreationStrategy` MUST implement this method to provide the real iPOJO ServiceFactory instance.
`void` `onPublication(InstanceManager manager, java.lang.String[] specifications, java.util.Properties props)` Method called when the underlying iPOJO Service factory is published.
`void` `onUnpublication()` Method called when the underlying iPOJO Service factory is un-published.
`void` `ungetService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration registration, java.lang.Object service)` Method called when a bundle release a service.

### Methods inherited from class org.apache.felix.ipojo.handlers.providedservice.CreationStrategy

`isGetServiceMethod, isUngetServiceMethod`

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

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

### Constructor Detail

#### ConfigurableCreationStrategy

    public ConfigurableCreationStrategy()

### Method Detail

#### onPublication

    public void onPublication(InstanceManager manager,
                              java.lang.String[] specifications,
                              java.util.Properties props)

Method called when the underlying iPOJO Service factory is published.

Specified by:
  `onPublication` in class `CreationStrategy`
Parameters:
  `manager` - the instance manager
  `specifications` - the provided specifications
  `props` - the service properties
See Also:
  `CreationStrategy.onPublication(org.apache.felix.ipojo.InstanceManager, java.lang.String[], java.util.Properties)`

#### onUnpublication

    public void onUnpublication()

Method called when the underlying iPOJO Service factory is un-published.

Specified by:
  `onUnpublication` in class `CreationStrategy`
See Also:
  `CreationStrategy.onUnpublication()`

#### getService

    public java.lang.Object getService(org.osgi.framework.Bundle bundle,
                                       org.osgi.framework.ServiceRegistration registration)

Method called when a bundle want to access a service. This method is called once per asking bundle. To turn around this limitation, a proxy is registered.

Parameters:
  `bundle` - the asking bundle
  `registration` - the service registration
Returns:
  the service object
See Also:
  `ServiceFactory.getService(org.osgi.framework.Bundle, org.osgi.framework.ServiceRegistration)`

#### ungetService

    public void ungetService(org.osgi.framework.Bundle bundle,
                             org.osgi.framework.ServiceRegistration registration,
                             java.lang.Object service)

Method called when a bundle release a service.

Parameters:
  `bundle` - the bundle
  `registration` - the service registration
  `service` - the service object
See Also:
  `ServiceFactory.ungetService(org.osgi.framework.Bundle, org.osgi.framework.ServiceRegistration, java.lang.Object)`

#### getServiceFactory

    protected abstract IPOJOServiceFactory getServiceFactory(InstanceManager manager)

User provided `CreationStrategy` MUST implement this method to provide the real iPOJO ServiceFactory instance.

Parameters:
  `manager` - `InstanceManager` that the factory could use
Returns:
  an instance of `IPOJOServiceFactory`