Package org.jboss.marshalling.cloner
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) class
private static final class
private static class
(package private) class
(package private) class
(package private) class
(package private) class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final ClassCloner
private final IdentityHashMap<Object,
Object> private final CloneTable
private final ObjectResolver
private final ObjectResolver
private static final IdentityIntMap<Class<?>>
private static final Field
private final SerializableClassRegistry
private final SerializabilityChecker
Fields inherited from interface org.jboss.marshalling.cloner.ObjectCloner
IDENTITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate a deep clone of the given object.private Object
private void
createStepObjectInputStream
(Object clone, SerializableClass cloneInfo, SerializingCloner.ClonerPutField fields, Queue<SerializingCloner.Step> steps) createStepObjectOutputStream
(Object orig, SerializingCloner.ClonerPutField fields, Queue<SerializingCloner.Step> steps) private static InvocationHandler
getInvocationHandler
(Object orig) private void
initSerializableClone
(Object orig, SerializableClass origInfo, Object clone, SerializableClass cloneInfo) private void
prepareFields
(Object subject, SerializingCloner.ClonerPutField fields) void
reset()
Clear the cloner state and any caches.private static Object
simpleClone
(Object orig, Class<?> objClass) private void
storeFields
(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:ObjectCloner
Clear the cloner state and any caches.- Specified by:
reset
in interfaceObjectCloner
-
clone
Description copied from interface:ObjectCloner
Create a deep clone of the given object.- Specified by:
clone
in 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:
IOException
ClassNotFoundException
-
initSerializableClone
private void initSerializableClone(Object orig, SerializableClass origInfo, Object clone, SerializableClass cloneInfo) throws IOException, ClassNotFoundException - Throws:
IOException
ClassNotFoundException
-
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:
IOException
ClassNotFoundException
-
storeFields
private void storeFields(SerializableClass cloneInfo, Object clone, SerializingCloner.ClonerPutField fields) throws IOException - Throws:
IOException
-
simpleClone
-
getInvocationHandler
-