net.sf.tie.ext.registry
Class InterceptedServiceRegistry

java.lang.Object
  extended by net.sf.tie.ext.registry.InterceptedServiceRegistry
All Implemented Interfaces:
ServiceRegistry

public class InterceptedServiceRegistry
extends Object
implements ServiceRegistry

The InterceptedServiceRegistry creates a ServiceRegistry where all service implementations are automatically intercepted. The implementations may be pre-defined (see defineService(Class, Object), or may be dynamically loaded (see find(Class)).


Nested Class Summary
 class InterceptedServiceRegistry.NoSuchServiceException
           
 
Constructor Summary
InterceptedServiceRegistry(InterceptionInjector injector)
           
InterceptedServiceRegistry(MethodInterceptorStack stack)
           
 
Method Summary
<T> T
defineService(Class<T> type, T implementation)
           
protected
<T> T
find(Class<T> service)
          This method provides a "last chance" opportunity to find an implementation of a service.
<T> T
get(Class<T> type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InterceptedServiceRegistry

public InterceptedServiceRegistry(MethodInterceptorStack stack)

InterceptedServiceRegistry

public InterceptedServiceRegistry(InterceptionInjector injector)
Method Detail

defineService

public <T> T defineService(Class<T> type,
                           T implementation)

get

public <T> T get(Class<T> type)
Specified by:
get in interface ServiceRegistry

find

protected <T> T find(Class<T> service)
This method provides a "last chance" opportunity to find an implementation of a service. This may include pulling it from another ServiceRegistry, or dynamically loading and constructing an object. Derived classes should override this method to support dynamic provisioning of services in this way.