org.apache.felix.dm.runtime
Class FactorySet
java.lang.Object
org.apache.felix.dm.runtime.FactorySet
public class FactorySet
- extends
This class implements a java.util.Set
which acts as a service factory.
When a Service contains a factory
attribute, this class is provided
into the OSGi registry with a dm.factory.name
service property. So, another factory component
may be injected with this Set. And each time a Dictionary configuration is registered in the Set,
then a new Service instance will be instantiated, and will be provided with the Dictionary passed to the
Service instance.
Method Summary |
boolean |
add(Dictionary configuration)
Create or Update a Service. |
void |
clear()
Another Service wants to remove all existing Services. |
|
iterator()
returns the list of active Service instances configurations. |
boolean |
remove(Object configuration)
Another Service wants to remove an existing Service. |
int |
size()
Returns the number of active Service instances. |
void |
start()
Our Service is starting. |
void |
stop()
Our Service is stopping: we have to remove all Service instances that we have created. |
String |
toString()
|
FactorySet
public FactorySet(Bundle b,
MetaData srvMeta,
depsMeta)
- Sole constructor.
- Parameters:
b
- the bundle containing the Service annotated with the factory attributeimpl
- The Service implementation classserviceProperties
- The Service propertiesprovides
- The Services provided by this ServicefactoryConfigure
- The configure callback invoked in order to pass configurations added in this Set.
start
public void start()
- Our Service is starting.
stop
public void stop()
- Our Service is stopping: we have to remove all Service instances that we have created.
add
public boolean add(Dictionary configuration)
- Create or Update a Service.
remove
public boolean remove(Object configuration)
- Another Service wants to remove an existing Service.
This method is not synchronized but uses a SerialExecutor for serializing concurrent method call.
(This avoid potential dead locks, especially when Service callback methods are invoked).
clear
public void clear()
- Another Service wants to remove all existing Services.
This method is not synchronized but uses a SerialExecutor for serializing concurrent method call.
(This avoid potential dead locks, especially when Service callback methods are invoked).
iterator
public iterator()
- returns the list of active Service instances configurations.
toString
public String toString()
size
public int size()
- Returns the number of active Service instances.
Copyright © 2011 Apache Software Foundation. All Rights Reserved.