org.gcube.common.core.utils.proxies
Class AccessControlProxyContext
java.lang.Object
org.gcube.common.core.utils.proxies.GCUBEProxyContext<AccessControlProxyContext.Restricted>
org.gcube.common.core.utils.proxies.AccessControlProxyContext
public class AccessControlProxyContext
- extends GCUBEProxyContext<AccessControlProxyContext.Restricted>
A specialisation of GCUBEProxyContext for proxies which prevent altogether
untrusted access to selected methods of the proxied objects. Access control is dynamically
established by comparing the namespace of the caller code (in the presence of inheritance,
not necessarily the caller's) with one or more namespaces of trusted code.
The latter are specified as the values of annotations of the primary
annotation class Restricted.
- Author:
- Fabio Simeoni (University of Strathclyde)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AccessControlProxyContext
public AccessControlProxyContext()
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<AccessControlProxyContext.Restricted>
- Parameters:
proxied - the proxied object.
- Returns:
- the intercepting object.
getAnnotationClass
public Class<AccessControlProxyContext.Restricted> getAnnotationClass()
- Returns the class of the primary annotation.
- Specified by:
getAnnotationClass in class GCUBEProxyContext<AccessControlProxyContext.Restricted>
- Returns:
- the annotation class.
validateCall
public static void validateCall()
- A facility for enforcing access control in the absence of a dedicated proxy.
Called explicitly from within a client method, it uses the
Restricted
annotation to verify that the caller of the client is trusted for that method.
It does nothing if the method has no Restricted annotation.
Copyright © 2012. All Rights Reserved.