| 
 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.parctechnologies.eclipse.EclipseConnectionImpl
com.parctechnologies.eclipse.EmbeddedEclipse
public class EmbeddedEclipse
An ECLiPSe engine embedded in the JVM process. Since there can only be one
 embedded ECLiPSe engine at any one time, there is no public constructor and you
 should use the getInstance(EclipseEngineOptions)
 method to create an embedded ECLiPSe engine if none exists.
 The EclipseEngineOptions
 object should be created, configured,
 and then passed to this method to start the ECLiPSe with user-defined options.
 Once started, a reference to the EmbeddedEclipse instance can be
 obtained using the getInstance() method.
 Note that
 once the EmbeddedEclipse has been shut down by calling its destroy() method,
 no more embedded ECLiPSe engines
 can be started using getInstance(EclipseEngineOptions).
 Here is some example code for working with an EmbeddedEclipse:
 
 // create a new EclipseEngineOptions object
 EclipseEngineOptions options = new EclipseEngineOptions(new File("C:\Eclipse\"));
 // alter the useQueues option
 options.setUseQueues(true);
 // start up the embedded Eclipse. testEclipse is a reference to the
 // Eclipse engine.
 EclipseEngine testEclipse = EmbeddedEclipse.getInstance(options);
 // Direct the Eclipse to load a source file.
 testEclipse.compile(new File(".\myEclipseSourceFile.pl"));
 // Execute a top-level goal in ECLiPSe.
 testEclipse.rpc("go");
 // Destroy the Eclipse
 ((EmbeddedEclipse) testEclipse).destroy();
 
EclipseConnection, 
EclipseEngine, 
EclipseEngineOptions| Method Summary | |
|---|---|
|  void | destroy()Terminate access to the EmbeddedEclipse. | 
|  AsyncEclipseQueue | getAsyncEclipseQueue(java.lang.String name)Create or access an asynchronous queue to transfer data between Java and ECLiPSe. | 
|  FromEclipseQueue | getEclipseStderr()Return a FromEclipseQueue which allows access to the ECLiPSe engine's stderrstream. | 
|  ToEclipseQueue | getEclipseStdin()Return a ToEclipseQueue which allows access to the ECLiPSe engine's stdinstream. | 
|  FromEclipseQueue | getEclipseStdout()Return a FromEclipseQueue which allows access to the ECLiPSe engine's stdoutstream. | 
| static EmbeddedEclipse | getInstance()Returns the unique EmbeddedEclipse object if the embedded ECLiPSe has been started, but not yet terminated in this JVM. | 
| static EmbeddedEclipse | getInstance(EclipseEngineOptions options)If the embedded ECLiPSe has not yet been started in this JVM, start the embedded ECLiPSe using the options specified in the parameter EclipseEngineOptions. | 
|  boolean | isUsingQueues()Query the ECLiPSe engine's "use queues" flag. | 
| Methods inherited from class com.parctechnologies.eclipse.EclipseConnectionImpl | 
|---|
| compile, getFromEclipseQueue, getPath, getPeerName, getToEclipseQueue, registerMultitask, rpc, rpc, rpc, rpc, rpc, rpc, rpc, rpc, rpc | 
| Methods inherited from class java.lang.Object | 
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Method Detail | 
|---|
public static EmbeddedEclipse getInstance(EclipseEngineOptions options)
                                   throws EclipseException,
                                          java.io.IOException
options - user-definable options used to configure the embedded
 ECLiPSe engine.
EclipseException - if the embedded ECLiPSe has already been started,
 or if there was some ECLiPSe-related problem whilst
 attempting to start ECLiPSe, for example if the ECLiPSe installation
 directory was not set in the supplied EclipseEngineOptions object.
EclipseTerminatedException - if the embedded ECLiPSe has already been terminated
java.io.IOException - if there is some other I/O-related problem starting the ECLiPSe engine.
public static EmbeddedEclipse getInstance()
                                   throws EclipseException,
                                          java.io.IOException
EclipseException - if ECLiPSe has not been started.
EclipseTerminatedException - if the embedded ECLiPSe has been
 terminated.
java.io.IOException
public AsyncEclipseQueue getAsyncEclipseQueue(java.lang.String name)
                                       throws EclipseException,
                                              java.io.IOException
EclipseConnection
getAsyncEclipseQueue in interface EclipseConnectiongetAsyncEclipseQueue in class EclipseConnectionImplname - the name to be used for the stream representing the queue on
 the ECLiPSe side.
EclipseException - if the name for the ECLiPSe stream is already in use,
  or ECLiPSe could not create its side of the queue for some reason.
java.io.IOException - if there was an I/O problem while accessing ECLiPSe.
EclipseTerminatedException - if this EclipseConnection has
 been terminated.
public void destroy()
             throws java.io.IOException
destroy() has been invoked, use of this EmbeddedEclipse's
 methods will throw EclipseTerminatedExceptions. Also, once 
 destroy() has been invoked, no more EmbeddedEclipse instances
 can be created during the lifetime of this Java virtual machine.
EclipseTerminatedException - if the ECLiPSe engine has already been
 terminated.
java.io.IOException - if there was a problem communicating with ECLiPSe
 during termination.
public ToEclipseQueue getEclipseStdin()
                               throws EclipseTerminatedException
EclipseEnginestdin stream. Returns null if the ECLiPSe was not set
 up to use queue objects for its standard streams (see EclipseEngineOptions).
getEclipseStdin in interface EclipseEngineEclipseTerminatedException - if the ECLiPSe engine has been destroyed
 or disconnected.
public FromEclipseQueue getEclipseStdout()
                                  throws EclipseTerminatedException
EclipseEnginestdout stream. Returns null if the ECLiPSe was not set
 up to use queue objects for its standard streams (see EclipseEngineOptions).
getEclipseStdout in interface EclipseEngineEclipseTerminatedException - if the ECLiPSe engine has been
 destroyed.
public FromEclipseQueue getEclipseStderr()
                                  throws EclipseTerminatedException
EclipseEnginestderr stream. Returns null if the ECLiPSe was not set
 up to use queue objects for its standard streams (see EclipseEngineOptions).
getEclipseStderr in interface EclipseEngineEclipseTerminatedException - if the ECLiPSe engine has been
 destroyed.public boolean isUsingQueues()
EclipseEngine
isUsingQueues in interface EclipseEngine| 
 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||