Package org.apache.commons.ognl
Class OgnlCache
- java.lang.Object
-
- org.apache.commons.ognl.OgnlCache
-
public class OgnlCache extends java.lang.ObjectThis class takes care of all the internal caching for OGNL.
-
-
Field Summary
Fields Modifier and Type Field Description private Cache<java.lang.reflect.Constructor<?>,java.lang.Class<?>[]>_ctorParameterTypesCacheprivate ClassCache<java.util.Map<java.lang.String,java.lang.reflect.Field>>_fieldCacheprivate Cache<GenericMethodParameterTypeCacheEntry,java.lang.Class<?>[]>_genericMethodParameterTypesCacheprivate Cache<PermissionCacheEntry,java.security.Permission>_invokePermissionCacheprivate Cache<java.lang.reflect.Method,MethodAccessEntryValue>_methodAccessCacheprivate Cache<DeclaredMethodCacheEntry,java.util.Map<java.lang.String,java.util.List<java.lang.reflect.Method>>>_methodCacheprivate Cache<java.lang.reflect.Method,java.lang.Class<?>[]>_methodParameterTypesCacheprivate Cache<java.lang.reflect.Method,java.lang.Boolean>_methodPermCacheprivate CacheFactorycacheFactoryprivate ClassCache<java.util.List<java.lang.reflect.Constructor<?>>>constructorCacheprivate ClassCache<ElementsAccessor>elementsAccessorsprivate ClassCache<MethodAccessor>methodAccessorsprivate MethodPermCacheEntryFactorymethodPermCacheEntryFactoryprivate ClassCache<NullHandler>nullHandlersprivate ClassCache<PropertyAccessor>propertyAccessors(package private) ClassCache<java.util.Map<java.lang.String,java.beans.PropertyDescriptor>>propertyDescriptorCache
-
Constructor Summary
Constructors Constructor Description OgnlCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()java.util.List<java.lang.reflect.Constructor<?>>getConstructor(java.lang.Class<?> clazz)ElementsAccessorgetElementsAccessor(java.lang.Class<?> clazz)java.util.Map<java.lang.String,java.lang.reflect.Field>getField(java.lang.Class<?> clazz)java.lang.Class<?>[]getGenericMethodParameterTypes(GenericMethodParameterTypeCacheEntry key)java.security.PermissiongetInvokePermission(PermissionCacheEntry permissionCacheEntry)java.util.Map<java.lang.String,java.util.List<java.lang.reflect.Method>>getMethod(DeclaredMethodCacheEntry declaredMethodCacheEntry)MethodAccessEntryValuegetMethodAccess(java.lang.reflect.Method method)MethodAccessorgetMethodAccessor(java.lang.Class<?> clazz)java.lang.Class<?>[]getMethodParameterTypes(java.lang.reflect.Method method)booleangetMethodPerm(java.lang.reflect.Method method)NullHandlergetNullHandler(java.lang.Class<?> clazz)java.lang.Class<?>[]getParameterTypes(java.lang.reflect.Constructor<?> constructor)PropertyAccessorgetPropertyAccessor(java.lang.Class<?> clazz)java.util.Map<java.lang.String,java.beans.PropertyDescriptor>getPropertyDescriptor(java.lang.Class<?> clazz)voidsetClassCacheInspector(ClassCacheInspector inspector)Registers the specifiedClassCacheInspectorwith all class reflection based internal caches.voidsetElementsAccessor(java.lang.Class<?> clazz, ElementsAccessor accessor)voidsetMethodAccessor(java.lang.Class<?> clazz, MethodAccessor accessor)voidsetNullHandler(java.lang.Class<?> clazz, NullHandler handler)voidsetPropertyAccessor(java.lang.Class<?> clazz, PropertyAccessor accessor)voidsetSecurityManager(java.lang.SecurityManager securityManager)
-
-
-
Field Detail
-
cacheFactory
private final CacheFactory cacheFactory
-
methodAccessors
private final ClassCache<MethodAccessor> methodAccessors
-
propertyAccessors
private final ClassCache<PropertyAccessor> propertyAccessors
-
elementsAccessors
private final ClassCache<ElementsAccessor> elementsAccessors
-
nullHandlers
private final ClassCache<NullHandler> nullHandlers
-
propertyDescriptorCache
final ClassCache<java.util.Map<java.lang.String,java.beans.PropertyDescriptor>> propertyDescriptorCache
-
constructorCache
private final ClassCache<java.util.List<java.lang.reflect.Constructor<?>>> constructorCache
-
_methodCache
private final Cache<DeclaredMethodCacheEntry,java.util.Map<java.lang.String,java.util.List<java.lang.reflect.Method>>> _methodCache
-
_invokePermissionCache
private final Cache<PermissionCacheEntry,java.security.Permission> _invokePermissionCache
-
_fieldCache
private final ClassCache<java.util.Map<java.lang.String,java.lang.reflect.Field>> _fieldCache
-
_methodParameterTypesCache
private final Cache<java.lang.reflect.Method,java.lang.Class<?>[]> _methodParameterTypesCache
-
_genericMethodParameterTypesCache
private final Cache<GenericMethodParameterTypeCacheEntry,java.lang.Class<?>[]> _genericMethodParameterTypesCache
-
_ctorParameterTypesCache
private final Cache<java.lang.reflect.Constructor<?>,java.lang.Class<?>[]> _ctorParameterTypesCache
-
_methodAccessCache
private final Cache<java.lang.reflect.Method,MethodAccessEntryValue> _methodAccessCache
-
methodPermCacheEntryFactory
private final MethodPermCacheEntryFactory methodPermCacheEntryFactory
-
_methodPermCache
private final Cache<java.lang.reflect.Method,java.lang.Boolean> _methodPermCache
-
-
Method Detail
-
getMethodParameterTypes
public java.lang.Class<?>[] getMethodParameterTypes(java.lang.reflect.Method method) throws CacheException- Throws:
CacheException
-
getParameterTypes
public java.lang.Class<?>[] getParameterTypes(java.lang.reflect.Constructor<?> constructor) throws CacheException- Throws:
CacheException
-
getConstructor
public java.util.List<java.lang.reflect.Constructor<?>> getConstructor(java.lang.Class<?> clazz) throws CacheException- Throws:
CacheException
-
getField
public java.util.Map<java.lang.String,java.lang.reflect.Field> getField(java.lang.Class<?> clazz) throws CacheException- Throws:
CacheException
-
getMethod
public java.util.Map<java.lang.String,java.util.List<java.lang.reflect.Method>> getMethod(DeclaredMethodCacheEntry declaredMethodCacheEntry) throws CacheException
- Throws:
CacheException
-
getPropertyDescriptor
public java.util.Map<java.lang.String,java.beans.PropertyDescriptor> getPropertyDescriptor(java.lang.Class<?> clazz) throws CacheException- Throws:
CacheException
-
getInvokePermission
public java.security.Permission getInvokePermission(PermissionCacheEntry permissionCacheEntry) throws CacheException
- Throws:
CacheException
-
getMethodAccessor
public MethodAccessor getMethodAccessor(java.lang.Class<?> clazz) throws OgnlException
- Throws:
OgnlException
-
setMethodAccessor
public void setMethodAccessor(java.lang.Class<?> clazz, MethodAccessor accessor)
-
setPropertyAccessor
public void setPropertyAccessor(java.lang.Class<?> clazz, PropertyAccessor accessor)
-
getPropertyAccessor
public PropertyAccessor getPropertyAccessor(java.lang.Class<?> clazz) throws OgnlException
- Throws:
OgnlException
-
setClassCacheInspector
public void setClassCacheInspector(ClassCacheInspector inspector)
Registers the specifiedClassCacheInspectorwith all class reflection based internal caches. This may have a significant performance impact so be careful using this in production scenarios.- Parameters:
inspector- The inspector instance that will be registered with all internal cache instances.
-
getGenericMethodParameterTypes
public java.lang.Class<?>[] getGenericMethodParameterTypes(GenericMethodParameterTypeCacheEntry key) throws CacheException
- Throws:
CacheException
-
getMethodPerm
public boolean getMethodPerm(java.lang.reflect.Method method) throws CacheException- Throws:
CacheException
-
getMethodAccess
public MethodAccessEntryValue getMethodAccess(java.lang.reflect.Method method) throws CacheException
- Throws:
CacheException
-
clear
public void clear()
-
getElementsAccessor
public ElementsAccessor getElementsAccessor(java.lang.Class<?> clazz) throws OgnlException
- Throws:
OgnlException
-
setElementsAccessor
public void setElementsAccessor(java.lang.Class<?> clazz, ElementsAccessor accessor)
-
getNullHandler
public NullHandler getNullHandler(java.lang.Class<?> clazz) throws OgnlException
- Throws:
OgnlException
-
setNullHandler
public void setNullHandler(java.lang.Class<?> clazz, NullHandler handler)
-
setSecurityManager
public void setSecurityManager(java.lang.SecurityManager securityManager)
-
-