org.gcube.common.core.utils.proxies
Class GCUBEProxyContext<ANNOTATION extends Annotation>

java.lang.Object
  extended by org.gcube.common.core.utils.proxies.GCUBEProxyContext<ANNOTATION>
Type Parameters:
ANNOTATION - The type of the primary annotation.
Direct Known Subclasses:
AccessControlProxyContext, ForwardProxyContext, ReadOnlyProxyContext

public abstract class GCUBEProxyContext<ANNOTATION extends Annotation>
extends Object

Partial implementation of the context of operation of a proxy whose behaviour is associated with the presence of one or more Annotations on the methods or class of the proxied object. Among these, the primary annotation is the annotation by which this context will be discovered by a ForwardProxyContext through a GCUBEProxyFactory.

Author:
Fabio Simeoni (University of Strathclyde)

Constructor Summary
GCUBEProxyContext()
           
 
Method Summary
 ANNOTATION getAnnotation()
          Returns the primary annotation associated with the latest method called on the proxy.
abstract  Class<? extends ANNOTATION> getAnnotationClass()
          Returns the class of the primary annotation.
abstract  net.sf.cglib.proxy.MethodInterceptor getInterceptor(Object proxied)
          Returns the object which will intercept calls to the proxy.
 StackTraceElement getProxyCaller()
          Returns the StackTraceElement of the latest call to the proxy.
 void setAnnotation(ANNOTATION annotation)
          Sets the primary annotation associated with the latest method called on the proxy.
 void setCaller(StackTraceElement caller)
          Sets the StackTraceElement of the latest call to the proxy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GCUBEProxyContext

public GCUBEProxyContext()
Method Detail

getInterceptor

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

Parameters:
proxied - the proxied object.
Returns:
the intercepting object.

getAnnotationClass

public abstract Class<? extends ANNOTATION> getAnnotationClass()
Returns the class of the primary annotation.

Returns:
the annotation class.

setAnnotation

public void setAnnotation(ANNOTATION annotation)
Sets the primary annotation associated with the latest method called on the proxy.

Parameters:
annotation - the annotation.

getAnnotation

public ANNOTATION getAnnotation()
Returns the primary annotation associated with the latest method called on the proxy.

Returns:
the annotation.

setCaller

public void setCaller(StackTraceElement caller)
Sets the StackTraceElement of the latest call to the proxy.

Parameters:
caller - the call element.

getProxyCaller

public StackTraceElement getProxyCaller()
Returns the StackTraceElement of the latest call to the proxy.

Returns:
the call element.


Copyright © 2012. All Rights Reserved.