|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Interface for framework wide transactions.
Copyright (c) SAP AG 2004
| Method Summary | |
void |
addEndListener(ITransactionEndsListener listener)
Adds an ITransactionEndsListener which is called either when the transaction is committed or rollbacked. |
void |
addTransactionObject(Object key,
Object o)
Stores all kind of objects in this framework transaction. |
boolean |
commit()
Has be called when a a transaction shall be committed. |
Connection |
getConnection()
Returns a valid connection object. |
ITransactionEndsListener |
getEndListener(String key)
Returns a specific listener if it is already registered with this transaction |
Object |
getTransactionObject(Object key)
Returns a previous added object. |
boolean |
isActive()
|
boolean |
isEndListenerRegistered(ITransactionEndsListener listener)
Tells if a specific listener is already registered with this transaction |
void |
rollback()
Has be called when a a transaction shall be rollbacked. |
void |
setVeto()
If called a later commit will always return with false and a rollback will be performed. |
void |
setVeto(Exception cause)
If called a later commit will always return with false and a rollback will be performed. |
boolean |
willBeRollbacked()
Check whether it is necessary to perform further actions with this open transaction. |
| Method Detail |
public Connection getConnection()
throws TxException
Connection.commit() or Connection.rollback()
on this connection.
Instead just close it and call commit() or
rollback() on this transaction object afterwards.
TxException
public void addTransactionObject(Object key,
Object o)
getTransactionObject(java.lang.Object)
public Object getTransactionObject(Object key)
key - the lookup key
addTransactionObject(Object, Object)
public void addEndListener(ITransactionEndsListener listener)
throws TxException
ITransactionEndsListener which is called either when the transaction is committed or rollbacked.
listener -
TxException
public boolean isEndListenerRegistered(ITransactionEndsListener listener)
throws TxException
listener -
TxException
public ITransactionEndsListener getEndListener(String key)
throws TxException
key -
TxException
public boolean commit()
throws TxException
rollback() will be called and false returned.
TxException - if the commit failed, a veto was given or this transaction is not active.
public void rollback()
throws TxException
TxException - if this transaction is not active.willBeRollbacked()
public void setVeto()
throws TxException
TxExceptionwillBeRollbacked()
public void setVeto(Exception cause)
throws TxException
cause - A root exception as reason why the transaction is to be rolled back.
TxExceptionwillBeRollbacked()
public boolean willBeRollbacked()
throws TxException
setVeto() was called.
TxException
public boolean isActive()
throws TxException
TxException
|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||