public class Coordinator extends Object
Modifier and Type | Field and Description |
---|---|
protected static org.jboss.logging.Logger |
log |
Constructor and Description |
---|
Coordinator() |
Modifier and Type | Method and Description |
---|---|
Response |
beginTransaction(UriInfo info,
HttpHeaders headers,
String content)
Performing a POST on Transaction Manager URL @see TxSupport.TX_SEGMENT with no content
as shown below will start a new transaction with a default timeout.
|
Response |
deleteParticipant(String enlistmentId)
Performing DELETE on participant's recovery URL removes participant from the transaction.
|
Response |
deleteTransaction(String id)
Performing a DELETE on the transaction-coordinator URL will return a 403.
|
Response |
enlistParticipant(String linkHeader,
UriInfo info,
String txId,
String content)
Register a participant in a tx
|
Response |
enlistVolatileParticipant(String linkHeader,
UriInfo info,
String txId)
Register a volatile participant in a tx
|
Response |
getAllTransactions(UriInfo info)
Performing a GET on the transaction-manager returns a list of all transaction URIs
known to the coordinator (active and in recovery) separated by
the @see TxSupport.URI_SEPARATOR character
|
Response |
getTransactionExtStatus(UriInfo info,
String id)
Performing a GET on the transaction URL with media type application/txstatusext+xml
returns extended information about the transaction, such as its status,
number of participants, and their individual URIs.
|
org.jboss.jbossts.star.util.media.txstatusext.TransactionManagerElement |
getTransactionManagerInfo(UriInfo info)
Performing a GET on the transaction-manager URI with media type application/txstatusext+xml
returns extended information about the transaction-manager resource such as how long it has
been up and all transaction-coordinator URIs.
|
org.jboss.jbossts.star.util.media.txstatusext.TransactionStatisticsElement |
getTransactionStatistics()
Performing a GET on the transaction-manager URI sufficed with /statistics
returns statistics of the transaction manager.
|
Response |
getTransactionStatus(UriInfo info,
String id)
Performing a GET on the transaction url returns its status
|
Response |
getTransactionURIs(UriInfo info,
String id)
Obtain the transaction terminator and participant enlistment URIs for the
specified transaction id.
|
Response |
lookupParticipant(String txId,
String enlistmentId)
Get the participant url (registered during enlistParticipant) corresponding to a resource reference
if the coordinator crashes - the participant list will be empty but this is ok if commit hasn't been
called since the TM uses presumed abort semantics.
|
Response |
postParticipant(String enlistmentId) |
void |
removeTxState(int status,
Transaction tx,
Collection<String> enlistmentIds) |
Response |
replaceParticipant(String linkHeader,
String txId,
String enlistmentId)
PUT /recovery-coordinator/_RecCoordId_/_new participant URL_ -
overwrite the old participant URL with new participant URL
(as with JTS, this will also trigger off a recovery attempt on the associated transaction)
A participant may use this url to notifiy the coordinator that he has moved to a new location.
|
Response |
terminateTransaction(String txId,
String fault,
String content)
The client can control the outcome of the transaction by by PUTing to the terminator
URL returned as a response to the original transaction create request.
|
Response |
tt1(String txId) |
Response |
tt2(String txId) |
Response |
tt3(String txId) |
Response |
tt4(String txId) |
Response |
tt5(String txId) |
public Response getAllTransactions(UriInfo info)
info
- http context of the requestpublic org.jboss.jbossts.star.util.media.txstatusext.TransactionManagerElement getTransactionManagerInfo(UriInfo info)
info
- Request contextpublic org.jboss.jbossts.star.util.media.txstatusext.TransactionStatisticsElement getTransactionStatistics()
public Response getTransactionURIs(UriInfo info, String id)
info
- request contextid
- URL template parameter for the transaction idpublic Response getTransactionStatus(UriInfo info, String id)
info
- request contextid
- URL template parameter for the id of the transactionetc for the format of the returned content
public Response getTransactionExtStatus(UriInfo info, String id)
info
- Request contextid
- URL template parameter for the id of the transactionpublic Response deleteTransaction(String id)
id
- transaction idpublic Response tt1(String txId)
public Response tt2(String txId)
public Response tt3(String txId)
public Response tt4(String txId)
public Response tt5(String txId)
public Response beginTransaction(UriInfo info, HttpHeaders headers, String content)
info
- uri contextheaders
- http headerscontent
- empty if no transaction timeout is required otherwise the number of milliseconds
after which the transaction is eligible for being timed out. The content should have the format
TxSupport#TIMEOUT_PROPERTY millisecondsand @see TxLinkNames#PARTICIPANT
public Response terminateTransaction(String txId, String fault, String content)
txId
- URL template component containing the transaction identifierfault
- mechanism for injecting faults TODO use byteman insteadcontent
- body of the request indicating a commit or abort requestetc
public void removeTxState(int status, Transaction tx, Collection<String> enlistmentIds)
public Response enlistParticipant(String linkHeader, UriInfo info, String txId, String content)
linkHeader
- link headerinfo
- URI infotxId
- id of transactioncontent
- body of request containing URI for driving the participant through completion
(the URI should be unique within the scope of txId)public Response enlistVolatileParticipant(String linkHeader, UriInfo info, String txId)
linkHeader
- link headerinfo
- URI infotxId
- id of transactionpublic Response lookupParticipant(String txId, String enlistmentId)
txId
- transaction id that this recovery url belongs toenlistmentId
- the resource referencepublic Response replaceParticipant(String linkHeader, String txId, String enlistmentId)
linkHeader
- link header containing participant linkstxId
- transaction id that this recovery url belongs toenlistmentId
- id by the participant is knownpublic Response postParticipant(String enlistmentId)
public Response deleteParticipant(String enlistmentId)
enlistmentId
- The resource referenceCopyright © 2015 JBoss by Red Hat. All Rights Reserved.