net.sf.tie.ext.registry
Class InterceptedServiceRegistry
java.lang.Object
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)
).
Method Summary |
|
defineService(Class<T> type,
T implementation)
|
protected
|
find(Class<T> service)
This method provides a "last chance" opportunity to find an implementation of a service. |
|
get(Class<T> type)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InterceptedServiceRegistry
public InterceptedServiceRegistry(MethodInterceptorStack stack)
InterceptedServiceRegistry
public InterceptedServiceRegistry(InterceptionInjector injector)
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.