public class BrokerTransactionalClient extends BrokerClient
Modifier and Type | Field and Description |
---|---|
static int |
BEGIN_NEW_TRANSACTION |
static int |
JOIN_EXISTING_TRANSACTION |
static int |
TRANSACTION_END_ABORT |
static int |
TRANSACTION_END_COMMIT |
protected static int |
TX_STATE_ABORTED |
protected static int |
TX_STATE_COMMITTED |
protected static int |
TX_STATE_END |
protected static int |
TX_STATE_OPEN |
protected static int |
TX_STATE_SUSPENDED |
protected java.util.Map |
txIdMap |
ACK_AUTOMATIC, ACK_NONE, ACK_SELECTIVE, ACK_THROUGH, browser_open, CONNECT_STATE_CONNECTED, CONNECT_STATE_DISCONNECTED, CONNECT_STATE_RECONNECTED, CURRENT_API_VERSION, DEFAULT_TIMEOUT, DO_NOT_ACK, event_req_id, NO_SHARE_LIMIT, RECEIVE_SYNCHRONOUS, REPLY_FLAG_CONTINUE, REPLY_FLAG_END, REPLY_FLAG_START, REPLY_FLAG_START_AND_END, SYNCHRONOUS, TIME_INFINITE, TRANSACTION_LEVEL_ANY, TRANSACTION_LEVEL_BASIC, TRANSACTION_LEVEL_CONVERSATIONAL, TRANSACTION_LEVEL_PSEUDO, TRANSACTION_MODE_COMMIT, TRANSACTION_MODE_ROLLBACK, TRANSACTION_MODE_SAVEPOINT, VERSION_105, VERSION_31, VERSION_40, VERSION_50, VERSION_60, VERSION_61, VERSION_62, VERSION_63, VERSION_64, VERSION_65, VERSION_66, VERSION_71, VERSION_80, VERSION_82, VERSION_90
Modifier | Constructor and Description |
---|---|
protected |
BrokerTransactionalClient(java.lang.String broker_host,
java.lang.String broker_name,
java.lang.String client_id,
BrokerConnectionDescriptor desc)
Protected reconnect constructor.
|
|
BrokerTransactionalClient(java.lang.String broker_host,
java.lang.String broker_name,
java.lang.String client_id,
java.lang.String client_group,
java.lang.String app_name,
BrokerConnectionDescriptor desc)
Creates a broker client that is transactional.
|
Modifier and Type | Method and Description |
---|---|
void |
abort()
aborts the open transaction on this client, discarding all work previously performed, and invalidates Rollback the transaction the context.
|
void |
abort(long tx_id)
aborts the open transaction on this client, discarding all work previously performed, and invalidates Rollback the transaction the context.
|
void |
abort(java.lang.String external_id)
aborts all the transactions with the given external id, discarding all work previously performed Rollback the transaction the context.
|
void |
abort(java.lang.String[] external_ids)
Aborts the transaction(s) which has/have the specified external_id.
|
static void |
abortAll(BrokerTransactionalClient[] tx_clients)
aborts the given list of open transactions, discarding all work previously performed, and invalidates the context.
|
static void |
abortAll(BrokerTransactionalClient[] tx_clients,
java.lang.String external_id)
aborts all the transactions known to this broker with the given external_id Discarding all work previously performed, This method is used in distributed
transactions.
|
void |
acknowledge(long seqn)
Acknowledge the single event specified.
|
void |
acknowledge(long[] seqns)
Acknowledge the array of events with the given seqn numbers.
|
void |
acknowledgeThrough(long seqn)
Acknowledges all events through the event specified.
|
long |
beginTransaction(java.lang.String external_id)
Starts a transaction.
|
long |
beginTransaction(java.lang.String external_id,
int flag,
int timeout)
Starts a transaction.
|
void |
cancelCallbackForSubId(int sub_id)
Cancel the client's specific callback for a subscription id.
|
void |
cancelCallbackForTag(int tag)
Cancel the client's specific callback for a tag value.
|
void |
cancelCallbacks()
Cancel all callbacks for the client.
|
void |
cancelGetEvents() |
void |
commit()
commits the open transaction.
|
void |
commit(long tx_id)
commits the open transaction.
|
void |
commit(java.lang.String external_id)
commits the open transaction(s) which has/have the specified external_id.
|
void |
commit(java.lang.String[] external_ids)
commits the open transaction(s) which has/have the specified external_id.
|
static void |
commitAll(BrokerTransactionalClient[] tx_clients)
commits the given list of open transaction.
|
static void |
commitAll(BrokerTransactionalClient[] tx_clients,
java.lang.String external_id)
commits all the open transaction with the given external_id.
|
void |
deliver(java.lang.String dest_id,
BrokerEvent event)
Deliver one event in the given transaction.
|
void |
deliver(java.lang.String dest_id,
BrokerEvent[] events)
Deliver multiple events on the given transaction.
|
void |
deliverAckReplyEvent(BrokerEvent request_event,
long publish_seqn)
Delivers an Adapter::ack event to the originator of the specified event, which is most likely a request event for given transaction.
|
void |
deliverErrorReplyEvent(BrokerEvent request_event,
BrokerEvent error_event)
Give a single error event to the broker to all be delivered to the client that published the 'request_event' for given transaction.
|
void |
deliverNullReplyEvent(BrokerEvent request_event,
java.lang.String reply_event_type_name,
long publish_seqn)
Delivers a null event of type 'reply_event_type_name' to the originator of the specified event, which is most likely a request event for given
transaction.
|
int |
deliverPartialReplyEvents(BrokerEvent request_event,
BrokerEvent[] events,
int flag,
int token)
Give multiple events to the broker to all be delivered to the client that published the 'request_event' for the given transaction.
|
void |
deliverReplyEvent(BrokerEvent request_event,
BrokerEvent event)
Give a single event to the broker to all be delivered to the client that published the 'request_event' for the given transaction.
|
void |
deliverReplyEvents(BrokerEvent request_event,
BrokerEvent[] events)
Give multiple events to the broker to all be delivered to the client that published the 'request_event' for given transaction.
|
BrokerEvent[] |
deliverRequestAndWait(java.lang.String dest_id,
BrokerEvent event,
int msecs)
Deliver one request event and wait for replies.
|
void |
deliverWithAck(java.lang.String dest_id,
BrokerEvent[] events,
int ack_type,
long[] ack_seqn)
Deliver multiple events on the given transaction.
|
static void |
dispatch(int msecs) |
static void |
endAll(BrokerTransactionalClient[] tx_clients,
int end_state) |
static void |
endAll(BrokerTransactionalClient[] tx_clients,
java.lang.String externalId,
int end_state)
Ends the given list of current transactions.
|
void |
endTransaction(long tx_id,
int end_state) |
void |
endTransaction(java.lang.String external_id,
int end_state)
Ends the current transaction.
|
void |
forget(long tx_id)
Forget the specified heuristically completed transaction.
|
void |
forget(java.lang.String external_id)
Forget the specified heuristically completed transaction.
|
static void |
forgetAll(BrokerTransactionalClient[] tx_clients,
java.lang.String external_id)
Forget the transaction with the specified external_id in the given list of transactional clients.
|
static void |
forgetAll(BrokerTransactionalClient tx_client,
java.lang.String[] external_ids)
Forget the transaction with the specified external_id in the given list of transactional clients.
|
BrokerEvent |
getEvent(int msecs)
Gets a single event from this client's queue, that is part of the given open transaction context.
|
BrokerEvent[] |
getEvents(int max_events,
int msecs)
Gets one or more events from this client's queue, that is a part of the the give open transaction context.
|
BrokerEvent[] |
getEvents(int max_events,
long seqn,
int msecs)
This request gets processed only after the BrokerTransactionalClient is is committed.
|
java.lang.String |
getExternalId()
Used by the application or an external manager to identify the context.
|
long |
getId()
used by the broker to identify the context.
|
long |
getId(java.lang.String external_id) |
COM.activesw.api.client.BrokerJMSEvent[] |
getJMSEvents(int max_events,
long seqn,
int msecs)
This request gets processed only after the BrokerTransactionalClient is is committed.
|
int |
getTransactionTimeout() |
COM.activesw.api.client.BrokerXAResource |
getXAResource() |
static void |
interruptDispatch() |
void |
interruptGetEvents()
Interrupt the current getEvents() call for the client.
|
void |
jmsClientPublish(COM.activesw.api.client.BrokerJMSEvent[] events,
boolean async)
Publish multiple events on the given transaction.
|
static void |
mainLoop() |
void |
negativeAcknowledge(long seqn)
Negatively acknowledge the single event specified.
|
void |
negativeAcknowledge(long[] seqns)
Negative acknowledge the array of events with the given seqn numbers.
|
static BrokerClient |
newOrReconnect(java.lang.String broker_host,
java.lang.String broker_name,
java.lang.String client_id,
java.lang.String client_group,
java.lang.String app_name,
BrokerConnectionDescriptor desc)
Attempts to create the broker client.If the creation fails because the client already exists, then it reconnects to the client instead.
|
static BrokerTransactionalClient |
newOrReconnectTransactionalClient(java.lang.String broker_host,
java.lang.String broker_name,
java.lang.String client_id,
java.lang.String client_group,
java.lang.String app_name,
BrokerConnectionDescriptor desc)
Attempts to create the transactional client.
|
int |
prepare(long tx_id)
Prepares the transactions with the specified broker transaction id for commit.
|
int |
prepare(java.lang.String external_id)
Prepares the transactions with the specified external_id for commit.
|
static void |
prepareAll(BrokerTransactionalClient[] tx_clients,
java.lang.String external_id)
Prepare the specified transaction for commit.
|
static void |
prepareAll(BrokerTransactionalClient tx_client,
java.lang.String[] external_ids)
Prepare the specified list of transactions for commit.
|
void |
prime(int num)
Tell the client to send a request for events but not block.
|
void |
primeWithAck(int num) |
void |
publish(BrokerEvent event)
Publish one event with the given transaction id.
|
void |
publish(COM.activesw.api.client.BrokerJMSEvent event)
Publish one event with the given transaction id.
|
BrokerEvent[] |
publishRequestAndWait(BrokerEvent event,
int msecs)
Publish one request event to the broker and wait for replies.
|
void |
publishWithAck(BrokerEvent[] events,
int ack_type,
long[] ack_seqn)
Publish multiple events for the given transaction.
|
static BrokerClient |
reconnect(java.lang.String broker_host,
java.lang.String broker_name,
java.lang.String client_id,
BrokerConnectionDescriptor desc)
Reconnects a client.
|
static BrokerTransactionalClient |
reconnectTransactionalClient(java.lang.String broker_host,
java.lang.String broker_name,
java.lang.String client_id,
BrokerConnectionDescriptor desc)
Reconnects a transactional client.
|
java.lang.String[] |
recover(int flags)
Get the list of user defined, externally generated transaction identifiers that the client has prepared transactions for.
|
void |
registerCallback(BrokerCallback obj,
java.lang.Object client_data)
Register a general callback for events received by this client.
|
void |
registerCallbackForSubId(int sub_id,
BrokerCallback obj,
java.lang.Object client_data)
Register a specific callback for events received by this client which matched a given subscription ID.
|
void |
registerCallbackForTag(int tag,
boolean cancel_when_done,
BrokerCallback obj,
java.lang.Object client_data)
Register a specific callback for events received by this client which have the _env.tag field set to the specified value.
|
void |
resume(long tx_id)
Resume a suspended transaction.
|
void |
resume(java.lang.String external_id)
Resume a suspended transaction.
|
static void |
resumeAll(BrokerTransactionalClient[] tx_clients,
java.lang.String external_id)
Resume the given list of suspended transactions.
|
protected void |
setId(long tx_id)
used by the broker to identify the context.
|
void |
setTransactionId(long tx_id,
java.lang.String external_id)
Associates a Broker transaction with an external identifier.
|
void |
setTransactionId(java.lang.String external_id)
Associates the current Broker transaction with an external identifier.
|
void |
setTransactionTimeout(int seconds) |
protected void |
setXAResource(COM.activesw.api.client.BrokerXAResource bXAResource) |
static void |
stopMainLoop() |
void |
suspend(long tx_id)
Suspend the transaction with the given external_id.
|
void |
suspend(java.lang.String external_id)
Suspend the transaction with the given external_id.
|
static void |
suspendAll(BrokerTransactionalClient[] tx_clients,
java.lang.String external_id)
Suspend the given list of current transactions.
|
static void |
threadedCallbacks(boolean enabled) |
acknowledge, acknowledge, acknowledgeThrough, beginAdapterTransaction, browseEvents, cancelCheckForEvents, cancelSubscription, cancelSubscription, cancelSubscriptions, canPublish, canSubscribe, checkForEvents, clearQueue, createClientQueueBrowser, deliver, deliver, deliverAckReplyEvent, deliverErrorReplyEvent, deliverNullReplyEvent, deliverPartialReplyEvents, deliverReplyEvent, deliverReplyEvents, deliverWithAck, destroy, disconnect, doesSubscriptionExist, endAdapterTransaction, endExt, endTr, endTx, finalize, forgetExt, forgetTx, getAccessLabel, getApiVersionNumber, getApplicationName, getAsyncExceptionListener, getBrokerHost, getBrokerName, getBrokerPort, getBrokerSSLCertificate, getBrokerVersionNumber, getBrokerVersionString, getCanPublishNames, getCanPublishTypeDefs, getCanSubscribeNames, getCanSubscribeTypeDefs, getClientGroup, getClientId, getClientInfo, getClientInfoset, getClientSSLEncryptionLevel, getConnectionDescriptor, getDefaultBrokerPort, getDefaultTimeout, getEvent, getEventLogging, getEvents, getEvents, getEventTypeDef, getEventTypeDefs, getEventTypeInfoset, getEventTypeInfosetNames, getEventTypeInfosets, getEventTypeNames, getEventTypeNames, getJMSClientInfoset, getJMSEvents, getLastPublishSequenceNumber, getLogAcknowledgeNames, getLogPublishNames, getPlatformInfo, getPlatformInfoKeys, getQueueLength, getScopeNames, getServerFilterCollationLocale, getSess, getSessionFilters, getStateShareLimit, getSubscriptions, getTerritoryName, getTxTimeout, incrementRedeliveryCount, interruptCheckForEvents, isClientPending, isConnected, isPending, jmsClientPublish, makeSubId, makeTag, makeTransactionId, makeUniqueSubId, negativeAcknowledgeInternal, newSubscription, newSubscription, newSubscription, newSubscriptions, newTx, ping, ping, poll, prepareExt, prepareTx, prime, prime, primeAllClients, primeAllClients, primeWithAck, publish, publish, publish, publishWithAck, recoverTx, registerConnectionCallback, resendUnacknowledgedEvents, resetSessionFilters, setAsyncExceptionListener, setAutomaticControlLabel, setClientInfoset, setDefaultClientTimeout, setPlatformInfo, setSessionFilter, setSessionFilters, setStateShareLimit, setTxId, setTxTimeout, toString
public static final int BEGIN_NEW_TRANSACTION
public static final int JOIN_EXISTING_TRANSACTION
public static final int TRANSACTION_END_COMMIT
public static final int TRANSACTION_END_ABORT
protected static final int TX_STATE_OPEN
protected static final int TX_STATE_END
protected static final int TX_STATE_COMMITTED
protected static final int TX_STATE_ABORTED
protected static final int TX_STATE_SUSPENDED
protected java.util.Map txIdMap
public BrokerTransactionalClient(java.lang.String broker_host, java.lang.String broker_name, java.lang.String client_id, java.lang.String client_group, java.lang.String app_name, BrokerConnectionDescriptor desc) throws BrokerException
BrokerClientExistsException
- If a client using the specified client ID already exists.BrokerCommFailureException
- If problems occur establishing the connection.BrokerHostNotFoundException
- If the specified host does not exist.BrokerInvalidClientIdException
- If the ID contains illegal characters.BrokerInvalidNameException
- If the app_name contains illegal characters.BrokerNoPermissionException
- If permission to join the specified client group is denied.BrokerNotRunningException
- If the host exists but no broker is running on that host.BrokerNullParameterException
- If broker_host, client_group, or app_name are null.BrokerSecurityException
- If a secure connection is attempted but is rejected by the broker.BrokerUnknownBrokerNameException
- If the specified broker does not exist. If broker_name is null, this indicates that there is no default broker.BrokerUnknownClientGroupException
- If the specified client group does not exist on the broker.BrokerException
protected BrokerTransactionalClient(java.lang.String broker_host, java.lang.String broker_name, java.lang.String client_id, BrokerConnectionDescriptor desc) throws BrokerException
BrokerException
public static BrokerTransactionalClient reconnectTransactionalClient(java.lang.String broker_host, java.lang.String broker_name, java.lang.String client_id, BrokerConnectionDescriptor desc) throws BrokerException
BrokerClientContentionException
- If the client ID is already in use by another client. For shared state clients, this means the maximum number of reconnects has been
exceeded.BrokerCommFailureException
- If problems occur establishing the connection.BrokerHostNotFoundException
- If the specified host does not exist.BrokerNoPermissionException
- If permission to join the specified client group is denied.BrokerNotRunningException
- If the host exists but no broker is running on that host.BrokerNullParameterException
- If broker_host or client_id are null.BrokerSecurityException
- If a secure connection is attempted but is rejected by the broker.BrokerUnknownBrokerNameException
- If the specified broker does not exist. If broker_name is null, this indicates that there is no default broker.BrokerUnknownClientIdException
- If the specified client ID does not exist on the broker.BrokerException
public static BrokerClient reconnect(java.lang.String broker_host, java.lang.String broker_name, java.lang.String client_id, BrokerConnectionDescriptor desc) throws BrokerException
BrokerClientContentionException
- If the client ID is already in use by another client. For shared state clients, this means the maximum number of reconnects has been
exceeded.BrokerCommFailureException
- If problems occur establishing the connection.BrokerHostNotFoundException
- If the specified host does not exist.BrokerNoPermissionException
- If permission to join the specified client group is denied.BrokerNotRunningException
- If the host exists but no broker is running on that host.BrokerNullParameterException
- If broker_host or client_id are null.BrokerSecurityException
- If a secure connection is attempted but is rejected by the broker.BrokerUnknownBrokerNameException
- If the specified broker does not exist. If broker_name is null, this indicates that there is no default broker.BrokerUnknownClientIdException
- If the specified client ID does not exist on the broker.BrokerException
public static BrokerTransactionalClient newOrReconnectTransactionalClient(java.lang.String broker_host, java.lang.String broker_name, java.lang.String client_id, java.lang.String client_group, java.lang.String app_name, BrokerConnectionDescriptor desc) throws BrokerException
BrokerClientContentionException
- If the client ID is already in use by another client. For shared state clients, this means the maximum number of reconnects has been
exceeded.BrokerCommFailureException
- If problems occur establishing the connection.BrokerHostNotFoundException
- If the specified host does not exist.BrokerInvalidClientIdException
- If the ID contains illegal characters.BrokerNoPermissionException
- If permission to join the specified client group is denied.BrokerNotRunningException
- If the host exists but no broker is running on that host.BrokerNullParameterException
- If broker_host, client_id, client_group, or app_name are null.BrokerSecurityException
- If a secure connection is attempted but is rejected by the broker.BrokerUnknownBrokerNameException
- If the specified broker does not exist. If broker_name is null, this indicates that there is no default broker.BrokerUnknownClientGroupException
- If the specified client group does not exist on the broker.BrokerUnknownClientIdException
- If the specified client ID does not exist on the broker.BrokerException
public static BrokerClient newOrReconnect(java.lang.String broker_host, java.lang.String broker_name, java.lang.String client_id, java.lang.String client_group, java.lang.String app_name, BrokerConnectionDescriptor desc) throws BrokerException
BrokerClientContentionException
- If the client ID is already in use by another client. For shared state clients, this means the maximum number of reconnects has been
exceeded.BrokerCommFailureException
- If problems occur establishing the connection.BrokerHostNotFoundException
- If the specified host does not exist.BrokerInvalidClientIdException
- If the ID contains illegal characters.BrokerNoPermissionException
- If permission to join the specified client group is denied.BrokerNotRunningException
- If the host exists but no broker is running on that host.BrokerNullParameterException
- If broker_host, client_id, client_group, or app_name are null.BrokerSecurityException
- If a secure connection is attempted but is rejected by the broker.BrokerUnknownBrokerNameException
- If the specified broker does not exist. If broker_name is null, this indicates that there is no default broker.BrokerUnknownClientGroupException
- If the specified client group does not exist on the broker.BrokerUnknownClientIdException
- If the specified client ID does not exist on the broker.BrokerException
public long beginTransaction(java.lang.String external_id) throws BrokerException
external_id
- (optional) - A user defined, externally generated transaction identifierBrokerInvalidClientException
BrokerException
public long beginTransaction(java.lang.String external_id, int flag, int timeout) throws BrokerException
external_id
- - A user defined, externally generated transaction identifierflag
- - this will contain information if this is a new transction or joining an existing transaction.timeout
- BrokerInvalidClientException
BrokerException
public void endTransaction(java.lang.String external_id, int end_state) throws BrokerException
external_id
- - A user defined, externally generated transaction identifierend_state
- either BrokerTransactionalClient.TRANSACTION_END_ABORT or BrokerTransactionalClient.TRANSACTION_END_COMMITBrokerException
public void endTransaction(long tx_id, int end_state) throws BrokerException
BrokerException
public static void endAll(BrokerTransactionalClient[] tx_clients, java.lang.String externalId, int end_state) throws BrokerException
tx_clients
- the list of transactions to endend_state
- either BrokerTransactionalClient.TX_STATE_SUCCESS or BrokerTransactionalClient.TX_STATE_FAILUREBrokerException
public static void endAll(BrokerTransactionalClient[] tx_clients, int end_state) throws BrokerException
BrokerException
public int prepare(java.lang.String external_id) throws BrokerException
external_id
- a user defined, externally generated transaction identifierBrokerException
public int prepare(long tx_id) throws BrokerException
tx_id
- The transaction identifier returned by the Broker during beginTransactionBrokerException
public static void prepareAll(BrokerTransactionalClient[] tx_clients, java.lang.String external_id) throws BrokerException
external_id
- a user defined, externally generated transaction identifierBrokerException
public static void prepareAll(BrokerTransactionalClient tx_client, java.lang.String[] external_ids) throws BrokerException
tx_client
- client that participated in the transaction and need to be preparedexternal_ids
- list of external ids of open transactions that need to be preparedBrokerException
public void commit() throws BrokerException
public void commit(long tx_id) throws BrokerException
public void commit(java.lang.String external_id) throws BrokerException
public void commit(java.lang.String[] external_ids) throws BrokerException
public static void commitAll(BrokerTransactionalClient[] tx_clients) throws BrokerException
public static void commitAll(BrokerTransactionalClient[] tx_clients, java.lang.String external_id) throws BrokerException
tx_clients
- - list of BrokerTransactionalClientsexternal_id
- a user defined, externally generated transaction identifier, a value must be supplied.BrokerTxClosedException
BrokerInvalidClientException
BrokerInvalidTxException
BrokerException
public void abort() throws BrokerException
public void abort(long tx_id) throws BrokerException
public void abort(java.lang.String external_id) throws BrokerException
external_id
- -a user defined, externally generated transaction identifier, mandatoryBrokerTxClosedException
BrokerInvalidClientException
BrokerInvalidTxException
BrokerException
public void abort(java.lang.String[] external_ids) throws BrokerException
public static void abortAll(BrokerTransactionalClient[] tx_clients) throws BrokerException
tx_clients
- - list of BrokerTransactionalClientsBrokerTxClosedException
BrokerInvalidClientException
BrokerInvalidTxException
BrokerException
public static void abortAll(BrokerTransactionalClient[] tx_clients, java.lang.String external_id) throws BrokerException
tx_clients
- - list of BrokerTransactionalClientsexternal_id
- a user defined, externally generated transaction identifierBrokerTxClosedException
BrokerInvalidClientException
BrokerInvalidTxException
BrokerException
public void forget(java.lang.String external_id) throws BrokerException
external_id
- a user defined, externally generated transaction identifierBrokerException
public void forget(long tx_id) throws BrokerException
tx_id
- the Broker transaction context returned by beginTransactionBrokerException
public static void forgetAll(BrokerTransactionalClient[] tx_clients, java.lang.String external_id) throws BrokerException
tx_clients
- - list of BrokerTransactionalClientsexternal_id
- a user defined, externally generated transaction identifierBrokerException
public static void forgetAll(BrokerTransactionalClient tx_client, java.lang.String[] external_ids) throws BrokerException
tx_client
- - list of BrokerTransactionalClientsexternal_ids
- a user defined, externally generated transaction identifierBrokerException
public void setTransactionId(long tx_id, java.lang.String external_id) throws BrokerException
tx_id
- a Broker transaction identifierexternal_id
- a user defined, externally generated transaction identifierBrokerInvalidTxException
- if the transaction is not found, the transaction is not open or if an external identifier already exists for the transaction.BrokerException
- for all other errors.public void setTransactionId(java.lang.String external_id) throws BrokerException
external_id
- a user defined, externally generated transaction identifierBrokerInvalidTxException
- if the transaction is not found, the transaction is not open or if an external identifier already exists for the transaction.BrokerException
- for all other errors.public java.lang.String[] recover(int flags) throws BrokerException
BrokerException
public void suspend(java.lang.String external_id) throws BrokerException
BrokerException
public void suspend(long tx_id) throws BrokerException
BrokerException
public static void suspendAll(BrokerTransactionalClient[] tx_clients, java.lang.String external_id) throws BrokerException
tx_clients
- the list of transactions to suspendBrokerException
public void resume(java.lang.String external_id) throws BrokerException
external_id
- the Broker transaction context returned by beginTransactionBrokerException
public void resume(long tx_id) throws BrokerException
tx_id
- the Broker transaction context returned by beginTransactionBrokerException
public static void resumeAll(BrokerTransactionalClient[] tx_clients, java.lang.String external_id) throws BrokerException
external_id
- a user defined, externally generated transaction identifiertx_clients
- the list of transactions to resumeBrokerException
public long getId(java.lang.String external_id)
public long getId()
protected void setId(long tx_id)
public java.lang.String getExternalId()
public int getTransactionTimeout() throws BrokerException
BrokerException
public void setTransactionTimeout(int seconds) throws BrokerException
BrokerException
public COM.activesw.api.client.BrokerXAResource getXAResource()
protected void setXAResource(COM.activesw.api.client.BrokerXAResource bXAResource)
public void publish(BrokerEvent event) throws BrokerException
publish
in class BrokerClient
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidEventException
- If the event does not match its type definition.BrokerNoPermissionException
- If the client does not have permission to publish the event type.BrokerNullParameterException
- If event is null.BrokerUnknownEventTypeException
- If the event type for the event does not exist on the broker.BrokerException
public void publish(COM.activesw.api.client.BrokerJMSEvent event) throws BrokerException
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidEventException
- If the event does not match its type definition.BrokerNoPermissionException
- If the client does not have permission to publish the event type.BrokerNullParameterException
- If event is null.BrokerUnknownEventTypeException
- If the event type for the event does not exist on the broker.BrokerException
public void jmsClientPublish(COM.activesw.api.client.BrokerJMSEvent[] events, boolean async) throws BrokerException
jmsClientPublish
in class BrokerClient
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidEventException
- If any of the events does not match its type definition.BrokerNoPermissionException
- If the client does not have permission to publish all of the event types.BrokerNullParameterException
- If events is null, or if any element in the array is null.BrokerUnknownEventTypeException
- If the event type for any of the events does not exist on the broker.BrokerException
public void publishWithAck(BrokerEvent[] events, int ack_type, long[] ack_seqn) throws BrokerException
publishWithAck
in class BrokerClient
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidEventException
- If any of the events does not match its type definition.BrokerNoPermissionException
- If the client does not have permission to publish all of the event types.BrokerNullParameterException
- If events is null, or if any element in the array is null.BrokerOutOfRangeException
- If the ack_type is not a legal ACK_* value.BrokerUnknownEventTypeException
- If the event type for any of the events does not exist on the broker.BrokerInvalidAcknowledgementException
- If ack_seqn if not a valid event to acknowledge. Events are not published.BrokerException
public void deliver(java.lang.String dest_id, BrokerEvent event) throws BrokerException
deliver
in class BrokerClient
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidClientIdException
- If the destination ID includes invalid characters.BrokerInvalidEventException
- If the event does not match its type definition.BrokerNoPermissionException
- If the client does not have permission to publish the event type.BrokerNullParameterException
- If event or dest_id are null.BrokerUnknownEventTypeException
- If the event type for the event does not exist on the broker.BrokerException
public void deliver(java.lang.String dest_id, BrokerEvent[] events) throws BrokerException
deliver
in class BrokerClient
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidClientIdException
- If the destination ID includes invalid characters.BrokerInvalidEventException
- If any of the events does not match its type definition.BrokerNoPermissionException
- If the client does not have permission to publish all of the event types.BrokerNullParameterException
- If dest_id or events are null, or if any element in the array is null.BrokerUnknownEventTypeException
- If the event type for any of the events does not exist on the broker.BrokerException
public void deliverWithAck(java.lang.String dest_id, BrokerEvent[] events, int ack_type, long[] ack_seqn) throws BrokerException
deliverWithAck
in class BrokerClient
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidClientIdException
- If the destination ID includes invalid characters.BrokerInvalidEventException
- If any of the events does not match its type definition.BrokerNoPermissionException
- If the client does not have permission to publish all of the event types.BrokerNullParameterException
- If dest_id or events are null, or if any element in the array is null.BrokerOutOfRangeException
- If the ack_type is not a legal ACK_* value.BrokerUnknownEventTypeException
- If the event type for any of the events does not exist on the broker.BrokerInvalidAcknowledgementException
- If ack_seqn if not a valid event to acknowledge. Events are not published.BrokerException
public void deliverAckReplyEvent(BrokerEvent request_event, long publish_seqn) throws BrokerException
deliverAckReplyEvent
in class BrokerClient
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidEventException
- If the event was not received from the broker.BrokerNoPermissionException
- If the client does not have permission to publish the Adapter::ack event type.BrokerNullParameterException
- If request_event is null.BrokerException
public void deliverNullReplyEvent(BrokerEvent request_event, java.lang.String reply_event_type_name, long publish_seqn) throws BrokerException
deliverNullReplyEvent
in class BrokerClient
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidEventException
- If the event was not received from the broker.BrokerNoPermissionException
- If the client does not have permission to publish the reply event type.BrokerNullParameterException
- If request_event or reply_event_type_name are null.BrokerUnknownEventTypeException
- If the event type for the reply event does not exist on the broker.BrokerException
public void deliverErrorReplyEvent(BrokerEvent request_event, BrokerEvent error_event) throws BrokerException
deliverErrorReplyEvent
in class BrokerClient
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidEventException
- If the request event was not received from the broker, or the reply event does not match its event type.BrokerNoPermissionException
- If the client does not have permission to publish the reply event type.BrokerNullParameterException
- If request_event or event are null.BrokerUnknownEventTypeException
- If the event type for the reply event does not exist on the broker.BrokerException
public void deliverReplyEvent(BrokerEvent request_event, BrokerEvent event) throws BrokerException
deliverReplyEvent
in class BrokerClient
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidEventException
- If the request event was not received from the broker, or the reply event does not match its event type.BrokerNoPermissionException
- If the client does not have permission to publish the reply event type.BrokerNullParameterException
- If request_event or event are null.BrokerUnknownEventTypeException
- If the event type for the reply event does not exist on the broker.BrokerException
public void deliverReplyEvents(BrokerEvent request_event, BrokerEvent[] events) throws BrokerException
deliverReplyEvents
in class BrokerClient
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidEventException
- If the request event was not received from the broker, or any of the reply events does not match its event type.BrokerNoPermissionException
- If the client does not have permission to publish all of the reply events.BrokerNullParameterException
- If request_event or events are null, or if any element in the events array is null.BrokerUnknownEventTypeException
- If the event type for any of the reply events does not exist on the broker.BrokerException
public int deliverPartialReplyEvents(BrokerEvent request_event, BrokerEvent[] events, int flag, int token) throws BrokerException
deliverPartialReplyEvents
in class BrokerClient
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidEventException
- If the request event was not received from the broker, or any of the reply events does not match its event type.BrokerNoPermissionException
- If the client does not have permission to publish all of the reply events.BrokerNullParameterException
- If request_event or events are null, or if any element in the events array is null.BrokerOutOfRangeException
- If flag is not a valid value.BrokerUnknownEventTypeException
- If the event type for any of the reply events does not exist on the broker.BrokerException
public void cancelGetEvents() throws BrokerException
cancelGetEvents
in class BrokerClient
BrokerException
public BrokerEvent getEvent(int msecs) throws BrokerException
Caution should be used when calling this method simultaneously from the same client on multiple threads. An event received on one thread may be
acknowledged by another thread. To insure proper acknowledgement handling getEvents(int, long, int)
should be used in
this situation.
In addition to the listed exceptions, any communications exception can be thrown.
getEvent
in class BrokerClient
BrokerInterruptedException
- If interruptGetEvents is used to stop the call.BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerOutOfRangeException
- If msecs is less than -1.BrokerTimeoutException
- If the timeout is reached before an event arrives.BrokerException
public BrokerEvent[] getEvents(int max_events, int msecs) throws BrokerException
Caution should be used when calling this method simultaneously from the same client on multiple threads. An event received on one thread may be
acknowledged by another thread. To insure proper acknowledgement handling BrokerClient.getEvents(int, long, int)
should be used in this
situation.
The number of events being returned is not guaranteed to be 'max_events' even if there are more than than many events in the client's queue. Any number of events up to the value of 'max_events' may be returned. In addition to the listed exceptions, any communications exception can be thrown.
getEvents
in class BrokerClient
BrokerInterruptedException
- If interruptGetEvents is used to stop the call.BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerOutOfRangeException
- If msecs is less than -1, or max_events is less than zero.BrokerTimeoutException
- If the timeout is reached before any events arrive.BrokerException
public BrokerEvent[] getEvents(int max_events, long seqn, int msecs) throws BrokerException
Caution should be used when calling this method simultaneously from the same client on multiple threads when seqn is 0. An event received on one thread may be acknowledged by another thread.
The number of events being returned is not guaranteed to be 'max_events' even if there are more than than many events in the client's queue. Any number of events up to the value of 'max_events' may be returned. In addition to the listed exceptions, any communications exception can be thrown.
getEvents
in class BrokerClient
BrokerInterruptedException
- If interruptGetEvents is used to stop the call.BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerOutOfRangeException
- If msecs is less than -1, or max_events is less than zero.BrokerTimeoutException
- If the timeout is reached before any events arrive.BrokerException
public COM.activesw.api.client.BrokerJMSEvent[] getJMSEvents(int max_events, long seqn, int msecs) throws BrokerException
getJMSEvents
in class BrokerClient
BrokerInterruptedException
- If interruptGetEvents is used to stop the call.BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerOutOfRangeException
- If msecs is less than -1, or max_events is less than zero, or seqn is less than -1.BrokerTimeoutException
- If the timeout is reached before any events arrive.BrokerException
public void interruptGetEvents() throws BrokerException
interruptGetEvents
in class BrokerClient
BrokerTxClosedException
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerException
public BrokerEvent[] publishRequestAndWait(BrokerEvent event, int msecs) throws BrokerException
BrokerClient
Note: This operation is intended for use only for clients which are using the callback model. It does not work properly for clients which are using the getEvents model. It also only works properly when responses will be returned from only one client due to the request.
publishRequestAndWait
in class BrokerClient
BrokerBadStateException
- If this is called from within a callback function.BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidEventException
- If the event does not match its type definition.BrokerNoPermissionException
- If the client does not have permission to publish the event type.BrokerNullParameterException
- If event is null.BrokerUnknownEventTypeException
- If the event type for the event does not exist on the broker.BrokerException
public BrokerEvent[] deliverRequestAndWait(java.lang.String dest_id, BrokerEvent event, int msecs) throws BrokerException
BrokerClient
Note: This operation is intended for use only for clients which are using the callback model. It does not work properly for clients which are using the getEvents model. It also only works properly when responses will be returned from only one client due to the request.
deliverRequestAndWait
in class BrokerClient
BrokerBadStateException
- If this is called from within a callback function.BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidClientIdException
- If the destination ID includes invalid characters.BrokerInvalidEventException
- If the event does not match its type definition.BrokerNoPermissionException
- If the client does not have permission to publish the event type.BrokerNullParameterException
- If dest_id or event are null.BrokerUnknownEventTypeException
- If the event type for the event does not exist on the broker.BrokerException
public void registerCallback(BrokerCallback obj, java.lang.Object client_data) throws BrokerException
BrokerClient
registerCallback
in class BrokerClient
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerNullParameterException
- If obj is null.BrokerException
public void registerCallbackForSubId(int sub_id, BrokerCallback obj, java.lang.Object client_data) throws BrokerException
BrokerClient
registerCallbackForSubId
in class BrokerClient
BrokerBadStateException
- If no general callback has been registered.BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerNullParameterException
- If obj is null.BrokerOutOfRangeException
- If sub_id is less than zero.BrokerException
public void registerCallbackForTag(int tag, boolean cancel_when_done, BrokerCallback obj, java.lang.Object client_data) throws BrokerException
BrokerClient
registerCallbackForTag
in class BrokerClient
BrokerBadStateException
- If no general callback has been registered.BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerNullParameterException
- If obj is null.BrokerException
public void cancelCallbacks() throws BrokerException
BrokerClient
cancelCallbacks
in class BrokerClient
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerException
public void cancelCallbackForSubId(int sub_id) throws BrokerException
BrokerClient
cancelCallbackForSubId
in class BrokerClient
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerException
public void cancelCallbackForTag(int tag) throws BrokerException
BrokerClient
cancelCallbackForTag
in class BrokerClient
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerException
public static void dispatch(int msecs) throws BrokerException
BrokerException
public static void interruptDispatch() throws BrokerException
BrokerException
public static void mainLoop() throws BrokerException
BrokerException
public static void stopMainLoop() throws BrokerException
BrokerException
public void acknowledge(long seqn) throws BrokerException
acknowledge
in class BrokerClient
BrokerInvalidAcknowledgementException
- If seqn is not a valid event to acknowledge.BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerOutOfRangeException
- If seqn is less than zero.BrokerException
public void acknowledge(long[] seqns) throws BrokerException
acknowledge
in class BrokerClient
BrokerInvalidAcknowledgementException
- If seqn is not a valid event to acknowledge.BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerOutOfRangeException
- If seqn is less than zero.BrokerException
public void acknowledgeThrough(long seqn) throws BrokerException
acknowledgeThrough
in class BrokerClient
BrokerInvalidAcknowledgementException
- If seqn is not a valid event to acknowledge.BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerOutOfRangeException
- If seqn is less than zero.BrokerException
public void negativeAcknowledge(long seqn) throws BrokerException
negativeAcknowledge
in class BrokerClient
BrokerInvalidAcknowledgementException
- If seqn is not a valid event to acknowledge.BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerOutOfRangeException
- If seqn is less than zero.BrokerException
public void negativeAcknowledge(long[] seqns) throws BrokerException
negativeAcknowledge
in class BrokerClient
BrokerInvalidAcknowledgementException
- If seqn is not a valid event to acknowledge.BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerOutOfRangeException
- If seqn is less than zero.BrokerException
public static void threadedCallbacks(boolean enabled) throws BrokerException
BrokerException
public void prime(int num) throws BrokerException
prime
in class BrokerClient
num
- The requested number of events.BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerException
public void primeWithAck(int num) throws BrokerException
primeWithAck
in class BrokerClient
BrokerException
Copyright © 2002-2006 webMethods, Inc. Copyright © 2007-2021 Software AG Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.