public static class ResyncCapability.Listener<S> extends Trigger<S>
The listener implementation should return quickly from the callback methods, to avoid lingering transactions. If the listener is used to invoke special repair operations, they should be placed into a task queue. A separate thread can then perform the repairs outside the resync transaction.
Trigger.Abort
Constructor and Description |
---|
ResyncCapability.Listener() |
Modifier and Type | Method and Description |
---|---|
void |
afterDelete(S oldStorable,
java.lang.Object state)
Called right after a bogus storable has been successfully deleted.
|
void |
afterInsert(S newStorable,
java.lang.Object state)
Called right after a sync'd storable has been successfully inserted.
|
void |
afterUpdate(S newStorable,
java.lang.Object state)
Called right after a sync'd storable has been successfully updated.
|
java.lang.Object |
beforeDelete(S oldStorable)
Called before a bogus storable is to be deleted.
|
java.lang.Object |
beforeInsert(S newStorable)
Called before a sync'd storable is to be inserted.
|
java.lang.Object |
beforeUpdate(S newStorable)
Called before a sync'd storable is to be updated.
|
java.lang.Object |
beforeUpdate(S oldStorable,
S newStorable)
Overloaded version of beforeUpdate method which is passed the
storable in it's out-of-sync and sync'd states.
|
void |
failedDelete(S oldStorable,
java.lang.Object state)
Called when a delete operation failed because an exception was
thrown.
|
void |
failedInsert(S newStorable,
java.lang.Object state)
Called when an insert operation failed because an exception was
thrown.
|
void |
failedUpdate(S newStorable,
java.lang.Object state)
Called when an update operation failed because an exception was
thrown.
|
abortTry, afterLoad, afterTryDelete, afterTryInsert, afterTryUpdate, beforeDelete, beforeInsert, beforeTryDelete, beforeTryDelete, beforeTryInsert, beforeTryInsert, beforeTryUpdate, beforeTryUpdate, beforeUpdate
public java.lang.Object beforeInsert(S newStorable) throws PersistException
beforeInsert
in class Trigger<S>
newStorable
- sync'd storable before being insertedPersistException
public void afterInsert(S newStorable, java.lang.Object state) throws PersistException
afterInsert
in class Trigger<S>
newStorable
- sync'd storable after being insertedstate
- object returned by beforeInsert methodPersistException
public void failedInsert(S newStorable, java.lang.Object state)
failedInsert
in class Trigger<S>
newStorable
- sync'd storable which failed to be insertedstate
- object returned by beforeInsert method, but it may be nullpublic java.lang.Object beforeUpdate(S newStorable) throws PersistException
beforeUpdate
in class Trigger<S>
newStorable
- sync'd storable before being updatedPersistException
public java.lang.Object beforeUpdate(S oldStorable, S newStorable) throws PersistException
The default implementation calls the single argument beforeUpdate method, only passing the newly sync'd storable.
oldStorable
- storable prior to being sync'dnewStorable
- sync'd storable before being updatedPersistException
public void afterUpdate(S newStorable, java.lang.Object state) throws PersistException
afterUpdate
in class Trigger<S>
newStorable
- sync'd storable after being updatedstate
- optional object returned by beforeUpdate methodPersistException
public void failedUpdate(S newStorable, java.lang.Object state)
failedUpdate
in class Trigger<S>
newStorable
- sync'd storable which failed to be updatedstate
- object returned by beforeUpdate method, but it may be nullpublic java.lang.Object beforeDelete(S oldStorable) throws PersistException
beforeDelete
in class Trigger<S>
oldStorable
- bogus storable before being deletedPersistException
public void afterDelete(S oldStorable, java.lang.Object state) throws PersistException
afterDelete
in class Trigger<S>
oldStorable
- bogus storable after being deletedstate
- optional object returned by beforeDelete methodPersistException
public void failedDelete(S oldStorable, java.lang.Object state)
failedDelete
in class Trigger<S>
oldStorable
- bogus storable which failed to be deletedstate
- object returned by beforeDelete method, but it may be nullCopyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.