|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.ipojo.api.Service
public class Service
Allows configuring a provided service.
Field Summary | |
---|---|
static int |
INSTANCE_STRATEGY
Creation strategy : one service object per instance. |
static int |
SERVICE_STRATEGY
Creation strategy : one service object per bundle (OSGi service factory). |
static int |
SINGLETON_STRATEGY
Creation strategy : singleton (default). |
static int |
STATIC_STRATEGY
Creation strategy : delegate on the static factory method. |
Constructor Summary | |
---|---|
Service()
|
Method Summary | |
---|---|
Service |
addProperty(ServiceProperty ps)
Adds a service property. |
Service |
addProperty(String key,
Object obj)
Adds a service property. |
Element |
getElement()
Gets the provided service element. |
ProvidedServiceDescription |
getProvidedServiceDescription(ComponentInstance instance)
Gets the provided service description associated with the current service. |
Service |
setCreationStrategy(int strategy)
Sets the creation strategy. |
Service |
setCreationStrategy(String strategy)
Sets the creation strategy. |
Service |
setServiceController(String field,
boolean initialValue)
Sets the service controller. |
Service |
setSpecification(String spec)
Sets the provided service specification. |
Service |
setSpecifications(List specs)
Sets the provided service specifications. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SINGLETON_STRATEGY
public static final int STATIC_STRATEGY
public static final int INSTANCE_STRATEGY
public static final int SERVICE_STRATEGY
Constructor Detail |
---|
public Service()
Method Detail |
---|
public Element getElement()
getElement
in interface HandlerConfiguration
public ProvidedServiceDescription getProvidedServiceDescription(ComponentInstance instance)
instance
- the instance on which looking for the provided service description
null
if not found.public Service addProperty(ServiceProperty ps)
ps
- the service property to add
public Service addProperty(String key, Object obj)
key
- the property keyobj
- the initial value (can be null
)
public Service setSpecification(String spec)
spec
- the service specification
public Service setSpecifications(List specs)
specs
- the service specifications
public Service setCreationStrategy(int strategy)
strategy
- the service strategy.
public Service setCreationStrategy(String strategy)
strategy
- the service strategy
public Service setServiceController(String field, boolean initialValue)
field
- the controller fieldinitialValue
- the initial value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |