|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.txbridge.ba.participant.Participant
public abstract class Participant
This is an abstract class for Participant. It provides the implemention of methods that are related to compensation and completing the work and are common for following participants: - Coordinator Completion Participant - Participant Completion Participant
| Field Summary | |
|---|---|
private static BATransactionManager |
baTransactionManager
|
private CompensationDataFactory |
cdf
|
private java.util.concurrent.ConcurrentMap<java.lang.String,CompensationData> |
compensationData
|
private static org.apache.log4j.Logger |
log
|
protected java.lang.String |
serviceId
|
protected ServiceInformationManager |
sim
|
protected SingleTransactionManager |
stm
|
protected java.util.List<java.lang.String> |
taskList
|
private java.lang.String |
txId
|
| Constructor Summary | |
|---|---|
Participant(java.lang.String txId,
java.lang.String serviceId,
SingleTransactionManager stm,
CompensationDataFactory cdf)
Constructor. |
|
| Method Summary | |
|---|---|
void |
associateTask(java.lang.String taskId)
This method associates a new task with the existing participant. |
(package private) void |
closeTransaction()
This method is invoked by the participant object if a transaction is finished. |
void |
compensateTask(java.lang.String taskId)
This method provides the implementation for executing the compensation action. |
(package private) void |
compensateTransaction()
This method is invoked by the participant object if a transaction should compensate. |
java.lang.Object |
get(java.lang.String taskId,
java.lang.Object objectId)
This method retrieves an object with a given identifier from the compensation data that is stored for a given task id. |
java.lang.Object[] |
getArguments(java.lang.String taskId)
This method retrieves a list of arguments that was passed for method's invocation. |
java.lang.Object[] |
getReturn(java.lang.String taskId)
This method gets the return value that will be used as an argument when executing compensation action (when BACompensationType is set to RETURN_VALUE) |
void |
put(java.lang.String taskId,
java.lang.Object objectId,
java.lang.Object object)
This method stores an object withing the compensation data for a given task. |
void |
putArguments(java.lang.String taskId,
java.lang.Object[] arguments)
This method stores a list of arguments that was passed for method's invocation. |
void |
putReturn(java.lang.String taskId,
java.lang.Object returnObject)
This method stores the return value that will be used as an argument when executing compensation action (when BACompensationType is set to RETURN_VALUE) |
void |
removeTask(java.lang.String taskId)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static org.apache.log4j.Logger log
protected ServiceInformationManager sim
private static BATransactionManager baTransactionManager
private CompensationDataFactory cdf
protected SingleTransactionManager stm
private java.lang.String txId
protected java.lang.String serviceId
protected java.util.List<java.lang.String> taskList
private java.util.concurrent.ConcurrentMap<java.lang.String,CompensationData> compensationData
| Constructor Detail |
|---|
public Participant(java.lang.String txId,
java.lang.String serviceId,
SingleTransactionManager stm,
CompensationDataFactory cdf)
txId - is the transaction identifier.serviceId - is the service identifier.cdf - is the compensation data factory that should be used.stm - is the single transaction manager.| Method Detail |
|---|
public void put(java.lang.String taskId,
java.lang.Object objectId,
java.lang.Object object)
taskId - is the ID of the task.objectId - is the ID of the object.object - is the object to be stored.
public java.lang.Object get(java.lang.String taskId,
java.lang.Object objectId)
taskId - is the ID of the task.objectId - is the ID of the object.
public void associateTask(java.lang.String taskId)
throws TaskAssociationFailedException
taskId - is the task identifier.
TaskAssociationFailedException - if task association fails.public void removeTask(java.lang.String taskId)
taskId - is the ID of a task that should be removed from the list.void compensateTransaction()
void closeTransaction()
public void compensateTask(java.lang.String taskId)
throws CompensationActionUnsuccessfulException
taskId - is the ID of the task that is supposed to be compensated.
CompensationActionUnsuccessfulException - if compensation was not successful.
public void putArguments(java.lang.String taskId,
java.lang.Object[] arguments)
taskId - is the ID of the task.arguments - is the list of arguments.public java.lang.Object[] getArguments(java.lang.String taskId)
taskId - is the task ID.
public void putReturn(java.lang.String taskId,
java.lang.Object returnObject)
taskId - is the task identifier.returnObject - is the return object.public java.lang.Object[] getReturn(java.lang.String taskId)
taskId - is the task ID.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||