com.softwareag.tamino.db.api.invocation
Class TInvocationRetryOnNoConnectionHandler

java.lang.Object
  extended by com.softwareag.tamino.db.api.invocation.TAbstractInvocationRetryHandler
      extended by com.softwareag.tamino.db.api.invocation.TInvocationRetryOnNoConnectionHandler
All Implemented Interfaces:
TInvocationRetryHandler

public class TInvocationRetryOnNoConnectionHandler
extends TAbstractInvocationRetryHandler

The TInvocationRetryOnNoConnectionHandler is a simple TInvocationRetryHandler which tries to perform the invocation repeatetly if it fails by waiting an increasing amount of time.

Version:
$Revision: 1.7 $
Author:
Stefan Liebig

Constructor Summary
TInvocationRetryOnNoConnectionHandler()
           
 
Method Summary
 void prepare(TRetryInvocation invocation, TCommandStatement commandStatement, java.lang.String collection, java.lang.String doctype, java.lang.String docname, boolean useTransactionMode)
          Prepare an invocation.
 TInputStream retryAfterInvoke(TRetryInvocation invocation, TCommandStatement commandStatement, TInputStream inputStream, TInvocationException cause)
          Handle the "result" after the invocation has invoked the the base communication (HTTP, ..) or tried to do that.
 
Methods inherited from class com.softwareag.tamino.db.api.invocation.TAbstractInvocationRetryHandler
getLocale, retryAfterSessionModeUpdate, setLocale, wrapUpAfterInvoke, wrapUpAfterSessionModeUpdate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TInvocationRetryOnNoConnectionHandler

public TInvocationRetryOnNoConnectionHandler()
Method Detail

prepare

public void prepare(TRetryInvocation invocation,
                    TCommandStatement commandStatement,
                    java.lang.String collection,
                    java.lang.String doctype,
                    java.lang.String docname,
                    boolean useTransactionMode)
Prepare an invocation. This method is called is called at the very first time within the invocation where no processing has been done. Here some kind of preparation/initialization of the handler can be done.

Specified by:
prepare in interface TInvocationRetryHandler
Overrides:
prepare in class TAbstractInvocationRetryHandler
Parameters:
invocation - spcifies the invocation.
commandStatement - specifies the concrete Tamino specific action that should be fullfilled. Session information is not yet set.
collection - is the collection of the Tamino DB to which the command statement might be related to.
doctype - within a schema of the given collection to which the command statement might be related to.
docname - is the name of the document to which the command statement might be related to.
useTransactionState - specifies whether the transaction state shall be considered.

retryAfterInvoke

public TInputStream retryAfterInvoke(TRetryInvocation invocation,
                                     TCommandStatement commandStatement,
                                     TInputStream inputStream,
                                     TInvocationException cause)
Handle the "result" after the invocation has invoked the the base communication (HTTP, ..) or tried to do that.

Specified by:
retryAfterInvoke in interface TInvocationRetryHandler
Overrides:
retryAfterInvoke in class TAbstractInvocationRetryHandler
Parameters:
invocation - spcifies the invocation.
commandStatement - specifies the concrete Tamino specific action that should be fullfilled. Session information is written to the command statement.
inputStream - the returned input stream from the base communiciation
cause - the exception caused by writing the session information or null, when it has been successfull.
Returns:
TInputStream with the successfull retry result or null otherwise.


Copyright (c) 2013 Software AG. All Rights Reserved.