org.ops4j.peaberry
Interface ServiceRegistry

All Superinterfaces:
ServiceWatcher<Object>
All Known Subinterfaces:
CachingServiceRegistry
All Known Implementing Classes:
AbstractServiceRegistry, OSGiServiceRegistry, RegistryChain

public interface ServiceRegistry
extends ServiceWatcher<Object>

A registry is a ServiceWatcher that allows lookup of services.

Author:
mcculls@gmail.com (Stuart McCulloch)

Method Summary
<T> Iterable<Import<T>>
lookup(Class<T> clazz, AttributeFilter filter)
          Lookup services from the registry, constrained by the given filter.
<T> void
watch(Class<T> clazz, AttributeFilter filter, ServiceWatcher<? super T> watcher)
          Watch for services in the registry, constrained by the given filter.
 
Methods inherited from interface org.ops4j.peaberry.ServiceWatcher
add
 

Method Detail

lookup

<T> Iterable<Import<T>> lookup(Class<T> clazz,
                               AttributeFilter filter)
Lookup services from the registry, constrained by the given filter.

Parameters:
clazz - expected service interface
filter - service attribute filter
Returns:
ordered sequence of imported services, most recommended first

watch

<T> void watch(Class<T> clazz,
               AttributeFilter filter,
               ServiceWatcher<? super T> watcher)
Watch for services in the registry, constrained by the given filter.

Parameters:
clazz - expected service interface
filter - service attribute filter
watcher - the watcher that should receive any matching services
Throws:
UnsupportedOperationException - if watching is not supported


Copyright © 2006-2012 OPS4J - Open Participation Software for Java. All Rights Reserved.