Package com.parctechnologies.eclipse
Class ToEclipseQueue
- java.lang.Object
-
- java.io.OutputStream
-
- com.parctechnologies.eclipse.ToEclipseQueue
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class ToEclipseQueue extends java.io.OutputStreamA queue for sending data from Java to ECLiPSe. This class performs no processing of the data and cannot for example, convert to EXDR format (seeEXDROutputStreamfor a class which can do this).In addition to the standard methods inherited from its superclass, this class also provides the ability to attach a
QueueListenerobject to the ToEclipseQueue, as a handler for data requests from ECLiPSe.There is no public constructor; to access an ToEclipseQueue use the
createToEclipseQueue()of an object implementing theEclipseConnectioninterface or thegetEclipseStdin()method of an object implementing theEclipseEngineinterface.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the queue (both eclipse and Java sides), removing any listener.voidflush()Calls the superclass'flushmethodvoidremoveListener()Detach any QueueListener from this ToEclipseQueue.voidsetListener(QueueListener l)Attach a QueueListener to this ToEclipseQueue for handling requests for data.voidwrite(byte[] b, int off, int len)voidwrite(int b)
-
-
-
Method Detail
-
write
public void write(int b) throws java.io.IOException- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
setListener
public void setListener(QueueListener l) throws java.io.IOException
Attach a QueueListener to this ToEclipseQueue for handling requests for data. When ECLiPSe tries to read from an empty queue with a QueueListener attached, thedataAvailable()method of the QueueListener is invoked.- Throws:
java.io.IOException
-
removeListener
public void removeListener() throws java.io.IOExceptionDetach any QueueListener from this ToEclipseQueue.- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOExceptionCalls the superclass'flushmethod- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionCloses the queue (both eclipse and Java sides), removing any listener.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream- Throws:
java.io.IOException
-
-