public class TContext extends BaseContext implements Codable
You may chain transactions to build a sequence in which each transaction waits until the preceding transaction executes.
Requests submitted through TContext are handled by an intermediary called the "Job Manager." The Job Manager is a process that submits requests to the server on behalf of a client (there is a single Job Manager that handles the requests for all TContext objects running within the same process). If a request cannot be delivered because the network or server is down, the Job Manager automatically resubmits the request until it is successfully delivered to the server or the request's time-to-live (TTL) or retry parameters are exceeded. (Transactions are specified with a TTL, after which they expire. A retry-limit may also be specified, in which case the transaction expires after the specified number of retries are attempted or the TTL elapses, whichever comes first.)
The Job Manager handles service job invocations via background threads. It allocates threads from a pool, whose size you can configure via the watt.tx.jobThreads system property.
The Job Manager manages its transactions the job store. The job store is a directory in which the Job Manager maintains a record of its active transactions. A transaction record includes information such as status, input data, connection parameters, and so forth. Transaction records are XML-encoded so they can be easily viewed and understood by an administrator.
Transaction operation results are appended to a job log, which can be specified as a file name, an OutputStream, or a Writer if Unicode support is required.
Individual transactions are referenced by transaction ID (TID). A client must start a transaction and obtain a TID before it can invoke a service through the Job Manager.
With TContext, services can be invoked in two ways: using the invoke method or using the submitTx and retrieveTx methods. invoke is a synchronous method that blocks until the request's results are returned or the request expires. submit and retrieve are methods that allow a client to process requests asynchronously--first, you invoke the service with submitTx and then, at some later point, you pick up its results using retrieveTx.
After a client receives the results of a service, it must end the transaction to clear its transaction record from the job store. Failure to end transactions properly will cause "dead" records to accumulate in the job store, which can, over time, exhaust the storage device.
The following sample shows how you would code a TContext client to process a synchronous transaction:
Note: If you were writing a client to run as a service on a webMethods Integration Server, you WOULD NOT include the TContext.init and TContext.shutdown methods as shown in the following example. These functions are automatically performed by the server, and must not be included in your code.
TContext tc = null; //---Initialization---------------------------------------------------- // Initialize TContext and establish connection attributes try { TContext.init("./jobs", "./tx.log"); tc = new TContext(); tc.connect("localhost:5555", null, null); } catch (ServiceException e) { System.err.println("Error: "+e.getMessage()); System.exit(-1); } //---Transaction------------------------------------------------------- // Do work with TContext - get tid, call service, end tid try { String tid = tc.startTx(3); Values out = tc.invokeTx(tid, "wm.server", "ping", new Values()); System.out.println("out="+out.toString()); tc.endTx(tid); } catch (TXException e) { System.err.println("Job Failed: "+e.getMessage()); System.exit(-1); } catch (DeliveryException e) { System.err.println("JobMgr Disabled: "+e.getMessage()); System.exit(-1); } catch (AccessException e) { System.err.println("Access Denied: "+e.getMessage()); System.exit(-1); } catch (ServiceException e) { System.err.println("Error: "+e.getMessage()); System.exit(-1); } //---Shutdown---------------------------------------------------------- // Release connection and shutdown try { tc.disconnect(); TContext.shutdown(); } catch (ServiceException e) { System.err.println("Error: "+e.getMessage()); System.exit(-1); }
The following lists global properties that affect TContext objects and the Job Manager:
Property |
Description |
watt.tx.logfile | Log file name. |
watt.tx.jobdir | Directory for job store. |
watt.tx.sweepTime | Background thread processing interval in seconds. Default is 60 seconds. |
watt.tx.defaultTTLMins | Default TTL in minutes. Default is 30 minutes. |
watt.tx.retryBackOffTime | Backoff interval for job retries in seconds. Default is 60 seconds. |
watt.tx.jobThreads | Number of threads available to the Job Manager for processing jobs. Default is 5. |
BaseContext
,
Codable
Constructor and Description |
---|
TContext()
Constructs an unconnected TContext and defaults to the binary RPC transport.
|
Modifier and Type | Method and Description |
---|---|
void |
connect(java.lang.String server,
java.lang.String user,
java.lang.String pass)
Defines the connection parameters that the Job Manager will use to submit this TContext object's request to the webMethods Integration Server.
|
void |
disconnect()
Resets this TContext object's connection parameters and releases it from the Job Manager.
|
void |
dumpJobs()
Prints (to system out) the list of all transaction records in the local job store.
|
void |
endTx(java.lang.String tid)
Ends a transaction.
|
java.lang.String |
getChainedTxId(java.lang.String tid)
Returns the tid of the transaction to which the specified transaction is chained.
|
java.lang.String |
getRemoteTxId(java.lang.String tid)
Returns the remote tid (the tid by which a transaction is referenced on the server) for a specified transaction.
|
Values |
getTxData(java.lang.String tid)
Returns the input or output data for the specified transaction.
|
IData |
getTxIData(java.lang.String tid)
Returns the input or output data for the specified transaction as an IData object.
|
java.util.Enumeration |
getTxIds()
Enumerates the transactions in the job store by transaction ID.
|
java.lang.String |
getTxStatus(java.lang.String tid)
Returns the status of a specified transaction as a String.
|
int |
getTxStatusVal(java.lang.String tid)
Returns the status of a specified transaction as an int.
|
static void |
init()
Initializes the Job Manager using the values specified by the watt.tx.logfile and watt.tx.jobdir properties.
|
static void |
init(java.lang.String jobdir,
java.io.OutputStream logstream)
Initializes the Job Manager using the specified job store directory (if this value has not already been set with the watt.tx.jobdir property) and OutputStream for logging.
|
static void |
init(java.lang.String jobdir,
java.lang.String logfile)
Initializes the Job Manager using the specified job store directory and log file, if these values are not values already specified by the watt.tx.logfile and watt.tx.jobdir properties.
|
static void |
init(java.lang.String jobdir,
java.io.Writer logWriter)
Initializes the Job Manager using the specified job store directory (if this value has not already been set with the watt.tx.jobdir property) and Writer for logging.
|
IData |
invokeTx(java.lang.String tid,
java.lang.String ifc,
java.lang.String svc,
IData data)
Calls the specified service through the Job Manager and passes input to that service through an IData object.
|
Values |
invokeTx(java.lang.String tid,
java.lang.String ifc,
java.lang.String svc,
Values data)
Calls the specified service through the Job Manager and passes input to that service through a Values object.
|
static void |
resetJobMgr()
Restarts the Job Manager if it has become disabled.
|
static void |
resetJobMgr(java.lang.String jobdir,
java.lang.String logfile)
Restarts the Job Manager with the specified job store directory and log file.
|
static void |
resetJobMgr(java.lang.String jobdir,
java.lang.String logfile,
java.io.OutputStream logstream)
Restarts the Job Manager with the specified job store directory and OutputStream for logging.
|
static void |
resetJobMgr(java.lang.String jobdir,
java.lang.String logfile,
java.io.Writer logWriter)
Restarts the Job Manager with the specified job store directory and Writer for logging.
|
static void |
resetLogFile(java.lang.String logfile)
Closes the current job log and opens a new file.
|
static void |
resetLogStream(java.io.OutputStream logstream)
Resets the current log stream.
|
static void |
resetLogWriter(java.io.Writer logwriter)
Resets the current log writer.
|
void |
restartTx(java.lang.String tid)
Restarts a failed transaction.
|
IData |
retrieveIDTx(java.lang.String tid)
Gets the results of a service that was invoked with submitTx and returns the results in an IData object.
|
IData |
retrieveIDTx(java.lang.String tid,
boolean block)
Gets the results of a service that was invoked with submitTx and returns the results in an IData object (blocks or returns as specified if results are not available in the job store).
|
Values |
retrieveTx(java.lang.String tid)
Gets the results of a service that was invoked with submitTx and returns the results in a Values object.
|
Values |
retrieveTx(java.lang.String tid,
boolean block)
Gets the results of a service that was invoked with submitTx and returns the results in a Values object (blocks or returns as specified if results are not available in the job store).
|
void |
setSSLcertificates(java.lang.String privKey,
java.lang.String[] certs)
Specifies the certificates and keys that will be used to create an SSL connection.
|
static void |
shutdown()
Shuts down the Job Manager if there are no active processes using it.
|
static void |
shutdown(boolean force)
Shuts down the Job Manager using the specified shut-down behavior.
|
java.lang.String |
startTx()
Starts a new transaction with the default time-to-live (TTL) and unlimited retries.
|
java.lang.String |
startTx(long ttl)
Starts a new transaction with the specified time-to-live (TTL) value and no retry limit.
|
java.lang.String |
startTx(long ttl,
int retries)
Starts a new transaction with the specified time-to-live (TTL) and retry values.
|
java.lang.String |
startTx(java.lang.String followTid)
Starts a new transaction that is chained to (i.e., dependent on the completion of) a specified transaction in the job store.
|
java.lang.String |
startTx(java.lang.String followTid,
long ttl)
Starts a new transaction that is chained to (i.e., dependent on the completion of) a specified transaction in the job store, using the specified time-to-live (TTL) value.
|
java.lang.String |
startTx(java.lang.String followTid,
long ttl,
int retries)
Starts a new transaction that is chained to (i.e., dependent on the completion of) a specified transaction in the job store, using the specified time-to-live (TTL) and retry values.
|
void |
submitTx(java.lang.String tid,
java.lang.String ifc,
java.lang.String svc,
IData data)
Calls the specified service through the Job Manager and passes input to that service through an IData object.
|
void |
submitTx(java.lang.String tid,
java.lang.String ifc,
java.lang.String svc,
Values data)
Calls the specified service through the Job Manager and passes input to that service through a Values object.
|
getSSLSupport, isClusteredEnv, isConnected, isSecure, isUseJSSE, setAllowRedir, setAuthentication, setFixedUri, setProxy, setRetryServer, setSecure, setSecureProxy, setSSLCertificates, setSSLCertificates, setSSLCertificates, setUseJSSE
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getValue, getValueKeys, setValue
public TContext()
public static void init() throws ServiceException
Note: If your TContext will run as a Java service on a webMethods Integration Server, you do not need to call this method. The server itself will initialize the Job Manager at the appropriate times (for example, when the server is started). This is not something that your service needs to do.
ServiceException
- If the Job Manager cannot be initialized.public static void init(java.lang.String jobdir, java.lang.String logfile) throws ServiceException
Note: If your TContext will run as a Java service on a webMethods Integration Server, you do not need to call this method. The server itself will initialize the Job Manager at the appropriate times (for example, when the server is started). This is not something that your service needs to do.
jobdir
- A String specifying the directory in which you want the Job Manager to maintain its job store.logfile
- A String specifying the name of the file in which you want the Job Manager to log guaranteed-delivery transactions.ServiceException
- If the Job Manager cannot be initialized.public static void init(java.lang.String jobdir, java.io.Writer logWriter) throws ServiceException
Note: If your TContext will run as a Java service on a webMethods Integration Server, you do not need to call this method. The server itself will initialize the Job Manager at the appropriate times (for example, when the server is started). This is not something that your service needs to do.
jobdir
- A String specifying the directory in which you want the Job Manager to maintain its job store.logWriter
- The Writer in which you want the Job Manager to log guaranteed-delivery transactions.ServiceException
- If the Job Manager cannot be initialized.public static void init(java.lang.String jobdir, java.io.OutputStream logstream) throws ServiceException
Note: If your TContext will run as a Java service on a webMethods Integration Server, you do not need to call this method. The server itself will initialize the Job Manager at the appropriate times (for example, when the server is started). This is not something that your service needs to do.
jobdir
- A String specifying the directory in which you want the Job Manager to maintain its job store.logstream
- The OutputStream in which you want the Job Manager to log guaranteed-delivery transactions.ServiceException
- If the Job Manager cannot be initialized.public static void shutdown()
Note: If your TContext will run as a Java service on a webMethods Integration Server, you must not call this method. The server itself takes care of shutting down the Job Manager at the appropriate times (for example, when the server is shut down). This is not something that your service should do.
shutdown(boolean)
public static void shutdown(boolean force)
Note: If your TContext will run as a Java service on a webMethods Integration Server, you must not call this method. The server itself takes care of shutting down the Job Manager at the appropriate times (for example, when the server is shut down). This is not something that your service should do.
force
- A boolean specifying whether you want the Job Manager to shut down if instances of TContext are still running against it.
Set force to
|
To
|
true | Shut down even if instances of TContext are still registered with the Job Manager. |
false | Do not shut down if instances of TContext are currently using the Job Manager. Same as shutdown(). |
shutdown()
public static void resetJobMgr() throws ServiceException
This method is not used by ordinary TContext clients. It is provided as a way to restart a Job Manager that has become disabled. You can use this method to restart the Job Manager after correcting the error that caused it to become disabled.
ServiceException
- If the Job Manager cannot be restarted or because it is already enabled.public static void resetJobMgr(java.lang.String jobdir, java.lang.String logfile) throws ServiceException
This method is not used by ordinary TContext clients. It is provided as a way to restart a Job Manager that has become disabled due to some type of failure. You can use this method to restart the Job Manager after correcting the error that caused it to become disabled.
jobdir
- A String specifying the directory in which the job store is maintained.logfile
- A String specifying the name of the file in which the Job Manager's log is maintained.ServiceException
- If the Job Manager cannot be restarted or because it is already enabled.public static void resetJobMgr(java.lang.String jobdir, java.lang.String logfile, java.io.OutputStream logstream) throws ServiceException
This method is not used by ordinary TContext clients. It is provided as a way to restart a Job Manager that has become disabled due to some type of failure. You can use this method to restart the Job Manager after correcting the error that caused it to become disabled.
jobdir
- A String specifying the directory in which the job store is maintained.logfile
- This parameter is not used and must be set to null.logstream
- The OutputStream in which the Job Manager logs guaranteed-delivery transactions.ServiceException
- If the Job Manager cannot be restarted or because it is already enabled.public static void resetJobMgr(java.lang.String jobdir, java.lang.String logfile, java.io.Writer logWriter) throws ServiceException
This method is not used by ordinary TContext clients. It is provided as a way to restart a Job Manager that has become disabled due to some type of failure. You can use this method to restart the Job Manager after correcting the error that caused it to become disabled.
jobdir
- A String specifying the directory in which the job store is maintained.logfile
- This parameter is not used and must be set to null.logWriter
- The Writer in which the Job Manager logs guaranteed-delivery transactions.ServiceException
- If the Job Manager cannot be restarted or because it is already enabled.public static void resetLogFile(java.lang.String logfile) throws ServiceException
logfile
- a String specifying the location of the new job log file.ServiceException
- If the job log cannot be reset.public static void resetLogStream(java.io.OutputStream logstream) throws ServiceException
logstream
- The OutputStream that will hold the new job log.ServiceException
- If the job log cannot be reset.public static void resetLogWriter(java.io.Writer logwriter) throws ServiceException
logwriter
- Output writer for transaction log (in lieu of filename.ServiceException
- If the job log cannot be reset.public void connect(java.lang.String server, java.lang.String user, java.lang.String pass) throws ServiceException
server
- A String specifying the server's address in the form hostname:portNumber.user
- A String specifying the user name that is to be used to connect to the Integration Server.pass
- A String specifying the password that is to be used to connect to the Integration Server.ServiceException
- If the server name is invalid (for example, null), this TContext object is already connected to a server, or the Job Manager is not initialized.disconnect()
public void disconnect()
public java.lang.String startTx() throws ServiceException
ServiceException
- If the transaction cannot be started (for example, if the Job Manager has been disabled).startTx(long)
,
startTx(long, int)
,
invokeTx(java.lang.String, java.lang.String, java.lang.String, com.wm.data.IData)
,
submitTx(java.lang.String, java.lang.String, java.lang.String, com.wm.data.IData)
,
retrieveTx(java.lang.String)
public java.lang.String startTx(long ttl) throws ServiceException
ttl
- A long that specifies this transaction's TTL in minutes. If you specify 0 in ttl, the default TTL is used.ServiceException
- If the transaction cannot be started (for example, if the Job Manager has been disabled).startTx(long)
,
startTx(long, int)
,
invokeTx(java.lang.String, java.lang.String, java.lang.String, com.wm.data.IData)
,
submitTx(java.lang.String, java.lang.String, java.lang.String, com.wm.data.IData)
,
retrieveTx(java.lang.String)
public java.lang.String startTx(long ttl, int retries) throws ServiceException
ttl
- A long that specifies this transaction's TTL in minutes. If you set ttl to 0, the default TTL is used.retries
- An int specifying this transaction's maximum retry limit.ServiceException
- If the transaction cannot be started (for example, if the Job Manager has been disabled).startTx()
,
startTx(long)
,
invokeTx(java.lang.String, java.lang.String, java.lang.String, com.wm.data.IData)
,
submitTx(java.lang.String, java.lang.String, java.lang.String, com.wm.data.IData)
,
retrieveTx(java.lang.String)
public java.lang.String startTx(java.lang.String followTid) throws ServiceException
followTid
- A String specifying the tid upon whose completion this transaction is dependent.ServiceException
- If the transaction cannot be started (for example, if the Job Manager has been disabled) or the transaction specified in followTid does not exist.startTx()
,
startTx(long)
,
invokeTx(java.lang.String, java.lang.String, java.lang.String, com.wm.data.IData)
,
submitTx(java.lang.String, java.lang.String, java.lang.String, com.wm.data.IData)
,
retrieveTx(java.lang.String)
public java.lang.String startTx(java.lang.String followTid, long ttl) throws ServiceException
followTid
- A String specifying the tid upon whose completion this transaction is dependent.ttl
- A long that specifies this transaction's TTL in minutes. If you specify 0 in ttl, the default TTL is used.ServiceException
- If the transaction cannot be started (for example, if the Job Manager has been disabled) or the transaction specified in followTid does not exist.startTx(long)
,
startTx(String)
,
invokeTx(java.lang.String, java.lang.String, java.lang.String, com.wm.data.IData)
,
submitTx(java.lang.String, java.lang.String, java.lang.String, com.wm.data.IData)
,
retrieveTx(java.lang.String)
public java.lang.String startTx(java.lang.String followTid, long ttl, int retries) throws ServiceException
followTid
- A String specifying the tid upon whose completion this transaction is dependent.ttl
- A long that specifies this transaction's TTL in minutes. If you specify 0 in ttl, the default TTL is used.retries
- An int specifying this transaction's maximum retry limit.ServiceException
- If the transaction cannot be started (for example, if the Job Manager has been disabled) or the transaction specified in followTid does not exist.startTx(String)
,
startTx(String, long)
,
invokeTx(java.lang.String, java.lang.String, java.lang.String, com.wm.data.IData)
,
submitTx(java.lang.String, java.lang.String, java.lang.String, com.wm.data.IData)
,
retrieveTx(java.lang.String)
public IData invokeTx(java.lang.String tid, java.lang.String ifc, java.lang.String svc, IData data) throws ServiceException
When you invoke a service using this method, the request is processed synchronously--that is, the client blocks until the results of the service are returned. If you want to process the service request asynchronously, use the submitTx and retrieveTx methods instead.
Note: You must establish a connection and start a transaction before calling this method.
tid
- A String specifying the transaction under which this request is being submitted. (This is the tid you received when you started the transaction with startTx.)ifc
- A String specifying the name of the folder in which the requested service resides.svc
- A String specifying the name of the service.data
- An IData object containing the input data for the service.ServiceException
- If the Job Manager is not initialized or the transaction fails.connect(String, String, String)
,
startTx(String)
,
submitTx(java.lang.String, java.lang.String, java.lang.String, com.wm.data.IData)
,
retrieveTx(java.lang.String)
public Values invokeTx(java.lang.String tid, java.lang.String ifc, java.lang.String svc, Values data) throws ServiceException
When you invoke a service using this method, the request is processed synchronously--that is, the client blocks until the results of the service are returned. If you want to process the service request asynchronously, use the submitTx and retrieveTx methods instead.
Note: You must establish a connection and start a transaction before calling this method.
tid
- A String specifying the transaction under which this request is being submitted. (This is the tid you received when you started the transaction with startTx.)ifc
- A String specifying the name of the folder in which the requested service resides.svc
- A String specifying the name of the service.data
- A Values object containing the input data for the service.ServiceException
- If the Job Manager is not initialized or the transaction fails.invokeTx(String, String, String, IData)
,
connect(String, String, String)
,
startTx(String)
,
submitTx(java.lang.String, java.lang.String, java.lang.String, com.wm.data.IData)
,
retrieveTx(String)
,
retrieveIDTx(String)
public void submitTx(java.lang.String tid, java.lang.String ifc, java.lang.String svc, IData data) throws ServiceException
Note: You must establish a connection and start a transaction before calling this method.
tid
- A String specifying the transaction under which this request is being submitted. (This is the tid you received when you started the transaction with startTx.)ifc
- A String specifying the name of the folder in which the requested service resides.svc
- A String specifying the name of the service.data
- An IData object containing the input data for the service.ServiceException
- If the request is not accepted by the Job Manager (for example, a hardware problem occurs while accessing the job store or the Job Manager is disabled).submitTx(String, String, String, Values)
,
retrieveTx(String)
,
retrieveIDTx(String)
,
connect(String, String, String)
,
startTx(String)
,
invokeTx(java.lang.String, java.lang.String, java.lang.String, com.wm.data.IData)
public void submitTx(java.lang.String tid, java.lang.String ifc, java.lang.String svc, Values data) throws ServiceException
tid
- A String specifying the transaction under which this request is being submitted. (This is the tid you received when you started the transaction with startTx.)ifc
- A String specifying the name of the folder in which the requested service resides.svc
- A String specifying the name of the service.data
- A Values object containing the input data for the service.ServiceException
- If the request is not accepted by the Job Manager (for example, a hardware problem occurs while accessing the job store or the Job Manager is disabled).submitTx(String, String, String, IData)
,
retrieveTx(String)
,
retrieveIDTx(String)
,
connect(String, String, String)
,
startTx(String)
,
invokeTx(java.lang.String, java.lang.String, java.lang.String, com.wm.data.IData)
public Values retrieveTx(java.lang.String tid) throws ServiceException
tid
- A String specifying the transaction whose results you want to obtain.ServiceException
- If the transaction fails, the Job Manager is disabled, or the invoked service returned an exception.public IData retrieveIDTx(java.lang.String tid) throws ServiceException
tid
- A String specifying the transaction whose results you want to obtain.ServiceException
- If the transaction fails, the Job Manager is disabled, or the invoked service returned an exception.public Values retrieveTx(java.lang.String tid, boolean block) throws ServiceException
tid
- A String specifying the transaction whose results you want to obtain.block
- A boolean indicating whether you want the method to block or return immediately if the results are not yet available.
Set block to
|
To
|
true | Block processing until the results are available. When you use this option, the client does not continue until the results are returned. |
false | Return if the results are not available. |
ServiceException
- If the transaction fails, the Job Manager is disabled, or the invoked service returns an exception.public IData retrieveIDTx(java.lang.String tid, boolean block) throws ServiceException
tid
- A String specifying the transaction whose results you want to obtain.block
- A boolean indicating whether you want the method to block or return immediately if the results are not yet available.
Set block to
|
To
|
true | Block processing until the results are available. When you use this option, the client does not continue until the results are returned. |
false | Resume processing even if the results are not available. |
ServiceException
- If the transaction fails, the Job Manager is disabled, or the invoked service returns an exception.public void endTx(java.lang.String tid) throws ServiceException
tid
- A String specifying the transaction that you want to end.ServiceException
- If the specified transaction cannot be ended (for example, the Job Manager is disabled).public void restartTx(java.lang.String tid) throws ServiceException
tid
- A String specifying the transaction that you want to restart.ServiceException
- If the transaction cannot be restarted (for example, if the tid is invalid).public java.util.Enumeration getTxIds() throws ServiceException
ServiceException
- If the transactions cannot be enumerated (for example, if the Job Manager is disabled).public java.lang.String getTxStatus(java.lang.String tid) throws ServiceException
tid
- A String specifying the transaction whose status you want returned.Returns
|
If
|
NEW | The transaction has just been started, but no request has been submitted to it yet. (i.e., the client has been given a tid, but has not issued an invoke or a submit.) |
PENDING | The transaction is waiting to be processed by a webMethods Integration Server (i.e., the client has issued an invoke or a submit against the transaction, but the results from the request have not yet been received.) |
DONE | The transaction has been processed by a webMethods Integration Server and its results are in the job store. |
FAILED | The transaction failed as a result of a heuristic failure or exceeding the TTL or the retry limit. |
UNKNOWN | The transaction does not exist in the job store |
ServiceException
- If status cannot be obtained (for example, if the Job Manager is disabled).getTxStatusVal(String)
public int getTxStatusVal(java.lang.String tid) throws ServiceException
tid
- A String specifying the transaction whose status you want returned.Returns
|
If
|
TXJob.NEW | The transaction has just been started, but no request has been submitted to it yet. (i.e., the client has been given a tid, but has not issued an invoke or a submit.) |
TXJob.PENDING | The transaction is waiting to be processed by a webMethods Integration Server (i.e., the client has issued an invoke or a submit against the transaction, but the results from the request have not yet been received.) |
TXJob.DONE | The transaction has been processed by a webMethods Integration Server and its results are in the job store. |
TXJob.FAILED | The transaction failed as a result of a heuristic failure or exceeding the TTL or the retry limit. |
TXJob.UNKNOWN | The transaction does not exist in the job store |
ServiceException
- If status cannot be obtained (for example, if the Job Manager is disabled).getTxStatus(String)
public IData getTxIData(java.lang.String tid) throws ServiceException
tid
- A String specifying the transaction whose data you want to obtain.ServiceException
- If the data cannot be obtained (for example, the specified tid does not exist or the Job Manager is disabled).public Values getTxData(java.lang.String tid) throws ServiceException
tid
- A String specifying the transaction whose data you want to obtain.ServiceException
- If the data cannot be obtained (for example, the specified tid does not exist or the Job Manager is disabled).public java.lang.String getRemoteTxId(java.lang.String tid) throws ServiceException
The remote tid is not used by ordinary TContext clients. However, you might use this method if you were building an application for a webMethods administrator who needed to be able to trace a client-side transaction back to a particular record in the Integration Server's job store.
tid
- A String specifying the tid of the transaction whose remote tid you want to obtain.ServiceException
- If the remote tid cannot be obtained (for example, the specified tid does not exist or the Job Manager is disabled).public java.lang.String getChainedTxId(java.lang.String tid) throws ServiceException
tid
- A String specifying the tid of the transaction that you want to check.ServiceException
- If the tid cannot be obtained (for example, the specified tid does not exist or the Job Manager is disabled).public void dumpJobs() throws ServiceException
ServiceException
- If the list cannot be produced.public void setSSLcertificates(java.lang.String privKey, java.lang.String[] certs)
privKey
- A String specifying the location of the private key that corresponds to the public key in your certificate.certs
- A String [] specifying the locations of all the certificates in your certificate chain. Your certificate must appear as the first element in this array. For example if you own a certificate that has been signed by XYZ' Authority which in turn was signed by Verisign's Authority, your certificate chain is comprised of three certificates: your certificate, XYZ's certificate, and Verisign's certificate. In certs, these must appear in the following order: