|
Service Activator Toolkit
Version 1.0.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
An IServiceDetecter declares the role of an object that will
detect the registration and unregistration of services of a specified type.
The following responsibilities are declared:
An IServiceDetecter can have listeners that are an
implementation of the interface ServiceDetecterListener that are
notified when a service of the specified type has been added to, or removed
from, the IServiceDetecter. An IServiceDetecter
may include a filter that allows for finer grained service detection within a
specified type.
Note: In most situations it is simply not necessary to use an
IServiceDetecter, since explicit service registration is
preferable. Situations where using IServiceDetecter is
helpful include:
LogService objects are
registered or unregistered.
Note: Instances of this interface can be created using the
FactoryUtility class.
| Method Summary | |
void |
acquire()
Acquire the imported services. |
void |
addServiceDetecterListener(ServiceDetecterListener listener)
Add ServiceDetecterListener to the detecter. |
String |
getName()
Get the name of the service being detected. |
List |
getServiceReferences()
Query the service references that have been detected. |
List |
getServiceReferences(String filter)
Query the service references that have been detected, filtered by the specified LDAP filter. |
List |
getServices()
Query the services that have been detected. |
List |
getServices(String filter)
Query the services that have been detected, filtered by the specified LDAP filter. |
boolean |
isAcquired()
Query whether the detecter is acquired or not. |
void |
release()
Release the services contained in the IServiceDetecter. |
void |
removeServiceDetecterListener(ServiceDetecterListener listener)
Add ServiceDetecterListener to the detecter. |
void |
setFilter(String filter)
Sets the IServiceDetecter object's service filter. |
| Method Detail |
public void acquire()
public void addServiceDetecterListener(ServiceDetecterListener listener)
ServiceDetecterListener to the detecter.
listener - A ServiceDetecterListener.public String getName()
public List getServiceReferences()
public List getServiceReferences(String filter)
throws InvalidSyntaxException
filter - An LDAP filter with which to filter the service
references objects.
InvalidSyntaxException - when the filter parameter is invalid.public List getServices()
public List getServices(String filter)
throws InvalidSyntaxException
filter - An LDAP filter with which to filter the service objects.
InvalidSyntaxException - when the filter parameter is invalid.public boolean isAcquired()
public void release()
IServiceDetecter.
public void removeServiceDetecterListener(ServiceDetecterListener listener)
ServiceDetecterListener to the detecter.
listener - A ServiceDetecterListener.
public void setFilter(String filter)
throws InvalidSyntaxException
IServiceDetecter object's service filter. The
filter is applied to existing services and services that are subsequently
registered with the OSGi framework. Services that do not match the
filter are removed from the IServiceDetecter. Registered
services that match the filter, will be added to the
IServiceDetecter.
filter - The LDAP service filter.
InvalidSyntaxException - when the specified
filter is invalid.
|
Service Activator Toolkit
Version 1.0.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright © 2001, 2007 IBM Corporation and others. All Rights Reserved.