org.ops4j.peaberry.cache
Class AbstractServiceRegistry
java.lang.Object
org.ops4j.peaberry.cache.AbstractServiceRegistry
- All Implemented Interfaces:
- CachingServiceRegistry, ServiceRegistry, ServiceWatcher<Object>
- Direct Known Subclasses:
- OSGiServiceRegistry
public abstract class AbstractServiceRegistry
- extends Object
- implements CachingServiceRegistry
Partial ServiceRegistry implementation with generation based caching.
- Author:
- mcculls@gmail.com (Stuart McCulloch)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractServiceRegistry
protected AbstractServiceRegistry(boolean useNativeFilter)
lookup
public final <T> Iterable<Import<T>> lookup(Class<T> clazz,
AttributeFilter filter)
- Description copied from interface:
ServiceRegistry
- Lookup services from the registry, constrained by the given filter.
- Specified by:
lookup in interface ServiceRegistry
- Parameters:
clazz - expected service interfacefilter - service attribute filter
- Returns:
- ordered sequence of imported services, most recommended first
watch
public final <T> void watch(Class<T> clazz,
AttributeFilter filter,
ServiceWatcher<? super T> watcher)
- Description copied from interface:
ServiceRegistry
- Watch for services in the registry, constrained by the given filter.
- Specified by:
watch in interface ServiceRegistry
- Parameters:
clazz - expected service interfacefilter - service attribute filterwatcher - the watcher that should receive any matching services
flush
public final void flush(int targetGeneration)
- Description copied from interface:
CachingServiceRegistry
- Release any unused service instances from the cache.
- Specified by:
flush in interface CachingServiceRegistry
- Parameters:
targetGeneration - the generation to flush
createListener
protected abstract <T> AbstractServiceListener<T> createListener(String ldapFilter)
Copyright © 2006-2012 OPS4J - Open Participation Software for Java. All Rights Reserved.