public class Service extends java.lang.Object implements HandlerConfiguration
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
Service() |
Modifier and Type | Method and Description |
---|---|
Service |
addProperty(ServiceProperty ps)
Adds a service property.
|
Service |
addProperty(java.lang.String key,
java.lang.Object obj)
Adds a service property.
|
org.apache.felix.ipojo.metadata.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(java.lang.String strategy)
Sets the creation strategy.
|
Service |
setPostRegistrationCallback(java.lang.String callback)
Sets the post-registration callback.
|
Service |
setPostUnregistrationCallback(java.lang.String callback)
Sets the post-unregistration callback.
|
Service |
setServiceController(java.lang.String field,
boolean initialValue)
Sets the service controller.
|
Service |
setSpecification(java.lang.String spec)
Sets the provided service specification.
|
Service |
setSpecifications(java.util.List specs)
Sets the provided service specifications.
|
public static final int SINGLETON_STRATEGY
public static final int STATIC_STRATEGY
public static final int INSTANCE_STRATEGY
public static final int SERVICE_STRATEGY
public org.apache.felix.ipojo.metadata.Element getElement()
getElement
in interface HandlerConfiguration
public ProvidedServiceDescription getProvidedServiceDescription(ComponentInstance instance)
instance
- the instance on which looking for the provided service descriptionnull
if not found.public Service addProperty(ServiceProperty ps)
ps
- the service property to addpublic Service addProperty(java.lang.String key, java.lang.Object obj)
key
- the property keyobj
- the initial value (can be null
)public Service setSpecification(java.lang.String spec)
spec
- the service specificationpublic Service setSpecifications(java.util.List specs)
specs
- the service specificationspublic Service setCreationStrategy(int strategy)
strategy
- the service strategy.public Service setCreationStrategy(java.lang.String strategy)
strategy
- the service strategypublic Service setServiceController(java.lang.String field, boolean initialValue)
field
- the controller fieldinitialValue
- the initial valuepublic Service setPostRegistrationCallback(java.lang.String callback)
callback
- the callback name (method name)public Service setPostUnregistrationCallback(java.lang.String callback)
callback
- the callback name (method name)Copyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.