From d479253768d296a40b4f699e1de9b03c7146a97a Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Tue, 3 Dec 2013 14:03:28 -0800 Subject: Adding javadocs and Carbonado User Guide --- .../com/amazon/carbonado/spi/TriggerManager.html | 1324 ++++++++++++++++++++ 1 file changed, 1324 insertions(+) create mode 100644 apidocs/com/amazon/carbonado/spi/TriggerManager.html (limited to 'apidocs/com/amazon/carbonado/spi/TriggerManager.html') diff --git a/apidocs/com/amazon/carbonado/spi/TriggerManager.html b/apidocs/com/amazon/carbonado/spi/TriggerManager.html new file mode 100644 index 0000000..747f969 --- /dev/null +++ b/apidocs/com/amazon/carbonado/spi/TriggerManager.html @@ -0,0 +1,1324 @@ + + + + + + +TriggerManager (Carbonado 1.2.3 API) + + + + + + + +
+ + + + + +
+ + + +
+
com.amazon.carbonado.spi
+

Class TriggerManager<S extends Storable>

+
+
+ +
+
    +
  • +
    +
    +
    public class TriggerManager<S extends Storable>
    +extends Trigger<S>
    +
    Used by Storage implementations to manage triggers and consolidate them into + single logical triggers. This class is thread-safe and ensures that changes + to the trigger set do not affect transactions in progress.
    +
    Author:
    +
    Brian S O'Neill
    +
  • +
+
+
+
    +
  • + + + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods 
      Modifier and TypeMethod and Description
      booleanaddTrigger(Trigger<? super S> trigger) 
      voidaddTriggers(java.lang.Class<S> type, + java.lang.Iterable<TriggerFactory> triggerFactories) 
      voidafterDelete(S storable, + java.lang.Object state) +
      Called right after a storable has been successfully deleted.
      +
      voidafterInsert(S storable, + java.lang.Object state) +
      Called right after a storable has been successfully inserted.
      +
      voidafterLoad(S storable) +
      Called right after a storable has been successfully loaded or + fetched.
      +
      voidafterTryDelete(S storable, + java.lang.Object state) +
      Called right after a storable has been successfully deleted via + tryDelete.
      +
      voidafterTryInsert(S storable, + java.lang.Object state) +
      Called right after a storable has been successfully inserted via + tryInsert.
      +
      voidafterTryUpdate(S storable, + java.lang.Object state) +
      Called right after a storable has been successfully updated via + tryUpdate.
      +
      voidafterUpdate(S storable, + java.lang.Object state) +
      Called right after a storable has been successfully updated.
      +
      java.lang.ObjectbeforeDelete(S storable) +
      Called before a storable is to be deleted.
      +
      java.lang.ObjectbeforeDelete(Transaction txn, + S storable) +
      Called before a storable is to be deleted.
      +
      java.lang.ObjectbeforeInsert(S storable) +
      Called before a storable is to be inserted.
      +
      java.lang.ObjectbeforeInsert(Transaction txn, + S storable) +
      Called before a storable is to be inserted.
      +
      java.lang.ObjectbeforeTryDelete(S storable) +
      Called before a storable is to be deleted via tryDelete.
      +
      java.lang.ObjectbeforeTryDelete(Transaction txn, + S storable) +
      Called before a storable is to be deleted via tryDelete.
      +
      java.lang.ObjectbeforeTryInsert(S storable) +
      Called before a storable is to be inserted via tryInsert.
      +
      java.lang.ObjectbeforeTryInsert(Transaction txn, + S storable) +
      Called before a storable is to be inserted via tryInsert.
      +
      java.lang.ObjectbeforeTryUpdate(S storable) +
      Called before a storable is to be updated via tryUpdate.
      +
      java.lang.ObjectbeforeTryUpdate(Transaction txn, + S storable) +
      Called before a storable is to be updated via tryUpdate.
      +
      java.lang.ObjectbeforeUpdate(S storable) +
      Called before a storable is to be updated.
      +
      java.lang.ObjectbeforeUpdate(Transaction txn, + S storable) +
      Called before a storable is to be updated.
      +
      voidfailedDelete(S storable, + java.lang.Object state) +
      Called when an delete operation failed because the record was missing or + an exception was thrown.
      +
      voidfailedInsert(S storable, + java.lang.Object state) +
      Called when an insert operation failed due to a unique constraint + violation or an exception was thrown.
      +
      voidfailedUpdate(S storable, + java.lang.Object state) +
      Called when an update operation failed because the record was missing or + an exception was thrown.
      +
      Trigger<? super S>getDeleteTrigger() +
      Returns a consolidated trigger to call for delete operations, or null if + none.
      +
      Trigger<? super S>getInsertTrigger() +
      Returns a consolidated trigger to call for insert operations, or null if + none.
      +
      Trigger<? super S>getLoadTrigger() +
      Returns a consolidated trigger to call for load operations, or null if + none.
      +
      Trigger<? super S>getUpdateTrigger() +
      Returns a consolidated trigger to call for update operations, or null if + none.
      +
      voidlocallyDisableDelete() +
      Disables execution of all managed delete triggers for the current + thread.
      +
      voidlocallyDisableInsert() +
      Disables execution of all managed insert triggers for the current + thread.
      +
      voidlocallyDisableLoad() +
      Disables execution of all managed load triggers for the current + thread.
      +
      voidlocallyDisableUpdate() +
      Disables execution of all managed update triggers for the current + thread.
      +
      voidlocallyEnableDelete() +
      Enables execution of all managed delete triggers for the current thread, + if they had been disabled before.
      +
      voidlocallyEnableInsert() +
      Enables execution of all managed insert triggers for the current thread, + if they had been disabled before.
      +
      voidlocallyEnableLoad() +
      Enables execution of all managed load triggers for the current thread, + if they had been disabled before.
      +
      voidlocallyEnableUpdate() +
      Enables execution of all managed update triggers for the current thread, + if they had been disabled before.
      +
      booleanremoveTrigger(Trigger<? super S> trigger) 
      + +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TriggerManager

        +
        public TriggerManager()
        +
      • +
      + + + +
        +
      • +

        TriggerManager

        +
        public TriggerManager(java.lang.Class<S> type,
        +              java.lang.Iterable<TriggerFactory> triggerFactories)
        +               throws RepositoryException
        +
        Parameters:
        triggerFactories - TriggerFactories which will be called upon to + optionally return a trigger to initially register
        +
        Throws:
        +
        RepositoryException
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getInsertTrigger

        +
        public Trigger<? super S> getInsertTrigger()
        +
        Returns a consolidated trigger to call for insert operations, or null if + none. If not null, the consolidated trigger is not a snapshot -- it will + change as the set of triggers in this manager changes.
        +
      • +
      + + + +
        +
      • +

        getUpdateTrigger

        +
        public Trigger<? super S> getUpdateTrigger()
        +
        Returns a consolidated trigger to call for update operations, or null if + none. If not null, the consolidated trigger is not a snapshot -- it will + change as the set of triggers in this manager changes.
        +
      • +
      + + + +
        +
      • +

        getDeleteTrigger

        +
        public Trigger<? super S> getDeleteTrigger()
        +
        Returns a consolidated trigger to call for delete operations, or null if + none. If not null, the consolidated trigger is not a snapshot -- it will + change as the set of triggers in this manager changes.
        +
      • +
      + + + +
        +
      • +

        getLoadTrigger

        +
        public Trigger<? super S> getLoadTrigger()
        +
        Returns a consolidated trigger to call for load operations, or null if + none. If not null, the consolidated trigger is not a snapshot -- it will + change as the set of triggers in this manager changes.
        +
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        addTrigger

        +
        public boolean addTrigger(Trigger<? super S> trigger)
        +
      • +
      + + + +
        +
      • +

        removeTrigger

        +
        public boolean removeTrigger(Trigger<? super S> trigger)
        +
      • +
      + + + + + + + +
        +
      • +

        locallyDisableInsert

        +
        public void locallyDisableInsert()
        +
        Disables execution of all managed insert triggers for the current + thread. Call locallyEnableInsert to enable again. This call can be made + multiple times, but be sure to call locallyEnableInsert the same number of + times to fully enable.
        +
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        locallyEnableInsert

        +
        public void locallyEnableInsert()
        +
        Enables execution of all managed insert triggers for the current thread, + if they had been disabled before.
        +
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        locallyDisableUpdate

        +
        public void locallyDisableUpdate()
        +
        Disables execution of all managed update triggers for the current + thread. Call locallyEnableUpdate to enable again. This call can be made + multiple times, but be sure to call locallyEnableUpdate the same number of + times to fully enable.
        +
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        locallyEnableUpdate

        +
        public void locallyEnableUpdate()
        +
        Enables execution of all managed update triggers for the current thread, + if they had been disabled before.
        +
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        locallyDisableDelete

        +
        public void locallyDisableDelete()
        +
        Disables execution of all managed delete triggers for the current + thread. Call locallyEnableDelete to enable again. This call can be made + multiple times, but be sure to call locallyEnableDelete the same number of + times to fully enable.
        +
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        locallyEnableDelete

        +
        public void locallyEnableDelete()
        +
        Enables execution of all managed delete triggers for the current thread, + if they had been disabled before.
        +
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        locallyDisableLoad

        +
        public void locallyDisableLoad()
        +
        Disables execution of all managed load triggers for the current + thread. Call locallyEnableLoad to enable again. This call can be made + multiple times, but be sure to call locallyEnableLoad the same number of + times to fully enable.
        +
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        locallyEnableLoad

        +
        public void locallyEnableLoad()
        +
        Enables execution of all managed load triggers for the current thread, + if they had been disabled before.
        +
        Since:
        +
        1.2
        +
      • +
      + + + + + +
        +
      • +

        beforeInsert

        +
        public java.lang.Object beforeInsert(S storable)
        +                              throws PersistException
        +
        Description copied from class: Trigger
        +
        Called before a storable is to be inserted. The default implementation + does nothing. + +

        Any exception thrown by this method will cause the insert operation + to rollback and all remaining triggers to not run. The exception is + ultimately passed to the caller of the insert method.

        +
        +
        Overrides:
        +
        beforeInsert in class Trigger<S extends Storable>
        +
        Parameters:
        storable - storable before being inserted
        +
        Returns:
        arbitrary state object, passed to afterInsert or failedInsert method
        +
        Throws:
        +
        PersistException
        +
      • +
      + + + + + +
        +
      • +

        beforeInsert

        +
        public java.lang.Object beforeInsert(Transaction txn,
        +                            S storable)
        +                              throws PersistException
        +
        Description copied from class: Trigger
        +
        Called before a storable is to be inserted. The default implementation + simply calls Trigger.beforeInsert(Object). Only override if access to + the transaction is required. + +

        Any exception thrown by this method will cause the insert operation + to rollback and all remaining triggers to not run. The exception is + ultimately passed to the caller of the insert method.

        +
        +
        Overrides:
        +
        beforeInsert in class Trigger<S extends Storable>
        +
        Parameters:
        txn - nested transaction which trigger runs in
        storable - storable before being inserted
        +
        Returns:
        arbitrary state object, passed to afterInsert or failedInsert method
        +
        Throws:
        +
        PersistException
        +
      • +
      + + + + + +
        +
      • +

        beforeTryInsert

        +
        public java.lang.Object beforeTryInsert(S storable)
        +                                 throws PersistException
        +
        Description copied from class: Trigger
        +
        Called before a storable is to be inserted via tryInsert. The default + implementation simply calls Trigger.beforeInsert(Object). Only override + if trigger needs to distinguish between different insert variants. + +

        Any exception thrown by this method will cause the tryInsert operation + to rollback and all remaining triggers to not run. The exception is + ultimately passed to the caller of the tryInsert method.

        +
        +
        Overrides:
        +
        beforeTryInsert in class Trigger<S extends Storable>
        +
        Parameters:
        storable - storable before being inserted
        +
        Returns:
        arbitrary state object, passed to afterTryInsert or failedInsert method
        +
        Throws:
        +
        PersistException
        See Also:
        Trigger.abortTry()
        +
      • +
      + + + + + +
        +
      • +

        beforeTryInsert

        +
        public java.lang.Object beforeTryInsert(Transaction txn,
        +                               S storable)
        +                                 throws PersistException
        +
        Description copied from class: Trigger
        +
        Called before a storable is to be inserted via tryInsert. The default + implementation simply calls Trigger.beforeTryInsert(Object). Only + override if trigger needs access to the transaction and to distinguish + between different insert variants. + +

        Any exception thrown by this method will cause the tryInsert operation + to rollback and all remaining triggers to not run. The exception is + ultimately passed to the caller of the tryInsert method.

        +
        +
        Overrides:
        +
        beforeTryInsert in class Trigger<S extends Storable>
        +
        Parameters:
        txn - nested transaction which trigger runs in
        storable - storable before being inserted
        +
        Returns:
        arbitrary state object, passed to afterTryInsert or failedInsert method
        +
        Throws:
        +
        PersistException
        See Also:
        Trigger.abortTry()
        +
      • +
      + + + + + +
        +
      • +

        afterInsert

        +
        public void afterInsert(S storable,
        +               java.lang.Object state)
        +                 throws PersistException
        +
        Description copied from class: Trigger
        +
        Called right after a storable has been successfully inserted. The + default implementation does nothing. + +

        Any exception thrown by this method will cause the insert operation + to rollback and all remaining triggers to not run. The exception is + ultimately passed to the caller of the insert method.

        +
        +
        Overrides:
        +
        afterInsert in class Trigger<S extends Storable>
        +
        Parameters:
        storable - storable after being inserted
        state - object returned by beforeInsert method
        +
        Throws:
        +
        PersistException
        +
      • +
      + + + + + +
        +
      • +

        afterTryInsert

        +
        public void afterTryInsert(S storable,
        +                  java.lang.Object state)
        +                    throws PersistException
        +
        Description copied from class: Trigger
        +
        Called right after a storable has been successfully inserted via + tryInsert. The default implementation simply calls Trigger.afterInsert(S, java.lang.Object). + Only override if trigger needs to distinguish between different insert + variants. + +

        Any exception thrown by this method will cause the tryInsert + operation to rollback and all remaining triggers to not run. The + exception is ultimately passed to the caller of the tryInsert method.

        +
        +
        Overrides:
        +
        afterTryInsert in class Trigger<S extends Storable>
        +
        Parameters:
        storable - storable after being inserted
        state - object returned by beforeTryInsert method
        +
        Throws:
        +
        PersistException
        See Also:
        Trigger.abortTry()
        +
      • +
      + + + + + +
        +
      • +

        failedInsert

        +
        public void failedInsert(S storable,
        +                java.lang.Object state)
        +
        Description copied from class: Trigger
        +
        Called when an insert operation failed due to a unique constraint + violation or an exception was thrown. The main purpose of this method is + to allow any necessary clean-up to occur on the optional state object. + +

        Any exception thrown by this method will be passed to the current + thread's uncaught exception handler.

        +
        +
        Overrides:
        +
        failedInsert in class Trigger<S extends Storable>
        +
        Parameters:
        storable - storable which failed to be inserted
        state - object returned by beforeInsert method, but it may be null
        +
      • +
      + + + + + +
        +
      • +

        beforeUpdate

        +
        public java.lang.Object beforeUpdate(S storable)
        +                              throws PersistException
        +
        Description copied from class: Trigger
        +
        Called before a storable is to be updated. The default implementation + does nothing. + +

        Any exception thrown by this method will cause the update operation + to rollback and all remaining triggers to not run. The exception is + ultimately passed to the caller of the update method.

        +
        +
        Overrides:
        +
        beforeUpdate in class Trigger<S extends Storable>
        +
        Parameters:
        storable - storable before being updated
        +
        Returns:
        arbitrary state object, passed to afterUpdate or failedUpdate method
        +
        Throws:
        +
        PersistException
        +
      • +
      + + + + + +
        +
      • +

        beforeUpdate

        +
        public java.lang.Object beforeUpdate(Transaction txn,
        +                            S storable)
        +                              throws PersistException
        +
        Description copied from class: Trigger
        +
        Called before a storable is to be updated. The default implementation + simply calls Trigger.beforeUpdate(Object). Only override if access to + the transaction is required. + +

        Any exception thrown by this method will cause the update operation + to rollback and all remaining triggers to not run. The exception is + ultimately passed to the caller of the update method.

        +
        +
        Overrides:
        +
        beforeUpdate in class Trigger<S extends Storable>
        +
        Parameters:
        txn - nested transaction which trigger runs in
        storable - storable before being updated
        +
        Returns:
        arbitrary state object, passed to afterUpdate or failedUpdate method
        +
        Throws:
        +
        PersistException
        +
      • +
      + + + + + +
        +
      • +

        beforeTryUpdate

        +
        public java.lang.Object beforeTryUpdate(S storable)
        +                                 throws PersistException
        +
        Description copied from class: Trigger
        +
        Called before a storable is to be updated via tryUpdate. The default + implementation simply calls Trigger.beforeUpdate(Object). Only override + if trigger needs to distinguish between different update variants. + +

        Any exception thrown by this method will cause the tryUpdate operation + to rollback and all remaining triggers to not run. The exception is + ultimately passed to the caller of the tryUpdate method.

        +
        +
        Overrides:
        +
        beforeTryUpdate in class Trigger<S extends Storable>
        +
        Parameters:
        storable - storable before being updated
        +
        Returns:
        arbitrary state object, passed to afterTryUpdate or failedUpdate method
        +
        Throws:
        +
        PersistException
        See Also:
        Trigger.abortTry()
        +
      • +
      + + + + + +
        +
      • +

        beforeTryUpdate

        +
        public java.lang.Object beforeTryUpdate(Transaction txn,
        +                               S storable)
        +                                 throws PersistException
        +
        Description copied from class: Trigger
        +
        Called before a storable is to be updated via tryUpdate. The default + implementation simply calls Trigger.beforeTryUpdate(Object). Only + override if trigger needs access to the transaction and to distinguish + between different update variants. + +

        Any exception thrown by this method will cause the tryUpdate operation + to rollback and all remaining triggers to not run. The exception is + ultimately passed to the caller of the tryUpdate method.

        +
        +
        Overrides:
        +
        beforeTryUpdate in class Trigger<S extends Storable>
        +
        Parameters:
        txn - nested transaction which trigger runs in
        storable - storable before being updated
        +
        Returns:
        arbitrary state object, passed to afterTryUpdate or failedUpdate method
        +
        Throws:
        +
        PersistException
        See Also:
        Trigger.abortTry()
        +
      • +
      + + + + + +
        +
      • +

        afterUpdate

        +
        public void afterUpdate(S storable,
        +               java.lang.Object state)
        +                 throws PersistException
        +
        Description copied from class: Trigger
        +
        Called right after a storable has been successfully updated. The default + implementation does nothing. + +

        Any exception thrown by this method will cause the update operation + to rollback and all remaining triggers to not run. The exception is + ultimately passed to the caller of the update method.

        +
        +
        Overrides:
        +
        afterUpdate in class Trigger<S extends Storable>
        +
        Parameters:
        storable - storable after being updated
        state - optional object returned by beforeUpdate method
        +
        Throws:
        +
        PersistException
        +
      • +
      + + + + + +
        +
      • +

        afterTryUpdate

        +
        public void afterTryUpdate(S storable,
        +                  java.lang.Object state)
        +                    throws PersistException
        +
        Description copied from class: Trigger
        +
        Called right after a storable has been successfully updated via + tryUpdate. The default implementation simply calls Trigger.afterUpdate(S, java.lang.Object). + Only override if trigger needs to distinguish between different update + variants. + +

        Any exception thrown by this method will cause the tryUpdate + operation to rollback and all remaining triggers to not run. The + exception is ultimately passed to the caller of the tryUpdate method.

        +
        +
        Overrides:
        +
        afterTryUpdate in class Trigger<S extends Storable>
        +
        Parameters:
        storable - storable after being updated
        state - object returned by beforeTryUpdate method
        +
        Throws:
        +
        PersistException
        See Also:
        Trigger.abortTry()
        +
      • +
      + + + + + +
        +
      • +

        failedUpdate

        +
        public void failedUpdate(S storable,
        +                java.lang.Object state)
        +
        Description copied from class: Trigger
        +
        Called when an update operation failed because the record was missing or + an exception was thrown. The main purpose of this method is to allow any + necessary clean-up to occur on the optional state object. + +

        Any exception thrown by this method will be passed to the current + thread's uncaught exception handler.

        +
        +
        Overrides:
        +
        failedUpdate in class Trigger<S extends Storable>
        +
        Parameters:
        storable - storable which failed to be updated
        state - optional object returned by beforeUpdate + method, but it may be null
        +
      • +
      + + + + + +
        +
      • +

        beforeDelete

        +
        public java.lang.Object beforeDelete(S storable)
        +                              throws PersistException
        +
        Description copied from class: Trigger
        +
        Called before a storable is to be deleted. The default implementation + does nothing. + +

        Any exception thrown by this method will cause the delete operation + to rollback and all remaining triggers to not run. The exception is + ultimately passed to the caller of the delete method.

        +
        +
        Overrides:
        +
        beforeDelete in class Trigger<S extends Storable>
        +
        Parameters:
        storable - storable before being deleted
        +
        Returns:
        arbitrary state object, passed to afterDelete or failedDelete method
        +
        Throws:
        +
        PersistException
        +
      • +
      + + + + + +
        +
      • +

        beforeDelete

        +
        public java.lang.Object beforeDelete(Transaction txn,
        +                            S storable)
        +                              throws PersistException
        +
        Description copied from class: Trigger
        +
        Called before a storable is to be deleted. The default implementation + simply calls Trigger.beforeDelete(Object). Only override if access to + the transaction is required. + +

        Any exception thrown by this method will cause the delete operation + to rollback and all remaining triggers to not run. The exception is + ultimately passed to the caller of the delete method.

        +
        +
        Overrides:
        +
        beforeDelete in class Trigger<S extends Storable>
        +
        Parameters:
        txn - nested transaction which trigger runs in
        storable - storable before being deleted
        +
        Returns:
        arbitrary state object, passed to afterDelete or failedDelete method
        +
        Throws:
        +
        PersistException
        +
      • +
      + + + + + +
        +
      • +

        beforeTryDelete

        +
        public java.lang.Object beforeTryDelete(S storable)
        +                                 throws PersistException
        +
        Description copied from class: Trigger
        +
        Called before a storable is to be deleted via tryDelete. The default + implementation simply calls Trigger.beforeDelete(Object). Only override + if trigger needs to distinguish between different delete variants. + +

        Any exception thrown by this method will cause the tryDelete operation + to rollback and all remaining triggers to not run. The exception is + ultimately passed to the caller of the tryDelete method.

        +
        +
        Overrides:
        +
        beforeTryDelete in class Trigger<S extends Storable>
        +
        Parameters:
        storable - storable before being deleted
        +
        Returns:
        arbitrary state object, passed to afterTryDelete or failedDelete method
        +
        Throws:
        +
        PersistException
        See Also:
        Trigger.abortTry()
        +
      • +
      + + + + + +
        +
      • +

        beforeTryDelete

        +
        public java.lang.Object beforeTryDelete(Transaction txn,
        +                               S storable)
        +                                 throws PersistException
        +
        Description copied from class: Trigger
        +
        Called before a storable is to be deleted via tryDelete. The default + implementation simply calls Trigger.beforeTryDelete(Object). Only + override if trigger needs access to the transaction and to distinguish + between different delete variants. + +

        Any exception thrown by this method will cause the tryDelete operation + to rollback and all remaining triggers to not run. The exception is + ultimately passed to the caller of the tryDelete method.

        +
        +
        Overrides:
        +
        beforeTryDelete in class Trigger<S extends Storable>
        +
        Parameters:
        txn - nested transaction which trigger runs in
        storable - storable before being deleted
        +
        Returns:
        arbitrary state object, passed to afterTryDelete or failedDelete method
        +
        Throws:
        +
        PersistException
        See Also:
        Trigger.abortTry()
        +
      • +
      + + + + + +
        +
      • +

        afterDelete

        +
        public void afterDelete(S storable,
        +               java.lang.Object state)
        +                 throws PersistException
        +
        Description copied from class: Trigger
        +
        Called right after a storable has been successfully deleted. The default + implementation does nothing. + +

        Any exception thrown by this method will cause the delete operation + to rollback and all remaining triggers to not run. The exception is + ultimately passed to the caller of the delete method.

        +
        +
        Overrides:
        +
        afterDelete in class Trigger<S extends Storable>
        +
        Parameters:
        storable - storable after being deleted
        state - optional object returned by beforeDelete method
        +
        Throws:
        +
        PersistException
        +
      • +
      + + + + + +
        +
      • +

        afterTryDelete

        +
        public void afterTryDelete(S storable,
        +                  java.lang.Object state)
        +                    throws PersistException
        +
        Description copied from class: Trigger
        +
        Called right after a storable has been successfully deleted via + tryDelete. The default implementation simply calls Trigger.afterDelete(S, java.lang.Object). + Only override if trigger needs to distinguish between different delete + variants. + +

        Any exception thrown by this method will cause the tryDelete + operation to rollback and all remaining triggers to not run. The + exception is ultimately passed to the caller of the tryDelete method.

        +
        +
        Overrides:
        +
        afterTryDelete in class Trigger<S extends Storable>
        +
        Parameters:
        storable - storable after being deleted
        state - object returned by beforeTryDelete method
        +
        Throws:
        +
        PersistException
        See Also:
        Trigger.abortTry()
        +
      • +
      + + + + + +
        +
      • +

        failedDelete

        +
        public void failedDelete(S storable,
        +                java.lang.Object state)
        +
        Description copied from class: Trigger
        +
        Called when an delete operation failed because the record was missing or + an exception was thrown. The main purpose of this method is to allow any + necessary clean-up to occur on the optional state object. + +

        Any exception thrown by this method will be passed to the current + thread's uncaught exception handler.

        +
        +
        Overrides:
        +
        failedDelete in class Trigger<S extends Storable>
        +
        Parameters:
        storable - storable which failed to be deleted
        state - optional object returned by beforeDelete + method, but it may be null
        +
      • +
      + + + + + +
        +
      • +

        afterLoad

        +
        public void afterLoad(S storable)
        +               throws FetchException
        +
        Description copied from class: Trigger
        +
        Called right after a storable has been successfully loaded or + fetched. The default implementation does nothing.
        +
        +
        Overrides:
        +
        afterLoad in class Trigger<S extends Storable>
        +
        Parameters:
        storable - storable after being loaded or fetched
        +
        Throws:
        +
        FetchException
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + +
+ + +

Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.

+ + -- cgit v1.2.3