|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
java.io.ObjectOutputStream
org.ops4j.pax.wicket.util.serialization.PaxWicketSerializableChecker
public class PaxWicketSerializableChecker
Utility class that analyzes objects for non-serializable nodes. Construct, then call check(Object)
with the
object you want to check. When a non-serializable object is found, a PaxWicketSerializableChecker.WicketNotSerializableException
is thrown
with a message that shows the trace up to the not-serializable object. The exception is thrown for the first
non-serializable instance it encounters, so multiple problems will not be shown.
As this class depends heavily on JDK's serialization internals using introspection, analyzing may not be possible,
for instance when the runtime environment does not have sufficient rights to set fields accessible that would
otherwise be hidden. You should call isAvailable()
to see whether this class can
operate properly. If it doesn't, you should fall back to e.g. re-throwing/ printing the
PaxWicketSerializableChecker.WicketNotSerializableException
you probably got before using this class.
Nested Class Summary | |
---|---|
static class |
PaxWicketSerializableChecker.WicketNotSerializableException
Exception that is thrown when a non-serializable object was found. |
Nested classes/interfaces inherited from class java.io.ObjectOutputStream |
---|
ObjectOutputStream.PutField |
Field Summary |
---|
Constructor Summary | |
---|---|
PaxWicketSerializableChecker(NotSerializableException exception)
Construct. |
Method Summary | |
---|---|
protected Object |
additionalObjectReplacements(Object streamObj)
Execute object replacement if required for a transformation. |
static boolean |
isAvailable()
Gets whether we can execute the tests. |
void |
reset()
|
protected boolean |
validateAdditionalSerializableConditions(Object obj)
Validates additional "isSerializable" conditions. |
protected void |
writeObjectOverride(Object obj)
|
Methods inherited from class java.io.ObjectOutputStream |
---|
annotateClass, annotateProxyClass, close, defaultWriteObject, drain, enableReplaceObject, flush, putFields, replaceObject, useProtocolVersion, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeClassDescriptor, writeDouble, writeFields, writeFloat, writeInt, writeLong, writeObject, writeShort, writeStreamHeader, writeUnshared, writeUTF |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PaxWicketSerializableChecker(NotSerializableException exception) throws IOException
exception
- exception that should be set as the cause when throwing a new exception
IOException
Method Detail |
---|
public static boolean isAvailable()
check(Object)
will just return and you are
advised to rely on the PaxWicketSerializableChecker.WicketNotSerializableException
. Clients are advised to call this method prior to calling
the check method.
public void reset() throws IOException
reset
in class ObjectOutputStream
IOException
ObjectOutputStream.reset()
protected final void writeObjectOverride(Object obj) throws IOException
writeObjectOverride
in class ObjectOutputStream
IOException
ObjectOutputStream.writeObjectOverride(java.lang.Object)
protected boolean validateAdditionalSerializableConditions(Object obj)
protected Object additionalObjectReplacements(Object streamObj)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |