com.solarmetric.kodo.runtime
Class Exceptions
java.lang.Object
|
+--com.solarmetric.kodo.runtime.Exceptions
- class Exceptions
- extends Object
Utility methods for externalizing exceptions.
|
Constructor Summary |
(package private) |
Exceptions()
|
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Exceptions
Exceptions()
isSerializable
public static boolean isSerializable(Object ob)
- Test to see if the specified Object will be able to be
serialized. This will check if the object implements
Serializable, and if so, will try to perform an actual
serialization. This is in case the object has fields which,
in turn, are not serializable.
- Parameters:
ob - the object to test- Returns:
- true if the object will be able to be serialized
checkSerialize
public static Exception checkSerialize(Exception e)
- Return the exception if it is serializable, otherwise
return null.
replaceFailedObject
static Object replaceFailedObject(Object ob)
- Convert the specified failed object into a serializable
object for when we are serializing an Exception. It will
try the following:
- if the object can be serialized, return the object itself
- if the object has a PC ID, return the ID
- return the toString() form of the object
- Parameters:
ob - the object to convert- Returns:
- some serialized representation of the object
replaceNestedThrowables
static Throwable[] replaceNestedThrowables(Throwable[] nested)
- Convert the specified throwables into a serialzable array. If
any of the nested throwables cannot be serialized, they will
be converted into a Exception with the original message.
Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.