org.jboss.wsf.common.concurrent
Class CopyJob

java.lang.Object
  extended by org.jboss.wsf.common.concurrent.CopyJob
All Implemented Interfaces:
java.lang.Runnable

public final class CopyJob
extends java.lang.Object
implements java.lang.Runnable

Sample usage:

 CopyJob copyJob = new CopyJob( inputStream, printStream );
 new Thread( copyJob ).start();
 try
 {
    // do some other staff
    ...
 }
 finally
 {
    copyJob.kill();
 }
 

Author:
richard.opalka@jboss.com

Constructor Summary
CopyJob(java.io.InputStream is, java.io.OutputStream os)
          Constructor.
 
Method Summary
 void kill()
          Kills this job.
 void run()
          Copies all data from input stream to output stream (both passed to constructor) until job is killed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CopyJob

public CopyJob(java.io.InputStream is,
               java.io.OutputStream os)
Constructor.

Parameters:
is - input stream to read data from
os - output stream to write data to
Method Detail

run

public final void run()
Copies all data from input stream to output stream (both passed to constructor) until job is killed

Specified by:
run in interface java.lang.Runnable

kill

public final void kill()
Kills this job. Calling this method also ensures that input stream passed to the constructor will be closed properly



Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.