public class ReadOnlyProxyContext extends GCUBEProxyContext<ReadOnlyProxyContext.ReadOnly>
GCUBEProxyContext for proxies which enforce read-only access
from untrusted code to the values returned by selected methods of the proxied objects.
Read-only access control is dynamically established by comparing the namespace of the
caller code (under 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 ReadOnly. Access control checks are
heuristically performed on methods whose name begins with set,add,put,remnove,delete.
For all other methods, a read-only proxy will proxy their return value (if any) with another read-only proxy.
Essentially, this allows the read-only policy to transparently propagate deep within class hierarchies without
requiring that ReadOnly annotations are similary propagated.
| Modifier and Type | Class and Description |
|---|---|
static interface |
ReadOnlyProxyContext.ReadOnly
The primary annotation of the proxy associated with the context.
|
| Modifier and Type | Field and Description |
|---|---|
protected List<String> |
prefixes
Method name prefixes used to heuristically identify write-access methods.
|
| Constructor and Description |
|---|
ReadOnlyProxyContext() |
| Modifier and Type | Method and Description |
|---|---|
void |
addWritePrefix(String prefix)
Add a new method name prefix used to heuristically to identify write-access methods.
|
Class<ReadOnlyProxyContext.ReadOnly> |
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.
|
List<String> |
getPrefixes()
Return the current list of method name prefixes used to heuristically to identify write-access methods.
|
getAnnotation, getProxyCaller, setAnnotation, setCallerpublic Class<ReadOnlyProxyContext.ReadOnly> getAnnotationClass()
getAnnotationClass in class GCUBEProxyContext<ReadOnlyProxyContext.ReadOnly>public net.sf.cglib.proxy.MethodInterceptor getInterceptor(Object proxied)
getInterceptor in class GCUBEProxyContext<ReadOnlyProxyContext.ReadOnly>proxied - the proxied object.public List<String> getPrefixes()
public void addWritePrefix(String prefix)
prefix - the prefix.Copyright © 2015. All Rights Reserved.