jiface.otp.connection

abstract-connection-behaviour

AbstractConnectionObject

protocol

Maintains a connection between a Java process and a remote Erlang, Java or C node. The object maintains connection state and allows data to be sent to and received from the peer.

This abstract class provides the neccesary methods to maintain the actual connection and encode the messages and headers in the proper format according to the Erlang distribution protocol. Subclasses can use these methods to provide a more or less transparent communication channel as desired.

Note that no receive methods are provided. Subclasses must provide methods for message delivery, and may implement their own receive methods.

If an exception occurs in any of the methods in this class, the connection will be closed and must be reopened in order to resume communication with the peer. This will be indicated to the subclass by passing the exception to its deliver function.

The System property OtpConnection.trace can be used to change the initial trace level setting for all connections. Normally the initial trace level is 0 and connections are not traced unless set-trace-level is used to change the setting for a particular connection. OtpConnection.trace can be used to turn on tracing by default for all connections.

members

close

(close this)

Close the connection to the remote node.

connected?

(connected? this)

Determine if the connection is still alive.

deliver

(deliver this msg-or-exception)

Deliver messages or communication exceptions to the recipient.

get-flags

(get-flags this)

get-trace-level

(get-trace-level this)

Get the trace level for this connection.

run

(run this)

set-flags

(set-flags this flag-integer)

set-trace-level

(set-trace-level this level-integer)

Set the trace level for this connection.

connection-behaviour

ConnectionObject

protocol

Maintains a connection between a Java process and a remote Erlang, Java or C node. The object maintains connection state and allows data to be sent to and received from the peer.

Once a connection is established between the local node and a remote node, the connection object can be used to send and receive messages between the nodes and make rpc calls (assuming that the remote node is a real Erlang node).

The various receive methods are all blocking and will return only when a valid message has been received or an exception is raised.

If an exception occurs in any of the methods in this class, the connection will be closed and must be explicitely reopened in order to resume communication with the peer.

It is not possible to create an instance of this class directly. OtpConnection objects are returned by OtpSelf.connect() and OtpSelf.accept().

members

exit

(exit this dest-pid reason)

Send an exit signal to a remote process.

get-msg-count

(get-msg-count this)

Return the number of messages currently waiting in the receive queue for this connection.

get-peer

(get-peer this)

Get information about the node at the peer end of this connection.

get-self

(get-self this)

Get information about the node at the local end of this connection.

receive

(receive this)(receive this timeout)

Receive a message from a remote process.

receive-buf

(receive-buf this)(receive-buf this timeout)

Receive a raw (still encoded) message from a remote process.

receive-msg

(receive-msg this)(receive-msg this timeout)

Receive a messge complete with sender and recipient information.

receive-rpc

(receive-rpc this)

Receive an RPC reply from the remote Erlang node.

send

(send this dest msg)

Send a message to a process on a remote node. dest may be either a String or an OtpErlangPid.

send-buf

(send-buf this dest msg)

Send a pre-encoded message to a process on a remote node. dest may be either a String or an OtpErlangPid.

send-rpc

(send-rpc this mod fun args)

Send an RPC request to the remote Erlang node. args may be either an array of OtpErlangObjects or an OtpErlangList.