public interface ServiceManager
Modifier and Type | Method and Description |
---|---|
void |
fireFrameworkEvent(XBundle bundle,
int type,
ServiceException ex) |
void |
fireServiceEvent(XBundle bundle,
int type,
ServiceState<?> serviceState) |
<S> S |
getService(XBundle bundle,
ServiceState<S> serviceState)
Returns the service object referenced by the specified
ServiceReference object. |
ServiceState<?> |
getServiceReference(XBundle bundle,
String clazz)
Returns a
ServiceReference object for a service that implements and was registered under the specified
class. |
List<ServiceState<?>> |
getServiceReferences(XBundle bundle,
String clazz,
String filterStr,
boolean checkAssignable)
Returns an array of
ServiceReference objects. |
ServiceState |
registerService(XBundle bundle,
String[] classNames,
Object serviceValue,
Dictionary properties)
Registers the specified service object with the specified properties under the specified class names into the Framework.
|
boolean |
ungetService(XBundle bundle,
ServiceState<?> serviceState)
Releases the service object referenced by the specified
ServiceReference object. |
void |
unregisterService(ServiceState<?> serviceState)
Unregister the given service.
|
ServiceState registerService(XBundle bundle, String[] classNames, Object serviceValue, Dictionary properties)
ServiceRegistration
object is returned. The ServiceRegistration
object is for the private use
of the bundle registering the service and should not be shared with other bundles. The registering bundle is defined to
be the context bundle.classNames
- The class names under which the service can be located.serviceValue
- The service object or a ServiceFactory
object.properties
- The properties for this service.ServiceRegistration
object for use by the bundle registering the serviceServiceState<?> getServiceReference(XBundle bundle, String clazz)
ServiceReference
object for a service that implements and was registered under the specified
class.clazz
- The class name with which the service was registered.ServiceReference
object, or null
List<ServiceState<?>> getServiceReferences(XBundle bundle, String clazz, String filterStr, boolean checkAssignable) throws InvalidSyntaxException
ServiceReference
objects. The returned array of ServiceReference
objects
contains services that were registered under the specified class, match the specified filter expression.
If checkAssignable is true, the packages for the class names under which the services were registered match the context
bundle's packages as defined in ServiceReference.isAssignableTo(Bundle, String)
.clazz
- The class name with which the service was registered or null
for all services.filterStr
- The filter expression or null
for all services.ServiceReference
objects.InvalidSyntaxException
<S> S getService(XBundle bundle, ServiceState<S> serviceState)
ServiceReference
object.reference
or null
void unregisterService(ServiceState<?> serviceState)
boolean ungetService(XBundle bundle, ServiceState<?> serviceState)
ServiceReference
object. If the context bundle's use
count for the service is zero, this method returns false
. Otherwise, the context bundle's use count for the
service is decremented by one.false
if the context bundle's use count for the service is zero or if the service has been
unregistered; true
otherwise.void fireFrameworkEvent(XBundle bundle, int type, ServiceException ex)
void fireServiceEvent(XBundle bundle, int type, ServiceState<?> serviceState)
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.