| java.lang.Object uk.org.ponder.reflect.ReflectiveCache
All known Subclasses: uk.org.ponder.reflect.JDKReflectiveCache,
ReflectiveCache | abstract public class ReflectiveCache (Code) | | A cache for simple no-arg methods and constructors, of the sort that are
typically used in bean environments, that are not suitable to be considered
as "bean properties" and hence handled by a SAXAccessMethod.
The class is capable of resolving methods and constructors with arguments,
but accessors for these members are not cached or accelerated.
The intention is that **ALL** application-wide reflection will be done either
in this class, or in SAXAccessMethod.
This implementation will probably shortly be replaced by a FastClass variant.
author: Antranig Basman (antranig@caret.cam.ac.uk) |
Field Summary | |
final public static String | CONSTRUCTOR_KEY The key used into per-class reflective caches representing the no-arg
constructor. | final public static int | INIT_MAP_SIZE |
Method Summary | |
abstract public Object | construct(Class clazz) | protected Map | getClassMap(Class target) | public static Class | getConcurrent1MapClass() | public Map | getConcurrentMap(int concurrency) Returns a new concurrent map object with the desired level of concurrency.
If the oswego package is available, any concurrency level other than 1 will
return the ConcurrentHashMap implementation with its hardwired level of 32.
Concurrency level 1 hashes are suitable for static application-wide caches,
e.g. | public static Constructor | getConcurrentNMapConstructor() Returns a Constructor capable of constructing a multiple-concurrent-reader
HashMap. | public static Constructor | getConstructor(Class clazz) | public static Method | getMethod(Class clazz, String name) | public static Method | getMethod(Class clazz, String name, Class[] argtypes) | abstract public Object | invokeMethod(Object bean, String method) | abstract protected Object | invokeMethod(Object target, String name, Class[] infer, Object[] args) | public Object | invokeMethod(Object target, String name, Object[] args) Somewhat inefficient, but this scheme applies simple argument matching
to be able to invoke multi-arg methods. |
CONSTRUCTOR_KEY | final public static String CONSTRUCTOR_KEY(Code) | | The key used into per-class reflective caches representing the no-arg
constructor.
|
INIT_MAP_SIZE | final public static int INIT_MAP_SIZE(Code) | | The initial size of JSR-166 multi-concurrency hashes (all others are
defaults)
|
getConcurrent1MapClass | public static Class getConcurrent1MapClass()(Code) | | |
getConcurrentMap | public Map getConcurrentMap(int concurrency)(Code) | | Returns a new concurrent map object with the desired level of concurrency.
If the oswego package is available, any concurrency level other than 1 will
return the ConcurrentHashMap implementation with its hardwired level of 32.
Concurrency level 1 hashes are suitable for static application-wide caches,
e.g. for internal use of this class, to be either the root map or the map
for the default constructors of a particular class.
|
getConcurrentNMapConstructor | public static Constructor getConcurrentNMapConstructor()(Code) | | Returns a Constructor capable of constructing a multiple-concurrent-reader
HashMap.
|
getConstructor | public static Constructor getConstructor(Class clazz)(Code) | | Get a no-argument constructor for a class
Parameters: clazz - the class a no-arg constructor |
invokeMethod | public Object invokeMethod(Object target, String name, Object[] args)(Code) | | Somewhat inefficient, but this scheme applies simple argument matching
to be able to invoke multi-arg methods.
|
|
|