openr66.commander
Class ClientRunner

java.lang.Object
  extended by java.lang.Thread
      extended by openr66.commander.ClientRunner
All Implemented Interfaces:
Runnable

public class ClientRunner
extends Thread

Client Runner from a TaskRunner

Author:
Frederic Bregier

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
static ConcurrentLinkedQueue<ClientRunner> activeRunners
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ClientRunner(NetworkTransaction networkTransaction, DbTaskRunner taskRunner, R66Future futureRequest)
           
 
Method Summary
 void changeUpdatedInfo(goldengate.common.database.data.AbstractDbData.UpdatedInfo info, ErrorCode code)
          Change the UpdatedInfo of the current runner
 R66Future finishTransfer(boolean retry, LocalChannelReference localChannelReference)
          Finish the transfer (called at the end of runTransfer)
 LocalChannelReference getLocalChannelReference()
           
 NetworkTransaction getNetworkTransaction()
           
 boolean getSendThroughMode()
           
 DbTaskRunner getTaskRunner()
           
 boolean incrementTaskRunerTry(DbTaskRunner runner, int limit)
           
 LocalChannelReference initRequest()
          Initialize the request
 void run()
           
 R66Future runTransfer()
          True transfer run (can be called directly to enable exception outside any executors)
 void setRecvThroughHandler(RecvThroughHandler handler)
           
 void setSendThroughMode()
           
 R66Future tryAgainTransferOnOverloaded(boolean retry, LocalChannelReference localChannelReference)
          In case an overloaded signal is returned by the requested
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

activeRunners

public static ConcurrentLinkedQueue<ClientRunner> activeRunners
Constructor Detail

ClientRunner

public ClientRunner(NetworkTransaction networkTransaction,
                    DbTaskRunner taskRunner,
                    R66Future futureRequest)
Method Detail

getNetworkTransaction

public NetworkTransaction getNetworkTransaction()
Returns:
the networkTransaction

getTaskRunner

public DbTaskRunner getTaskRunner()
Returns:
the taskRunner

getLocalChannelReference

public LocalChannelReference getLocalChannelReference()
Returns:
the localChannelReference

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

incrementTaskRunerTry

public boolean incrementTaskRunerTry(DbTaskRunner runner,
                                     int limit)
Parameters:
runner -
limit -
Returns:
True if the task was run less than limit, else False

runTransfer

public R66Future runTransfer()
                      throws OpenR66RunnerErrorException,
                             OpenR66ProtocolNoConnectionException,
                             OpenR66ProtocolPacketException,
                             OpenR66ProtocolNotYetConnectionException
True transfer run (can be called directly to enable exception outside any executors)

Returns:
The R66Future of the transfer operation
Throws:
OpenR66RunnerErrorException
OpenR66ProtocolNoConnectionException
OpenR66ProtocolPacketException
OpenR66ProtocolNotYetConnectionException

tryAgainTransferOnOverloaded

public R66Future tryAgainTransferOnOverloaded(boolean retry,
                                              LocalChannelReference localChannelReference)
                                       throws OpenR66RunnerErrorException,
                                              OpenR66ProtocolNoConnectionException,
                                              OpenR66ProtocolPacketException,
                                              OpenR66ProtocolNotYetConnectionException
In case an overloaded signal is returned by the requested

Parameters:
retry - if True, it will retry in case of overloaded remote server, else it just stops
localChannelReference -
Returns:
The R66Future of the transfer operation
Throws:
OpenR66RunnerErrorException
OpenR66ProtocolNoConnectionException
OpenR66ProtocolPacketException
OpenR66ProtocolNotYetConnectionException

finishTransfer

public R66Future finishTransfer(boolean retry,
                                LocalChannelReference localChannelReference)
                         throws OpenR66RunnerErrorException
Finish the transfer (called at the end of runTransfer)

Parameters:
retry - if True, it will retry in case of overloaded remote server, else it just stops
localChannelReference -
Returns:
The R66Future of the transfer operation
Throws:
OpenR66ProtocolNotYetConnectionException
OpenR66ProtocolPacketException
OpenR66ProtocolNoConnectionException
OpenR66RunnerErrorException

initRequest

public LocalChannelReference initRequest()
                                  throws OpenR66ProtocolNoConnectionException,
                                         OpenR66RunnerErrorException,
                                         OpenR66ProtocolPacketException,
                                         OpenR66ProtocolNotYetConnectionException
Initialize the request

Returns:
the localChannelReference holding the transfer request
Throws:
OpenR66ProtocolNoConnectionException
OpenR66RunnerErrorException
OpenR66ProtocolPacketException
OpenR66ProtocolNotYetConnectionException

changeUpdatedInfo

public void changeUpdatedInfo(goldengate.common.database.data.AbstractDbData.UpdatedInfo info,
                              ErrorCode code)
Change the UpdatedInfo of the current runner

Parameters:
info -

setRecvThroughHandler

public void setRecvThroughHandler(RecvThroughHandler handler)
Parameters:
handler - the handler to set

setSendThroughMode

public void setSendThroughMode()

getSendThroughMode

public boolean getSendThroughMode()


Copyright © 2009-2012 Frederic Bregier. All Rights Reserved.