Class AbstractWireAdapter
- java.lang.Object
-
- org.glassfish.contextpropagation.wireadapters.AbstractWireAdapter
-
- All Implemented Interfaces:
WireAdapter
- Direct Known Subclasses:
DefaultWireAdapter,WLSWireAdapter
public abstract class AbstractWireAdapter extends Object implements WireAdapter
This class provides a framework for collecting catalog information, writing the catalog ahead of all other contexts and for skipping over the deserialization of contexts that cannot be deserialized.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.glassfish.contextpropagation.wireadapters.WireAdapter
WireAdapter.WireAdapterHelper
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringkeyprotected ObjectInputStreamoisprotected static intREAD_LIMIT-
Fields inherited from interface org.glassfish.contextpropagation.wireadapters.WireAdapter
HELPER
-
-
Constructor Summary
Constructors Constructor Description AbstractWireAdapter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidflush()protected abstract EntrynextEntry()protected abstract StringnextKey()voidprepareToReadFrom(InputStream is)voidprepareToWriteTo(OutputStream out)protected abstract voidread(boolean mandatory, ObjectInputStream ois, Catalog catalog)EntryreadEntry()protected abstract voidreadHeader(ObjectInputStream ois, Catalog catalog)StringreadKey()protected abstract voidwrite(ObjectOutputStream oos, String key, Object value, Entry.ContextType contextType, EnumSet<PropagationMode> propagationModes, String className)protected abstract voidwrite(ObjectOutputStream objectOutputStream, Catalog catalog)<T> voidwrite(String key, Entry entry)protected abstract voidwriteFooter(ObjectOutputStream objectOutputStream)protected abstract voidwriteHeader(ObjectOutputStream os)
-
-
-
Field Detail
-
READ_LIMIT
protected static final int READ_LIMIT
- See Also:
- Constant Field Values
-
key
protected String key
-
ois
protected ObjectInputStream ois
-
-
Method Detail
-
prepareToWriteTo
public final void prepareToWriteTo(OutputStream out) throws IOException
- Specified by:
prepareToWriteToin interfaceWireAdapter- Throws:
IOException
-
writeHeader
protected abstract void writeHeader(ObjectOutputStream os) throws IOException
- Throws:
IOException
-
write
public final <T> void write(String key, Entry entry) throws IOException
- Specified by:
writein interfaceWireAdapter- Throws:
IOException
-
write
protected abstract void write(ObjectOutputStream oos, String key, Object value, Entry.ContextType contextType, EnumSet<PropagationMode> propagationModes, String className) throws IOException
- Throws:
IOException
-
prepareToReadFrom
public final void prepareToReadFrom(InputStream is) throws IOException
- Specified by:
prepareToReadFromin interfaceWireAdapter- Throws:
IOException
-
readHeader
protected abstract void readHeader(ObjectInputStream ois, Catalog catalog) throws IOException
- Throws:
IOException
-
flush
public final void flush() throws IOException- Specified by:
flushin interfaceWireAdapter- Throws:
IOException
-
write
protected abstract void write(ObjectOutputStream objectOutputStream, Catalog catalog) throws IOException
- Throws:
IOException
-
writeFooter
protected abstract void writeFooter(ObjectOutputStream objectOutputStream) throws IOException
- Throws:
IOException
-
readKey
public final String readKey() throws IOException
- Specified by:
readKeyin interfaceWireAdapter- Throws:
IOException
-
read
protected abstract void read(boolean mandatory, ObjectInputStream ois, Catalog catalog) throws IOException- Throws:
IOException
-
nextKey
protected abstract String nextKey() throws IOException
- Throws:
IOException
-
readEntry
public final Entry readEntry() throws IOException, ClassNotFoundException
- Specified by:
readEntryin interfaceWireAdapter- Throws:
IOExceptionClassNotFoundException
-
nextEntry
protected abstract Entry nextEntry() throws ClassNotFoundException, IOException
- Throws:
ClassNotFoundExceptionIOException
-
-