org.caleigo.core
Class AsyncTransactionHandler

java.lang.Object
  extended byorg.caleigo.core.AsyncTransactionHandler

public class AsyncTransactionHandler
extends java.lang.Object

Version:
1.00
Author:
mha

Field Summary
protected static int CANCELED
           
static int COMMIT_CANCELED
           
static int COMMIT_FAILED
           
static int COMMIT_SUCCEEDED
           
protected static int COMPLETED
           
protected static int FAILED
           
protected static int FINISHED
           
protected static int STARTED
           
 
Constructor Summary
AsyncTransactionHandler()
           
 
Method Summary
 IDataTransaction.Job commit(IDataTransaction transaction)
           
static AsyncTransactionHandler create()
           
protected  void doOnCommitCanceled()
          Invoked when the commit execution has been successfully canceled.
protected  void doOnCommitCompleted()
          Invoked when the commit execution has completed.
protected  void doOnCommitFailed()
          Invoked when the commit execution has failed.
protected  void doOnCommitFinished()
          Invoked when the commit execution has finished.
protected  void doOnCommitStarted()
          Invoked when the commit execution starts.
protected  void performNotification(int type)
          Invoked when one of the doOn-methods should be invoked.
 void setCallback(java.lang.Object callbackObject, java.lang.String methodName)
          Sets the method that should be invoked when the transaction has finished.
static void setDefaultAsyncTransactionHandlerClass(java.lang.Class handlerClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STARTED

protected static final int STARTED
See Also:
Constant Field Values

FINISHED

protected static final int FINISHED
See Also:
Constant Field Values

COMPLETED

protected static final int COMPLETED
See Also:
Constant Field Values

CANCELED

protected static final int CANCELED
See Also:
Constant Field Values

FAILED

protected static final int FAILED
See Also:
Constant Field Values

COMMIT_SUCCEEDED

public static final int COMMIT_SUCCEEDED
See Also:
Constant Field Values

COMMIT_CANCELED

public static final int COMMIT_CANCELED
See Also:
Constant Field Values

COMMIT_FAILED

public static final int COMMIT_FAILED
See Also:
Constant Field Values
Constructor Detail

AsyncTransactionHandler

public AsyncTransactionHandler()
Method Detail

setDefaultAsyncTransactionHandlerClass

public static void setDefaultAsyncTransactionHandlerClass(java.lang.Class handlerClass)

create

public static AsyncTransactionHandler create()

setCallback

public void setCallback(java.lang.Object callbackObject,
                        java.lang.String methodName)
Sets the method that should be invoked when the transaction has finished. This method is invoked before the corresponding doOn-method is invoked. Note: The callback method must not declare one int parameter that will be set to one of COMMIT_SUCCEEDED, COMMIT_CANCELED or COMMIT_FAILED.


commit

public IDataTransaction.Job commit(IDataTransaction transaction)

doOnCommitStarted

protected void doOnCommitStarted()
Invoked when the commit execution starts.


doOnCommitFinished

protected void doOnCommitFinished()
Invoked when the commit execution has finished. Execution finishes when the commit has completed, has been canceled or has failed. This method is invoked before one of doOnCommitCompleted, doOnCommitCanceled or doOnCommitFailed is invoked.


doOnCommitCompleted

protected void doOnCommitCompleted()
Invoked when the commit execution has completed.


doOnCommitCanceled

protected void doOnCommitCanceled()
Invoked when the commit execution has been successfully canceled.


doOnCommitFailed

protected void doOnCommitFailed()
Invoked when the commit execution has failed.


performNotification

protected void performNotification(int type)
Invoked when one of the doOn-methods should be invoked. Extending classes should not change the behaviour of this method, but should make sure that it is executed in a thread safe manner. Typically, is GUI operations needs to be performed in the doOn-methods this method should be run in the dispatcher thread.



Copyright © 2005 Caleigo. All Rights Reserved.