|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.amazon.carbonado.Trigger<S>
com.amazon.carbonado.capability.ResyncCapability.Listener<S>
public static class ResyncCapability.Listener<S>
Trigger which is invoked as storables get re-sync'd. Callbacks are invoked in the scope of the resync transaction. If any unchecked exception is thrown, the immediate changes are rolled back and the entire repository resync operation is aborted.
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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.amazon.carbonado.Trigger |
|---|
Trigger.Abort |
| Constructor Summary | |
|---|---|
ResyncCapability.Listener()
|
|
| Method Summary | |
|---|---|
void |
afterDelete(S oldStorable,
Object state)
Called right after a bogus storable has been successfully deleted. |
void |
afterInsert(S newStorable,
Object state)
Called right after a sync'd storable has been successfully inserted. |
void |
afterUpdate(S newStorable,
Object state)
Called right after a sync'd storable has been successfully updated. |
Object |
beforeDelete(S oldStorable)
Called before a bogus storable is to be deleted. |
Object |
beforeInsert(S newStorable)
Called before a sync'd storable is to be inserted. |
Object |
beforeUpdate(S newStorable)
Called before a sync'd storable is to be updated. |
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,
Object state)
Called when a delete operation failed because an exception was thrown. |
void |
failedInsert(S newStorable,
Object state)
Called when an insert operation failed because an exception was thrown. |
void |
failedUpdate(S newStorable,
Object state)
Called when an update operation failed because an exception was thrown. |
| Methods inherited from class com.amazon.carbonado.Trigger |
|---|
abortTry, afterLoad, afterTryDelete, afterTryInsert, afterTryUpdate, beforeTryDelete, beforeTryInsert, beforeTryUpdate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ResyncCapability.Listener()
| Method Detail |
|---|
public Object beforeInsert(S newStorable)
throws PersistException
beforeInsert in class Trigger<S>newStorable - sync'd storable before being inserted
PersistException
public void afterInsert(S newStorable,
Object state)
throws PersistException
afterInsert in class Trigger<S>newStorable - sync'd storable after being insertedstate - object returned by beforeInsert method
PersistException
public void failedInsert(S newStorable,
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 null
public Object beforeUpdate(S newStorable)
throws PersistException
beforeUpdate in class Trigger<S>newStorable - sync'd storable before being updated
PersistException
public 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 updated
PersistException
public void afterUpdate(S newStorable,
Object state)
throws PersistException
afterUpdate in class Trigger<S>newStorable - sync'd storable after being updatedstate - optional object returned by beforeUpdate method
PersistException
public void failedUpdate(S newStorable,
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 null
public Object beforeDelete(S oldStorable)
throws PersistException
beforeDelete in class Trigger<S>oldStorable - bogus storable before being deleted
PersistException
public void afterDelete(S oldStorable,
Object state)
throws PersistException
afterDelete in class Trigger<S>oldStorable - bogus storable after being deletedstate - optional object returned by beforeDelete method
PersistException
public void failedDelete(S oldStorable,
Object state)
failedDelete in class Trigger<S>oldStorable - bogus storable which failed to be deletedstate - object returned by beforeDelete method, but it may be null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||