net.sf.farrago.jdbc
Class FarragoJdbcUtil.SerializationChecker

java.lang.Object
  extended by net.sf.farrago.jdbc.FarragoJdbcUtil.SerializationChecker
Enclosing class:
FarragoJdbcUtil

private static class FarragoJdbcUtil.SerializationChecker
extends Object

Tests whether an object (in particular an exception) is serializable. Maintains a list of objects actively being tested so that we do not recursively test the same object.


Field Summary
private  Set active
           
private static Pattern NON_SERIALIAZABLE_CLASSES
          What classes should not be serialized.
private  boolean rmiClassLoader
          Whether the client has the RMI class loader enabled.
 
Constructor Summary
private FarragoJdbcUtil.SerializationChecker()
           
 
Method Summary
(package private)  boolean isSerializable(Object o)
          Returns whether an object is serializable.
(package private)  Throwable makeSerializable(Throwable throwable)
          Converts a Throwable into a similar exception that is serializable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NON_SERIALIAZABLE_CLASSES

private static final Pattern NON_SERIALIAZABLE_CLASSES
What classes should not be serialized. In particular: org.eigenbase.sql.parser.SqlParseException org.eigenbase.sql.parser.SqlParserPos org.eigenbase.sql.SqlNode (and subclasses) net.sf.farrago.parser.impl.Token and ParseException or ...parser.impl.Token and ParseException in Aspen


active

private final Set active

rmiClassLoader

private final boolean rmiClassLoader
Whether the client has the RMI class loader enabled. If true, serializabilty is sufficient. If false, the class also has to be available on the client.

See Also:
Constant Field Values
Constructor Detail

FarragoJdbcUtil.SerializationChecker

private FarragoJdbcUtil.SerializationChecker()
Method Detail

makeSerializable

Throwable makeSerializable(Throwable throwable)
Converts a Throwable into a similar exception that is serializable. The original object, or at least its cause, is used if possible; and the new throwable has the same stack trace.

Parameters:
throwable - Exception
Returns:
Exception that is serializable and of the same general type

isSerializable

boolean isSerializable(Object o)
Returns whether an object is serializable.

Parameters:
o - Object
Returns:
Whether object is serializable