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.

send-buf

(send-buf this desg msg)

Send a pre-encoded message to a process on a remote node.

send-rpc

(send-rpc this mod fun args)

Send an RPC request to the remote Erlang node.

EpmdObject

protocol

Provides methods for registering, unregistering and looking up nodes with the Erlang portmapper daemon (Epmd). For each registered node, Epmd maintains information about the port on which incoming connections are accepted, as well as which versions of the Erlang communication protocol the node supports.

Nodes wishing to contact other nodes must first request information from Epmd before a connection can be set up, however this is done automatically by OtpSelf.connect() when necessary.

The methods publishPort() and unPublishPort() will fail if an Epmd process is not running on the localhost. Additionally lookupPort() will fail if there is no Epmd process running on the host where the specified node is running. See the Erlang documentation for information about starting Epmd.

This class contains only static methods, there are no constructors.

lookup-names

(lookup-names)(lookup-names inet-addr)(lookup-names inet-addr transport)

lookup-port

(lookup-port node)

Determine what port a node listens for incoming connections on.

publish-port

(publish-port node)

Register with Epmd, so that other nodes are able to find and connect to it.

unpublish-port

(unpublish-port node)

Unregister from Epmd.

use-port

(use-port port-num)

Set the port number to be used to contact the epmd process.