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

java.lang.Object
  extended by com.softwareag.tamino.db.api.invocation.TAbstractInvocationRetryHandler
All Implemented Interfaces:
TInvocationRetryHandler
Direct Known Subclasses:
TInvocationRetryOnConnectionTimeoutHandler, TInvocationRetryOnNoConnectionHandler

public class TAbstractInvocationRetryHandler
extends java.lang.Object
implements TInvocationRetryHandler

The TAbstractInvocationRetryHandler can be used to subclass special retry handlers. It defines for all methods of the TInvocationRetryHandler interface dummy implementations. The subclass has only to overwrite the methods of interest or need.

Version:
$Revision: 1.3 $
Author:
Stefan Liebig

Constructor Summary
TAbstractInvocationRetryHandler()
           
 
Method Summary
 java.util.Locale getLocale()
          Gets the locale.
 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 base communication (HTTP, ..) or tried to do that.
 TInputStream retryAfterSessionModeUpdate(TRetryInvocation invocation, TCommandStatement commandStatement, TInputStream inputStream, TTransactionModeUpdateException cause)
          Handle the "result" after the invocation has been updated or tried to update the session information from the command statment.
 void setLocale(java.util.Locale locale)
          Sets the locale.
 void wrapUpAfterInvoke(TRetryInvocation invocation, TCommandStatement commandStatement)
          Wrap up an invocation after the invocation has invoked the base communication (HTTP, ..).
 void wrapUpAfterSessionModeUpdate(TRetryInvocation invocation, TCommandStatement commandStatement)
          Wrap up an invocation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TAbstractInvocationRetryHandler

public TAbstractInvocationRetryHandler()
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 at the very beginning of 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
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 base communication (HTTP, ..) or tried to do that.

Specified by:
retryAfterInvoke in interface TInvocationRetryHandler
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.

wrapUpAfterInvoke

public void wrapUpAfterInvoke(TRetryInvocation invocation,
                              TCommandStatement commandStatement)
Wrap up an invocation after the invocation has invoked the base communication (HTTP, ..). Here some memorization of state information can be done that can be used in the next invocation of the handler.

Specified by:
wrapUpAfterInvoke in interface TInvocationRetryHandler
Parameters:
invocation - specifies the invocation.
commandStatement - specifies the Tamino command that was issued. Session information as returned by the previous Tamino command is set.

retryAfterSessionModeUpdate

public TInputStream retryAfterSessionModeUpdate(TRetryInvocation invocation,
                                                TCommandStatement commandStatement,
                                                TInputStream inputStream,
                                                TTransactionModeUpdateException cause)
Handle the "result" after the invocation has been updated or tried to update the session information from the command statment.

Specified by:
retryAfterSessionModeUpdate in interface TInvocationRetryHandler
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.

wrapUpAfterSessionModeUpdate

public void wrapUpAfterSessionModeUpdate(TRetryInvocation invocation,
                                         TCommandStatement commandStatement)
Wrap up an invocation. This method is called at the very end of the invocation where all processing has been done. Here some memorization of state information can be done that can be used in the next invocation of the handler.

Specified by:
wrapUpAfterSessionModeUpdate in interface TInvocationRetryHandler
Parameters:
invocation - specifies the invocation.
commandStatement - specifies the Tamino command that was issued. Session information as returned by the previous Tamino command is set.

setLocale

public void setLocale(java.util.Locale locale)
Sets the locale.


getLocale

public java.util.Locale getLocale()
Gets the locale.

Returns:
the locale.


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