|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.proxy.interceptor.InterceptorChain
public class InterceptorChain
An InterceptorChain
assists with creating proxies which go through a series of
interceptors
.
MyServiceInterface serviceImpl = ...; ProxyFactory factory = ...; Interceptor[] interceptors = ...; InterceptorChain chain = new InterceptorChain(interceptors); ObjectProvider provider = chain.createProxyProvider(factory, serviceImpl); MyServiceInterface serviceProxy = ( MyServiceInterface )provider.getObject(); serviceProxy.someServiceMethod(...); // This will go through the interceptors!
Constructor Summary | |
---|---|
InterceptorChain(Interceptor[] interceptors)
|
Method Summary | |
---|---|
ObjectProvider |
createProxyProvider(ProxyFactory proxyFactory,
ClassLoader classLoader,
Object terminus,
Class[] proxyClasses)
Creates an ObjectProvider which will return a proxy that sends method invocations through this
chain of interceptors and ultimately arrive at the supplied terminus object. |
ObjectProvider |
createProxyProvider(ProxyFactory proxyFactory,
Object terminus)
Creates an ObjectProvider which will return a proxy that sends method invocations through this
chain of interceptors and ultimately arrive at the supplied terminus object. |
ObjectProvider |
createProxyProvider(ProxyFactory proxyFactory,
Object terminus,
Class[] proxyClasses)
Creates an ObjectProvider which will return a proxy that sends method invocations through this
chain of interceptors and ultimately arrive at the supplied terminus object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InterceptorChain(Interceptor[] interceptors)
Method Detail |
---|
public ObjectProvider createProxyProvider(ProxyFactory proxyFactory, Object terminus)
ObjectProvider
which will return a proxy that sends method invocations through this
chain of interceptors and ultimately arrive at the supplied terminus object. The proxy will support all
interfaces implemented by the terminus object. The thread context classloader will be used to generate the
proxy class.
proxyFactory
- the ProxyFactory
to use to create the proxyterminus
- the terminus
ObjectProvider
which will return a proxy that sends method invocations through this
chain of interceptors and ultimately arrive at the supplied terminus objectpublic ObjectProvider createProxyProvider(ProxyFactory proxyFactory, Object terminus, Class[] proxyClasses)
ObjectProvider
which will return a proxy that sends method invocations through this
chain of interceptors and ultimately arrive at the supplied terminus object. The proxy will support only
the specified interfaces/classes. The thread context classloader will be used to generate the
proxy class.
proxyFactory
- the ProxyFactory
to use to create the proxyterminus
- the terminusproxyClasses
- the interfaces to support
ObjectProvider
which will return a proxy that sends method invocations through this
chain of interceptors and ultimately arrive at the supplied terminus objectpublic ObjectProvider createProxyProvider(ProxyFactory proxyFactory, ClassLoader classLoader, Object terminus, Class[] proxyClasses)
ObjectProvider
which will return a proxy that sends method invocations through this
chain of interceptors and ultimately arrive at the supplied terminus object. The proxy will support only
the specified interfaces/classes. The specified classloader will be used to generate the
proxy class.
proxyFactory
- the ProxyFactory
to use to create the proxyclassLoader
- the classloader to be used to generate the proxy classterminus
- the terminusproxyClasses
- the interfaces to support
ObjectProvider
which will return a proxy that sends method invocations through this
chain of interceptors and ultimately arrive at the supplied terminus object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |