|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dellroad.stuff.pobj.AbstractDelegate<T>
T - type of the root persistent objectpublic abstract class AbstractDelegate<T>
Support superclass for PersistentObjectDelegate classes, with implementations of all methods
other than serialize() and deserialize().
PersistentObject| Field Summary | |
|---|---|
protected Logger |
log
|
| Constructor Summary | |
|---|---|
AbstractDelegate()
|
|
| Method Summary | |
|---|---|
T |
copy(T original)
Make a deep copy of the given object. |
void |
handleWritebackException(PersistentObject<T> pobj,
Throwable t)
Handle an exception thrown during a delayed write-back attempt. |
boolean |
isSameGraph(T root1,
T root2)
Compare two object graphs. |
Set<ConstraintViolation<T>> |
validate(T obj)
Validate the given instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.dellroad.stuff.pobj.PersistentObjectDelegate |
|---|
deserialize, serialize |
| Field Detail |
|---|
protected final Logger log
| Constructor Detail |
|---|
public AbstractDelegate()
| Method Detail |
|---|
public T copy(T original)
The implementation in AbstractDelegate does this by serializing
and then deserializing the object graph.
Subclasses are encouraged to provide a more efficient implementation.
copy in interface PersistentObjectDelegate<T>IllegalArgumentException - if original is null
PersistentObjectException - if an error occurs
public boolean isSameGraph(T root1,
T root2)
The implementation in AbstractDelegate always returns true only if root1
and root2 are the same object.
isSameGraph in interface PersistentObjectDelegate<T>root1 - root of first object graphroot2 - root of second object graphpublic Set<ConstraintViolation<T>> validate(T obj)
The implementation in AbstractDelegate performs validation using ValidationContext.validate().
validate in interface PersistentObjectDelegate<T>IllegalArgumentException - if obj is null
public void handleWritebackException(PersistentObject<T> pobj,
Throwable t)
ThreadDeath exceptions are not
passed to this method, but all others are.
The implementation in AbstractDelegate simply logs an error to log.
handleWritebackException in interface PersistentObjectDelegate<T>pobj - the instance that encountered the exceptiont - the exception thrown
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||