Knopflerfish OSGi 5.2.0

org.osgi.service.threadio
Interface ThreadIO


public interface ThreadIO

Enable multiplexing of the standard IO streams for input, output, and error. This service guards the central resource of IO streams. The standard streams are singletons. This service replaces the singletons with special versions that can find a unique stream for each thread. If no stream is associated with a thread, it will use the standard input/output that was originally set. TODO The javadoc in this class need a good scrub before release.

Version:
$Revision: 5654 $
ThreadSafe

Method Summary
 void close()
          Cancel the streams associated with the current thread.
 void setStreams(java.io.InputStream in, java.io.PrintStream out, java.io.PrintStream err)
          Associate this streams with the current thread.
 

Method Detail

setStreams

void setStreams(java.io.InputStream in,
                java.io.PrintStream out,
                java.io.PrintStream err)
Associate this streams with the current thread. Ensure that when output is performed on System.in, System.out, System.err it will happen on the given streams. The streams will automatically be canceled when the bundle that has gotten this service is stopped or returns this service.

Parameters:
in - InputStream to use for the current thread when System.in is used
out - PrintStream to use for the current thread when System.out is used
err - PrintStream to use for the current thread when System.err is used

close

void close()
Cancel the streams associated with the current thread. This method will not do anything when no streams are associated.


Knopflerfish OSGi 5.2.0