org.gcube.common.core.utils.proxies
Class ForwardProxyContext

java.lang.Object
  extended by org.gcube.common.core.utils.proxies.GCUBEProxyContext<ForwardProxyContext.ReturnProxy>
      extended by org.gcube.common.core.utils.proxies.ForwardProxyContext

public class ForwardProxyContext
extends GCUBEProxyContext<ForwardProxyContext.ReturnProxy>

A specialisation of GCUBEProxyContext for proxies which forward proxied calls to other proxies determined dynamically on the basis of the annotations on the methods of the proxied object. In particular, a forwarding proxy will forward calls based on the resolution of primary annotations through a GCUBEProxyFactory. In addition, a forwarding proxy will react to its own primary annotation ForwardProxyContext.ReturnProxy, by proxying the return value of a proxied method invocation with another forwarding proxy. Essentially, this allows annotation-based proxying to propagate deep within class hierarchies.

Author:
Fabio Simeoni (University of Strathclyde)

Nested Class Summary
static interface ForwardProxyContext.ReturnProxy
          The primary annotation of the proxy associated with the context.
 
Constructor Summary
ForwardProxyContext()
           
 
Method Summary
 Class<ForwardProxyContext.ReturnProxy> getAnnotationClass()
          Returns the class of the primary annotation.
 net.sf.cglib.proxy.MethodInterceptor getInterceptor(Object proxied)
          Returns the object which will intercept calls to the proxy.
 
Methods inherited from class org.gcube.common.core.utils.proxies.GCUBEProxyContext
getAnnotation, getProxyCaller, setAnnotation, setCaller
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForwardProxyContext

public ForwardProxyContext()
Method Detail

getInterceptor

public net.sf.cglib.proxy.MethodInterceptor getInterceptor(Object proxied)
Returns the object which will intercept calls to the proxy.

Specified by:
getInterceptor in class GCUBEProxyContext<ForwardProxyContext.ReturnProxy>
Parameters:
proxied - the proxied object.
Returns:
the intercepting object.

getAnnotationClass

public Class<ForwardProxyContext.ReturnProxy> getAnnotationClass()
Returns the class of the primary annotation.

Specified by:
getAnnotationClass in class GCUBEProxyContext<ForwardProxyContext.ReturnProxy>
Returns:
the annotation class.


Copyright © 2013. All Rights Reserved.