Package com.parctechnologies.eclipse
Class RemoteEclipse
java.lang.Object
com.parctechnologies.eclipse.EclipseConnectionImpl
com.parctechnologies.eclipse.RemoteEclipse
- All Implemented Interfaces:
EclipseConnection
Remote connection to an existing ECLiPSe process. The connection may be made
over a TCP/IP network to an ECLiPSe which has been primed using the
remote_connect/3 or the remote_connect_setup/3
builtin predicates. As well as the functionality provided by the
EclipseConnection interface, RemoteEclipse also allows for
execution control to be transferred explicity over to ECLiPSe with the
resume() method.
The connection is terminated from the Java side using either the
disconnect() method (when Java has execution control) or
unilateralDisconnect() (when ECLiPSe has execution control).
If the builtin predicate remote_disconnect/1 is executed on
the ECLiPSe side, the effect on the Java side are similar to the
effects of disconnect().
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRemoteEclipse(InetAddress remoteEclipseHost, int remoteEclipsePort) Make a connection to an existing ECLiPSe process.RemoteEclipse(InetAddress remoteEclipseHost, int remoteEclipsePort, int timeoutMillis) Make a connection to an existing ECLiPSe process.RemoteEclipse(InetAddress remoteEclipseHost, int remoteEclipsePort, String passwd) Make a connection to an existing ECLiPSe process.RemoteEclipse(InetAddress remoteEclipseHost, int remoteEclipsePort, String passwd, int timeoutMillis) Make a connection to an existing ECLiPSe process. -
Method Summary
Modifier and TypeMethodDescriptionvoidTerminate the remote connection to ECLiPSe.voidresume()Explicitly transfer execution control to ECLiPSe.voidTerminate the connection with ECLiPSe unilaterally.Methods inherited from class com.parctechnologies.eclipse.EclipseConnectionImpl
compile, getAsyncEclipseQueue, getFromEclipseQueue, getPath, getPeerName, getToEclipseQueue, registerMultitask, rpc, rpc, rpc, rpc, rpc, rpc, rpc, rpc, rpcMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.parctechnologies.eclipse.EclipseConnection
compile, getAsyncEclipseQueue, getFromEclipseQueue, getPath, getPeerName, getToEclipseQueue, registerMultitask, rpc, rpc, rpc, rpc, rpc, rpc, rpc, rpc, rpc
-
Field Details
-
DEFAULT_TIMEOUT_MILLIS
public static final int DEFAULT_TIMEOUT_MILLIS- See Also:
-
-
Constructor Details
-
RemoteEclipse
public RemoteEclipse(InetAddress remoteEclipseHost, int remoteEclipsePort, String passwd) throws IOException Make a connection to an existing ECLiPSe process. The ECLiPSe process must be on a server machine which is reachable on a TCP/IP network. ECLiPSe must be primed usingremote_connect_setup/3. The builtin predicateremote_connect_accept/6should then be used to complete the connection. The connection details (IP address, port number, password) are specified as parameters and must match those specified/returned as arguments in the execution ofremote_connect_setup/3andremote_connect_accept/6.- Throws:
IOException- if the connection could not be made, or times out withinDEFAULT_TIMEOUT_MILLISmilliseconds.
-
RemoteEclipse
Make a connection to an existing ECLiPSe process. The ECLiPSe process must be on a server machine which is reachable on a TCP/IP network. ECLiPSe must be primed usingremote_connect/3. The connection details (IP address, port number) are specified as parameters and must match those specified/returned as arguments in the execution ofremote_connect/3. Ifremote_connect_setup/3. was used to prime ECLiPSe for the remote connection, this constructor will fail as it does not use a password.- Throws:
IOException- if the connection could not be made, or times out withinDEFAULT_TIMEOUT_MILLISmilliseconds.
-
RemoteEclipse
public RemoteEclipse(InetAddress remoteEclipseHost, int remoteEclipsePort, int timeoutMillis) throws IOException Make a connection to an existing ECLiPSe process. The ECLiPSe process must be on a server machine which is reachable on a TCP/IP network. ECLiPSe must be primed usingremote_connect/3. The connection details (IP address, port number) are specified as parameters and must match those specified/returned as arguments in the execution ofremote_connect/3. Ifremote_connect_setup/3. was used to prime ECLiPSe for the remote connection, this constructor will fail as it does not use a password.- Parameters:
timeoutMillis- number of milliseconds to wait for the initial connection to be established before throwing an exception. SettimeoutMillisto 0 to wait indefinitely for the connection.- Throws:
IOException- if the connection could not be made, or times out withintimeoutMillismilliseconds.
-
RemoteEclipse
public RemoteEclipse(InetAddress remoteEclipseHost, int remoteEclipsePort, String passwd, int timeoutMillis) throws IOException Make a connection to an existing ECLiPSe process. The ECLiPSe process must be on a server machine which is reachable on a TCP/IP network. ECLiPSe must be primed usingremote_connect_setup/3. The builtin predicateremote_connect_accept/6should then be used to complete the connection. The connection details (IP address, port number, password) are specified as parameters and must match those specified/returned as arguments in the execution ofremote_connect_setup/3andremote_connect_accept/6.- Parameters:
timeoutMillis- number of milliseconds to wait for the initial connection to be established before throwing an exception. SettimeoutMillisto 0 to wait indefinitely for the connection.- Throws:
IOException- if the connection could not be made, or times out withintimeoutMillismilliseconds.
-
-
Method Details
-
unilateralDisconnect
Terminate the connection with ECLiPSe unilaterally. This method should be invoked in unforseen circumstances when the connection should be terminated while ECLiPSe has execution control. AfterunilateralDisconnecthas been invoked, public methods invoked on this RemoteEclipse will throw EclipseTerminatedExceptions.- Throws:
EclipseTerminatedException- if the connection has already been terminated.
-
disconnect
Terminate the remote connection to ECLiPSe. This should be invoked while Java has control. If ECLiPSe has control then useunlateralDisconnectinstead. Afterdisconnecthas been invoked, public methods invoked on this RemoteEclipse will throw EclipseTerminatedExceptions.- Throws:
EclipseTerminatedException- if the connection has already been terminated.IOException- if there was a problem communicating with ECLiPSe during disconnection.
-
resume
Explicitly transfer execution control to ECLiPSe. ECLiPSe will resume execution immediately after the last goal which transferred control to Java (normallyremote_connect/3orremote_connect_setup/3). This method should not be invoked while control has been transferred to Java using a QueueListener. An invocation ofresume()should normally be paired with an execution of the builtin predicateremote_yield/1, which can return execution control to Java.- Throws:
EclipseTerminatedException- if the connection to ECLiPSe has been terminated.IOException- if there was a problem communicating with ECLiPSe.
-