Package org.jboss.marshalling.reflect
Class SerializableClassRegistry
- java.lang.Object
-
- org.jboss.marshalling.reflect.SerializableClassRegistry
-
public final class SerializableClassRegistry extends java.lang.ObjectA registry for reflection information usable by serialization implementations. Objects returned from this registry can be used to invoke private methods without security checks, so it is important to be careful not to "leak" instances out of secured implementations.
-
-
Field Summary
Fields Modifier and Type Field Description private static SerializableClassRegistryINSTANCEprivate static java.io.SerializablePermissionPERMISSIONprivate java.util.concurrent.ConcurrentMap<java.lang.ClassLoader,java.util.concurrent.ConcurrentMap<java.lang.Class<?>,SerializableClass>>registry
-
Constructor Summary
Constructors Modifier Constructor Description privateSerializableClassRegistry()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SerializableClassRegistrygetInstance()Get the serializable class registry instance, if allowed by the current security manager.(package private) static SerializableClassRegistrygetInstanceUnchecked()SerializableClasslookup(java.lang.Class<?> subject)Look up serialization information for a class.voidrelease(java.lang.ClassLoader classLoader)Release all reflection information belonging to the given class loader.
-
-
-
Field Detail
-
INSTANCE
private static final SerializableClassRegistry INSTANCE
-
PERMISSION
private static final java.io.SerializablePermission PERMISSION
-
registry
private final java.util.concurrent.ConcurrentMap<java.lang.ClassLoader,java.util.concurrent.ConcurrentMap<java.lang.Class<?>,SerializableClass>> registry
-
-
Method Detail
-
getInstance
public static SerializableClassRegistry getInstance() throws java.lang.SecurityException
Get the serializable class registry instance, if allowed by the current security manager. The caller must have thejava.io.SerializablePermission"allowSerializationReflection"in order to invoke this method.- Returns:
- the registry
- Throws:
java.lang.SecurityException- if the caller does not have sufficient privileges
-
getInstanceUnchecked
static SerializableClassRegistry getInstanceUnchecked()
-
lookup
public SerializableClass lookup(java.lang.Class<?> subject)
Look up serialization information for a class. The resultant object will be cached.- Parameters:
subject- the class to look up- Returns:
- the serializable class information
-
release
public void release(java.lang.ClassLoader classLoader)
Release all reflection information belonging to the given class loader.- Parameters:
classLoader- the class loader to release
-
-