Class QueryHost
java.lang.Object
org.jpos.transaction.participant.QueryHost
- All Implemented Interfaces:
Configurable, TransactionConstants, TransactionParticipant
Transaction participant that routes the request to a downstream MUX,
waits for the response (synchronously or via continuations), and stores
the response back into the
Context.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefaultContextkey used to override the per-transaction timeout.Fields inherited from interface TransactionConstants
ABORTED, FAIL, NO_JOIN, PAUSE, PREPARED, READONLY, RETRYModifier and TypeFieldDescriptionstatic final intTransaction has been aborted.static final intShortcut for a read-only, non-joining abort (READONLY | NO_JOIN).static final intThis participant does not join the transactionstatic final intTransaction is paused.static final intTransaction has been prepared successfully.static final intContext has not been modified (no need to persist a snapshot)static final intTransaction should be retried. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanisConnected(MUX mux) Indicates whethermuxis currently connected, honouring thecheck-connectedconfiguration switch.intprepare(long id, Serializable ser) Called by TransactionManager in preparation for a transactionprotected longresolveTimeout(Context ctx) Resolves the per-transaction request timeout, honouring any value the upstream code stashed in the context underTIMEOUT_NAME.voidConfigures this object with the suppliedConfiguration.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TransactionParticipant
abort, commitModifier and TypeMethodDescriptiondefault voidabort(long id, Serializable context) Called by TransactionManager upon transaction commit.default voidcommit(long id, Serializable context) Called by TransactionManager upon transaction commit.
-
Field Details
-
TIMEOUT_NAME
DefaultContextkey used to override the per-transaction timeout.- See Also:
-
-
Constructor Details
-
QueryHost
public QueryHost()Default constructor.
-
-
Method Details
-
prepare
Description copied from interface:TransactionParticipantCalled by TransactionManager in preparation for a transaction- Specified by:
preparein interfaceTransactionParticipant- Parameters:
id- the Transaction identifierser- transaction context- Returns:
- PREPARED or ABORTED (| NO_JOIN | READONLY)
-
setConfiguration
Description copied from interface:ConfigurableConfigures this object with the suppliedConfiguration.- Specified by:
setConfigurationin interfaceConfigurable- Parameters:
cfg- Configuration object- Throws:
ConfigurationException- if the configuration is invalid
-
resolveTimeout
Resolves the per-transaction request timeout, honouring any value the upstream code stashed in the context underTIMEOUT_NAME.- Parameters:
ctx- transaction context- Returns:
- effective timeout in milliseconds
-
isConnected
Indicates whethermuxis currently connected, honouring thecheck-connectedconfiguration switch.- Parameters:
mux- MUX selected for this transaction- Returns:
trueif connectivity checks are disabled or the MUX reports connected
-