public class TPooledConnectionReconnectHandler
extends java.lang.Object
Constructor and Description |
---|
TPooledConnectionReconnectHandler(TDarkConnection connection)
Construct a new TPooledConnectionReconnectHandler.
|
Modifier and Type | Method and Description |
---|---|
int |
getFailedReconnects()
Gets the number of failed reconnects
|
int |
getReconnects()
Gets the number of reconnects
|
void |
prepare(TRetryInvocation invocation,
TCommandStatement commandStatement,
java.lang.String collection,
java.lang.String doctype,
java.lang.String docname,
boolean useTransactionMode)
Prepare a potential reconnect.
|
void |
reconnect(TRetryInvocation invocation)
Checks whether a reconnect is required and if so attempts to do so.
|
public TPooledConnectionReconnectHandler(TDarkConnection connection)
TPooledConnectionReconnectHandler
- the T(Dark)Connection object for which this hanlöder is active.public void prepare(TRetryInvocation invocation, TCommandStatement commandStatement, java.lang.String collection, java.lang.String doctype, java.lang.String docname, boolean useTransactionMode)
invocation
- spcifies the invocation.commandStatement
- specifies the concrete Tamino specific action that should be fulfilled.
Session information is not yet set.collection
- is the collection of the Tamino DB associated to the command.doctype
- within a schema of the given collection associated to the command.docname
- is the name of the document associated to the command.useTransactionState
- specifies whether the transaction state shall be considered.
Note that this implementation is identical to the logic followed by the TInvocationRetryOnConnectionTimeoutHandler.
A different approach would also be possible: The _connect has to be parameterized exactly
as the pool to which it belongs was parameterized by a TConnectionPoolDescriptor. This information
could therefore alos be used to make the reconnect. This, however, requires that we have a
way to find the pool in question.public void reconnect(TRetryInvocation invocation)
invocation
- specifies the invocation.public int getReconnects()
public int getFailedReconnects()
Copyright (c) 2016 Software AG. All Rights Reserved.