class PrepareAndCommitJob extends Job implements TransactionConstants
Job
which interacts with
a set of TransactionParticipant
s to inform them
to vote and roll forward/back changes associated with a given
Transaction
.Job
,
ParticipantTask
,
Transaction
,
TransactionParticipant
Modifier and Type | Field and Description |
---|---|
(package private) ParticipantHandle |
handle |
(package private) ClientLog |
log |
(package private) int |
maxtries |
private boolean |
notifyClient |
private static Logger |
operationsLogger
Logger for operations related messages
|
private static Logger |
persistenceLogger
Logger for persistence related messages
|
private RemoteException |
reCaught |
(package private) ServerTransaction |
tr |
ABORTED, ACTIVE, COMMITTED, NOTCHANGED, PREPARED, VOTING
Constructor and Description |
---|
PrepareAndCommitJob(Transaction tr,
java.util.concurrent.ExecutorService pool,
WakeupManager wm,
ClientLog log,
ParticipantHandle handle)
Constructs a
PrepareAndCommitJob . |
Modifier and Type | Method and Description |
---|---|
(package private) Object |
computeResult()
Gathers partial results submitted by tasks and produces
a single outcome.
|
(package private) Runnable[] |
createTasks()
Creates the
TaskManager.Task s necessary to
inform participants to vote and roll-forward/back. |
(package private) Object |
doWork(Runnable who,
Object param)
The work to be performed by each
TaskManager.Task
is provided by the Job that creates it. |
(package private) Exception |
getAlternateException()
Simple accessor that returns the the exception to send back to the
client.
|
attempt, getMgr, getPool, isCompleted, performWork, scheduleTasks, stop
final ServerTransaction tr
final ClientLog log
final ParticipantHandle handle
final int maxtries
private volatile RemoteException reCaught
private volatile boolean notifyClient
private static final Logger operationsLogger
private static final Logger persistenceLogger
public PrepareAndCommitJob(Transaction tr, java.util.concurrent.ExecutorService pool, WakeupManager wm, ClientLog log, ParticipantHandle handle)
PrepareAndCommitJob
.tr
- The Transaction
whose participants
will be instructed to vote and roll-forward/back.pool
- The TaskManager
which provides the
threads used for interacting with participants.log
- The ClientLog
used for recording
recovery data.handle
- The array of participants which will be contacted
and informed to vote and roll-forward/back.TaskManager
,
ClientLog
,
TransactionParticipant
Object doWork(Runnable who, Object param)
TaskManager.Task
is provided by the Job
that creates it.
The work performed by a task belonging to the CommitJob
contacts a participant, instructs it to vote, roll-forward/back
and log appropriately.doWork
in class Job
who
- The task performing the workparam
- A parameter, of the task's choosing, useful
in performing work.Job
,
TaskManager.Task
Runnable[] createTasks()
TaskManager.Task
s necessary to
inform participants to vote and roll-forward/back.createTasks
in class Job
Object computeResult() throws JobException
computeResult
in class Job
JobException
Job
Exception getAlternateException()
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.