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 String
key
protected ObjectInputStream
ois
protected static int
READ_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 void
flush()
protected abstract Entry
nextEntry()
protected abstract String
nextKey()
void
prepareToReadFrom(InputStream is)
void
prepareToWriteTo(OutputStream out)
protected abstract void
read(boolean mandatory, ObjectInputStream ois, Catalog catalog)
Entry
readEntry()
protected abstract void
readHeader(ObjectInputStream ois, Catalog catalog)
String
readKey()
protected abstract void
write(ObjectOutputStream oos, String key, Object value, Entry.ContextType contextType, EnumSet<PropagationMode> propagationModes, String className)
protected abstract void
write(ObjectOutputStream objectOutputStream, Catalog catalog)
<T> void
write(String key, Entry entry)
protected abstract void
writeFooter(ObjectOutputStream objectOutputStream)
protected abstract void
writeHeader(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:
prepareToWriteTo
in 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:
write
in 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:
prepareToReadFrom
in 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:
flush
in 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:
readKey
in 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:
readEntry
in interfaceWireAdapter
- Throws:
IOException
ClassNotFoundException
-
nextEntry
protected abstract Entry nextEntry() throws ClassNotFoundException, IOException
- Throws:
ClassNotFoundException
IOException
-
-