Class AbstractConnection

java.lang.Object
java.lang.Thread
com.ericsson.otp.erlang.AbstractConnection
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
OtpConnection, OtpCookedConnection

public abstract class AbstractConnection extends Thread
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 necessary 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 delivery() method.

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 setTraceLevel() is used to change the setting for a particular connection. OtpConnection.trace can be used to turn on tracing by default for all connections.