Package com.ibm.ws.serialization
Interface SerializationService
- 
 public interface SerializationServiceA service for serializing user objects that can contain references to product internal objects.As an alternative to this service, if the serialization/deserialization will always happen using an application thread context class loader, then DeserializationObjectInputStreamcould be used with thread context class loader if the necessary classes are all exported with the thread-context attribute. This approach does not work if an application thread context class loader is not used or if replacers or resolvers are needed.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description DeserializationContextcreateDeserializationContext()Creates a deserialization context that uses all globally registeredDeserializationObjectResolverandDeserializationClassProvider, and which allows additional customizations.java.io.ObjectInputStreamcreateObjectInputStream(java.io.InputStream input, java.lang.ClassLoader classLoader)Create a stream for deserializing objects using a default context, which uses all registeredDeserializationClassProviderandDeserializationObjectReplacer.java.io.ObjectOutputStreamcreateObjectOutputStream(java.io.OutputStream output)Create a stream for serializing objects using a default context, which uses all registeredSerializationObjectReplacer.SerializationContextcreateSerializationContext()Creates a serialization context that uses all globally registeredSerializationObjectReplacer, and which allows additional customizations.java.lang.ObjectreplaceObjectForSerialization(java.lang.Object object)Attempt to return an object appropriate for serialization.java.lang.ObjectresolveObject(java.lang.Object object)Resolve an object returned by replaceObjectForSerialization.java.lang.ObjectresolveObjectWithException(java.lang.Object object)Resolve an object returned by replaceObjectForSerialization.
 
- 
- 
- 
Method Detail- 
createSerializationContextSerializationContext createSerializationContext() Creates a serialization context that uses all globally registeredSerializationObjectReplacer, and which allows additional customizations.
 - 
createObjectOutputStreamjava.io.ObjectOutputStream createObjectOutputStream(java.io.OutputStream output) throws java.io.IOExceptionCreate a stream for serializing objects using a default context, which uses all registeredSerializationObjectReplacer.- Parameters:
- output- the output stream to write serialized object data
- Returns:
- a stream for serialization
- Throws:
- java.io.IOException- if the- ObjectOutputStreamconstructor throws an exception
 
 - 
createDeserializationContextDeserializationContext createDeserializationContext() Creates a deserialization context that uses all globally registeredDeserializationObjectResolverandDeserializationClassProvider, and which allows additional customizations.
 - 
createObjectInputStreamjava.io.ObjectInputStream createObjectInputStream(java.io.InputStream input, java.lang.ClassLoader classLoader) throws java.io.IOExceptionCreate a stream for deserializing objects using a default context, which uses all registeredDeserializationClassProviderandDeserializationObjectReplacer. When deserializing application objects, the specified class loader is typically the thread context class loader.- Parameters:
- input- the input stream containing serialized object data
- classLoader- the class loader for resolving classes
- Returns:
- a stream for deserialization
- Throws:
- java.io.IOException- if the- ObjectInputStreamconstructor throws an exception
 
 - 
replaceObjectForSerializationjava.lang.Object replaceObjectForSerialization(java.lang.Object object) Attempt to return an object appropriate for serialization. This can be used by services that need to know whether or not an object can be serialized. If non-null is returned, the object should be passed to ObjectOutputStream.writeObject.- Parameters:
- object- an object potentially for serialization
- Returns:
- an object for serialization, or null if the object cannot be serialized
- See Also:
- resolveObject(java.lang.Object)
 
 - 
resolveObjectjava.lang.Object resolveObject(java.lang.Object object) Resolve an object returned by replaceObjectForSerialization. If an error occurs while resolving an object, a RuntimeException will be thrown.- Parameters:
- object- an object returned by- replaceObjectForSerialization(java.lang.Object)
- Returns:
- a resolved object, or the input object if it does not need to be resolved
- Throws:
- java.lang.RuntimeException- if an error occurs while resolving the object
 
 - 
resolveObjectWithExceptionjava.lang.Object resolveObjectWithException(java.lang.Object object) throws java.io.IOExceptionResolve an object returned by replaceObjectForSerialization.- Parameters:
- object- an object returned by- replaceObjectForSerialization(java.lang.Object)
- Returns:
- a resolved object, or the input object if it does not need to be resolved
- Throws:
- java.io.IOException
 
 
- 
 
-