org.ow2.jonas.web.base.proxy
Class CopyingStream

java.lang.Object
  extended by java.lang.Thread
      extended by org.ow2.jonas.web.base.proxy.CopyingStream
All Implemented Interfaces:
Runnable

public class CopyingStream
extends Thread

Allow to copy inputstream of the client to the remote output stream.

Author:
Florent Benoit

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
CopyingStream(HttpSocketHandler socketHandler, ByteArrayOutputStream byteArrayOutputStream, InputStream inputStream, OutputStream outputStream)
          Build a new copying stream with the given parameters.
 
Method Summary
 void run()
          Send the bytes of the byte array stream and then send all the client's input stream.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CopyingStream

public CopyingStream(HttpSocketHandler socketHandler,
                     ByteArrayOutputStream byteArrayOutputStream,
                     InputStream inputStream,
                     OutputStream outputStream)
Build a new copying stream with the given parameters.

Parameters:
socketHandler - object handling the client socket
byteArrayOutputStream - the bytes to add on the remote connection
inputStream - the client's input stream
outputStream - the remote connection output stream
Method Detail

run

public void run()
Send the bytes of the byte array stream and then send all the client's input stream.

Specified by:
run in interface Runnable
Overrides:
run in class Thread


Copyright © 2010 OW2 Consortium. All Rights Reserved.