org.apache.felix.ipojo.handlers.providedservice
Class CreationStrategy

java.lang.Object
  extended by org.apache.felix.ipojo.handlers.providedservice.CreationStrategy
All Implemented Interfaces:
ServiceFactory
Direct Known Subclasses:
ConfigurableCreationStrategy

public abstract class CreationStrategy
extends Object
implements ServiceFactory

Creation strategy to creation service object. This class is extended by all service object creation policy.

Author:
Felix Project Team

Constructor Summary
CreationStrategy()
           
 
Method Summary
static boolean isGetServiceMethod(Method method)
          Checks if the given method object is the IPOJOServiceFactory#getService(ComponentInstance) method.
static boolean isUngetServiceMethod(Method method)
          Checks if the given method object is the IPOJOServiceFactory#ungetService(ComponentInstance, Object) method.
abstract  void onPublication(InstanceManager instance, String[] interfaces, Properties props)
          Method called when the service is registered.
abstract  void onUnpublication()
          Method called when the service in unregistered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.osgi.framework.ServiceFactory
getService, ungetService
 

Constructor Detail

CreationStrategy

public CreationStrategy()
Method Detail

onPublication

public abstract void onPublication(InstanceManager instance,
                                   String[] interfaces,
                                   Properties props)
Method called when the service is registered.

Parameters:
instance - the instance registering the service.
interfaces - the exposed service specification interfaces
props - the published properties.

onUnpublication

public abstract void onUnpublication()
Method called when the service in unregistered.


isGetServiceMethod

public static boolean isGetServiceMethod(Method method)
Checks if the given method object is the IPOJOServiceFactory#getService(ComponentInstance) method.

Parameters:
method - the method to check
Returns:
true if the method is the getService method false otherwise.

isUngetServiceMethod

public static boolean isUngetServiceMethod(Method method)
Checks if the given method object is the IPOJOServiceFactory#ungetService(ComponentInstance, Object) method.

Parameters:
method - the method to check
Returns:
true if the method is the ungetService method false otherwise.


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.