public class SafeConfigurablePofContext extends ConfigurablePofContext
Important note: this PofContext has the following limitations:
For user types that have been explicitly configured, the SafeConfigurablePofContext behaves identical to the ConfigurablePofContext.
Modifier and Type | Class and Description |
---|---|
class |
SafeConfigurablePofContext.ExternalSerializer
Serializer used for Serializable and ExternalizableLite objects.
|
class |
SafeConfigurablePofContext.JavaPofSerializer
Default Java serializer.
|
class |
SafeConfigurablePofContext.SafePofSerializer
Serializer used for objects implementing the PortableObject interface.
|
ConfigurablePofContext.PofConfig
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_PORTABLE
The type identifier for objects that implement the PortableObject
interface.
|
static int |
TYPE_SERIALIZABLE
The type identifier for Java Serializable (including the
ExternalizableLite format) objects.
|
DEFAULT_RESOURCE, PROPERTY_CONFIG, ROOT_LAMBDA_CLASS
Constructor and Description |
---|
SafeConfigurablePofContext()
Default constructor.
|
SafeConfigurablePofContext(Serializer serializer,
ClassLoader loader)
Create a SafeConfigurablePofContext that serializes instances of
non-POF classes with specified serializer.
|
SafeConfigurablePofContext(String sLocator)
Create a SafeConfigurablePofContext that will load configuration
information from the specified locator.
|
SafeConfigurablePofContext(XmlElement xml)
Create a SafeConfigurablePofContext that will use the passed
configuration information.
|
Modifier and Type | Method and Description |
---|---|
Class |
getClass(int nTypeId)
Determine the class associated with the given user type identifier.
|
protected int |
getGenericTypeId(Class clz)
For user types that are not registered in the POF configuration used
by this PofContext, determine if the user type can be serialized using
POF, otherwise determine if the user type can be serialized using the
traditional (pre-POF) Coherence Java Serialization format that supports
Java Serializable and ExternalizableLite objects.
|
PofSerializer |
getPofSerializer(int nTypeId)
Return a PofSerializer that can be used to serialize and deserialize an
object of the specified user type to and from a POF stream.
|
int |
getUserTypeIdentifier(Class clz)
Determine the user type identifier associated with the given class.
|
int |
getUserTypeIdentifier(String sClass)
Determine the user type identifier associated with the given class
name.
|
boolean |
isUserType(Class clz)
Determine if the given class is a user type known to this PofContext.
|
boolean |
isUserType(String sClass)
Determine if the class with the given name is a user type known to this
PofContext.
|
appendDefaultSerializerToUserTypes, checkNotInitialized, createPofConfig, deserialize, ensureInitialized, getClassName, getConfig, getConfigLocation, getContextClassLoader, getInheritedUserTypeIdentifier, getPofConfig, getUserTypeIdentifier, getUserTypeIdentifierInternal, getUserTypeIdentifierInternal, initialize, instantiateSerializer, isInitialized, isInterfaceAllowed, isLambdaAllowed, isPreferJavaTime, isReferenceEnabled, isSubclassAllowed, isUserType, loadClass, mergeIncludes, report, serialize, setConfig, setContextClassLoader, setPreferJavaTime, setReferenceEnabled, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
deserialize, getName
public static final int TYPE_PORTABLE
public static final int TYPE_SERIALIZABLE
public SafeConfigurablePofContext()
Create a default SafeConfigurablePofContext that will load
configuration information from the locator specified in
ConfigurablePofContext.DEFAULT_RESOURCE
.
public SafeConfigurablePofContext(String sLocator)
sLocator
- the locator that specifies the location of the
PofContext configuration file; the locator is either
a valid path or a URLpublic SafeConfigurablePofContext(Serializer serializer, ClassLoader loader)
serializer
- cache config specified serializer to use for non-POF typesloader
- context classloader to use with serializerpublic SafeConfigurablePofContext(XmlElement xml)
xml
- an XmlElement containing information in the format of a
configuration file used by SafeConfigurablePofContextpublic PofSerializer getPofSerializer(int nTypeId)
getPofSerializer
in interface PofContext
getPofSerializer
in class ConfigurablePofContext
nTypeId
- the type identifier of the user type that can be
serialized and deserialized using the returned
PofSerializer; must be non-negativepublic Class getClass(int nTypeId)
getClass
in interface PofContext
getClass
in class ConfigurablePofContext
nTypeId
- the user type identifier; must be non-negativepublic int getUserTypeIdentifier(Class clz)
getUserTypeIdentifier
in interface PofContext
getUserTypeIdentifier
in class ConfigurablePofContext
clz
- a user type class; must not be nullpublic int getUserTypeIdentifier(String sClass)
getUserTypeIdentifier
in interface PofContext
getUserTypeIdentifier
in class ConfigurablePofContext
sClass
- the name of a user type class; must not be nullpublic boolean isUserType(Class clz)
isUserType
in interface PofContext
isUserType
in class ConfigurablePofContext
clz
- the class to test; must not be nullpublic boolean isUserType(String sClass)
isUserType
in interface PofContext
isUserType
in class ConfigurablePofContext
sClass
- the name of the class to test; must not be nullprotected int getGenericTypeId(Class clz)
clz
- a user type class that is not configured in this PofContext