Bundles that wish to filter imported services based on their registered
properties should override the method start() as follows:
protected void start() {
String filter = "(&(cn=simona)(o=OTI)(c=US))";
addImportedServiceFilter(CounterService.SERVICE_NAME, filter);
}
start() method a filter is added for the imported
CounterService by calling the configuration method
addImportedServiceFilter(String, String).
service.ranking attribute
is chosen. If two or more services are tied with the same
service.ranking attribute, the service with the
lowest service.id attribute is chosen.
> SAT Warning: Failed to acquire service matching the filter <Filter>. > Service: <Service-Name> > Source: <Bundle-SymbolicName>
> SAT Warning: LDAP filter contains questionable whitespace - <Filter>. > Service: <Service-Name> > Source: <Bundle-SymbolicName>
addImportedServiceFilter(String, String) can also be used
to change a bundles imported service filter, even after the imported
service has been acquired.
removeImportedServiceFilter(String) can be used to remove
an imported service filter, even after the imported service has been
acquired.
addImportedServiceFilter(String, String), SAT will compare
the acquired service with the filter, and possibly release it if its
service attributes do not match the new filter.
Copyright © 2001, 2007 IBM Corporation and others. All Rights Reserved.