openr66.protocol.localhandler
Class RetrieveRunner

java.lang.Object
  extended by java.lang.Thread
      extended by openr66.protocol.localhandler.RetrieveRunner
All Implemented Interfaces:
Runnable

public class RetrieveRunner
extends Thread

Retrieve transfer runner

Author:
Frederic Bregier

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  AtomicBoolean running
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
protected RetrieveRunner()
           
  RetrieveRunner(R66Session session, org.jboss.netty.channel.Channel channel)
           
 
Method Summary
 void run()
           
 void stopRunner()
          Try to stop the runner
static goldengate.common.file.DataBlock transformToDataBlock(byte[] data)
          Utility method for send through mode
static org.jboss.netty.channel.ChannelFuture writeWhenPossible(goldengate.common.file.DataBlock block, LocalChannelReference localChannelReference)
          Write the next block when the channel is ready to prevent OOM
 
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

running

protected AtomicBoolean running
Constructor Detail

RetrieveRunner

protected RetrieveRunner()

RetrieveRunner

public RetrieveRunner(R66Session session,
                      org.jboss.netty.channel.Channel channel)
Parameters:
session -
channel - local channel
Method Detail

stopRunner

public void stopRunner()
Try to stop the runner


run

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

writeWhenPossible

public static org.jboss.netty.channel.ChannelFuture writeWhenPossible(goldengate.common.file.DataBlock block,
                                                                      LocalChannelReference localChannelReference)
                                                               throws OpenR66ProtocolPacketException,
                                                                      OpenR66RunnerErrorException,
                                                                      OpenR66ProtocolSystemException
Write the next block when the channel is ready to prevent OOM

Parameters:
block -
localChannelReference -
Returns:
the ChannelFuture on the write operation
Throws:
OpenR66ProtocolPacketException
OpenR66RunnerErrorException
OpenR66ProtocolSystemException

transformToDataBlock

public static goldengate.common.file.DataBlock transformToDataBlock(byte[] data)
Utility method for send through mode

Parameters:
data - the data byte, if null it is the last block
Returns:
the DataBlock associated to the data


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