Class SerializingCloner
java.lang.Object
org.jboss.marshalling.cloner.SerializingCloner
- All Implemented Interfaces:
ObjectCloner
An object cloner which uses serialization methods to clone objects.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class(package private) classprivate static final classprivate static class(package private) class(package private) class(package private) class(package private) class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final ClassClonerprivate final IdentityHashMap<Object, Object> private final CloneTableprivate final ObjectResolverprivate final ObjectResolverprivate static final IdentityIntMap<Class<?>> private static final Fieldprivate final SerializableClassRegistryprivate final SerializabilityCheckerFields inherited from interface ObjectCloner
IDENTITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate a deep clone of the given object.private Objectprivate voidcreateStepObjectInputStream(Object clone, SerializableClass cloneInfo, SerializingCloner.ClonerPutField fields, Queue<SerializingCloner.Step> steps) createStepObjectOutputStream(Object orig, SerializingCloner.ClonerPutField fields, Queue<SerializingCloner.Step> steps) private static InvocationHandlergetInvocationHandler(Object orig) private voidinitSerializableClone(Object orig, SerializableClass origInfo, Object clone, SerializableClass cloneInfo) private voidprepareFields(Object subject, SerializingCloner.ClonerPutField fields) voidreset()Clear the cloner state and any caches.private static ObjectsimpleClone(Object orig, Class<?> objClass) private voidstoreFields(SerializableClass cloneInfo, Object clone, SerializingCloner.ClonerPutField fields)
-
Field Details
-
delegate
-
objectResolver
-
objectPreResolver
-
classCloner
-
serializabilityChecker
-
bufferSize
private final int bufferSize -
registry
-
clones
-
UNCLONED
-
PRIMITIVE_ARRAYS
-
proxyInvocationHandler
-
-
Constructor Details
-
SerializingCloner
SerializingCloner(ClonerConfiguration configuration) Create a new instance.- Parameters:
configuration- the configuration to use
-
-
Method Details
-
reset
public void reset()Description copied from interface:ObjectClonerClear the cloner state and any caches.- Specified by:
resetin interfaceObjectCloner
-
clone
Description copied from interface:ObjectClonerCreate a deep clone of the given object.- Specified by:
clonein interfaceObjectCloner- Parameters:
orig- the original object- Returns:
- the deep clone
- Throws:
IOException- if a serialization error occursClassNotFoundException- if a class cannot be loaded during the cloning process
-
clone
- Throws:
IOExceptionClassNotFoundException
-
initSerializableClone
private void initSerializableClone(Object orig, SerializableClass origInfo, Object clone, SerializableClass cloneInfo) throws IOException, ClassNotFoundException - Throws:
IOExceptionClassNotFoundException
-
createStepObjectInputStream
private SerializingCloner.StepObjectInputStream createStepObjectInputStream(Object clone, SerializableClass cloneInfo, SerializingCloner.ClonerPutField fields, Queue<SerializingCloner.Step> steps) throws IOException - Throws:
IOException
-
createStepObjectOutputStream
private SerializingCloner.StepObjectOutputStream createStepObjectOutputStream(Object orig, SerializingCloner.ClonerPutField fields, Queue<SerializingCloner.Step> steps) throws IOException - Throws:
IOException
-
prepareFields
private void prepareFields(Object subject, SerializingCloner.ClonerPutField fields) throws InvalidObjectException - Throws:
InvalidObjectException
-
cloneFields
private void cloneFields(SerializingCloner.ClonerPutField fields) throws IOException, ClassNotFoundException - Throws:
IOExceptionClassNotFoundException
-
storeFields
private void storeFields(SerializableClass cloneInfo, Object clone, SerializingCloner.ClonerPutField fields) throws IOException - Throws:
IOException
-
simpleClone
-
getInvocationHandler
-