Class AsyncEclipseQueue


  • public class AsyncEclipseQueue
    extends java.lang.Object
    An asynchronous, bidirectional queue for communicating between ECLiPSe and Java. The following differences exist between a synchronous FromEclipseQueue/ToEclipseQueue and an asynchronous AsyncEclipseQueue:
    • an asynchronous queue can be read/written from the Java side even while the ECLiPSe side has control, e.g. during an RPC. This obviously has to happen from a different thread than the one that executes the RPC.
    • I/O operations on asynchronous queues can block, they should therefore be done from a dedicated thread.
    • the AsyncEclipseQueue class does not extend InputStream or OutputStream and can therefore not be used for I/O directly. Instead, a standard Java InputStream can be obtained from it via the getInputStream() method, and an OutputStream via the getOutputStream() method.
    • on the ECLiPSe side, an event can (and should) be raised when data arrives from the Java side. If the ECLiPSe side has control at that time, it will handle the event. Otherwise, the event handling may be deferred until ECLiPSe has control back.
    There is no public constructor; to access an AsyncEclipseQueue, use the createAsyncEclipseQueue() of an object implementing the EclipseConnection interface. But note that asynchronous queues are only implemented by the RemoteEclipse and OutOfProcessEclipse implementations, not the EmbeddedEclipse variant.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes the queue (both eclipse and Java sides)
      java.io.InputStream getInputStream()
      Gets the InputStream associated with the (bidirectional) AsyncEclipseQueue.
      java.io.OutputStream getOutputStream()
      Gets the OutputStream associated with the (bidirectional) AsyncEclipseQueue.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Closes the queue (both eclipse and Java sides)
        Throws:
        java.io.IOException
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Gets the InputStream associated with the (bidirectional) AsyncEclipseQueue. Throws an exception if the Queue is closed.
        Throws:
        java.io.IOException
      • getOutputStream

        public java.io.OutputStream getOutputStream()
                                             throws java.io.IOException
        Gets the OutputStream associated with the (bidirectional) AsyncEclipseQueue. Throws an exception if the Queue is closed.
        Throws:
        java.io.IOException