net.sf.tie
Interface InterceptionInjector

All Known Implementing Classes:
CachingInjector, ProxyInjector

public interface InterceptionInjector

An InterceptionInjector wraps objects to support method interception.


Method Summary
 boolean isWrapped(Object value)
          Determines whether the supplied value is a wrapped value from this interceptor.
<T> T
wrapObject(Class<T> type, T endPoint)
          Wraps the designated object endPoint in any preconfigured MethodInterceptors.
 

Method Detail

wrapObject

<T> T wrapObject(Class<T> type,
                 T endPoint)
Wraps the designated object endPoint in any preconfigured MethodInterceptors. Returns an object O, such that if a method M is invoked on O, then the provided interceptors will be called, prior to an invocation of the original method M on endPoint. It is acceptable for implementations to return the endPoint directly if there is no interception to perform, or if the interception can be performed without constructing additional objects. However, it is typical for the return value to be a dynamically created proxy around endPoint.

Parameters:
type - The java type (typically an interface) which the returned object should implement.
See Also:
ProxyInjector

isWrapped

boolean isWrapped(Object value)
Determines whether the supplied value is a wrapped value from this interceptor. NB: If value has been wrapped multiple times, then only the injector that performed the last wrapping is required to return true. It is acceptible for all other interceptors to return false.