public class Connection
extends java.lang.Object
OtpConnection and allows automatic re-connects using a
ConnectionPolicy object.| Constructor | Description |
|---|---|
Connection(com.ericsson.otp.erlang.OtpSelf self,
ConnectionPolicy connectionPolicy) |
Creates a new connection between the a self node and one of the
remoteNodes, selected by the connectionPolicy.
|
Connection(com.ericsson.otp.erlang.OtpSelf self,
PeerNode remote) |
Creates a new connection using the given nodes and a default connection
policy.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Closes the connection to the remote node.
|
com.ericsson.otp.erlang.OtpErlangObject |
doRPC(java.lang.String mod,
java.lang.String fun,
com.ericsson.otp.erlang.OtpErlangList args) |
Sends the given RPC and waits for a result.
|
com.ericsson.otp.erlang.OtpErlangObject |
doRPC(java.lang.String mod,
java.lang.String fun,
com.ericsson.otp.erlang.OtpErlangObject[] args) |
Sends the given RPC and waits for a result.
|
com.ericsson.otp.erlang.OtpConnection |
getConnection() |
Gets the encapsulated OTP connection object.
|
PeerNode |
getRemote() |
Gets the remote node connected to.
|
com.ericsson.otp.erlang.OtpSelf |
getSelf() |
Gets the local node used for the connection.
|
void |
sendRPC(java.lang.String mod,
java.lang.String fun,
com.ericsson.otp.erlang.OtpErlangList args) |
Sends the given RPC and returns immediately.
|
void |
sendRPC(java.lang.String mod,
java.lang.String fun,
com.ericsson.otp.erlang.OtpErlangObject[] args) |
Sends the given RPC and returns immediately.
|
public Connection(com.ericsson.otp.erlang.OtpSelf self,
PeerNode remote)
throws java.net.UnknownHostException,
java.io.IOException,
com.ericsson.otp.erlang.OtpAuthException
self - the local noderemote - the remote node to connect tojava.net.UnknownHostException - if the remote host could not be foundjava.io.IOException - if it was not possible to connect to the remote nodecom.ericsson.otp.erlang.OtpAuthException - if the connection was refused by the remote nodepublic Connection(com.ericsson.otp.erlang.OtpSelf self,
ConnectionPolicy connectionPolicy)
throws java.net.UnknownHostException,
java.io.IOException,
com.ericsson.otp.erlang.OtpAuthException
self - the local nodeconnectionPolicy - the connection policy to usejava.net.UnknownHostException - if the remote host could not be foundjava.io.IOException - if it was not possible to connect to the remote nodecom.ericsson.otp.erlang.OtpAuthException - if the connection was refused by the remote nodepublic com.ericsson.otp.erlang.OtpErlangObject doRPC(java.lang.String mod,
java.lang.String fun,
com.ericsson.otp.erlang.OtpErlangList args)
throws ConnectionException
mod - the module of the function to callfun - the function to callargs - the function's argumentsConnectionException - if the connection is not active, a communication error
occurs, an exit signal is received from a process on the
peer node or the remote node sends a message containing an
invalid cookiepublic com.ericsson.otp.erlang.OtpErlangObject doRPC(java.lang.String mod,
java.lang.String fun,
com.ericsson.otp.erlang.OtpErlangObject[] args)
throws ConnectionException
mod - the module of the function to callfun - the function to callargs - the function's argumentsConnectionException - if the connection is not active, a communication error
occurs, an exit signal is received from a process on the
peer node or the remote node sends a message containing an
invalid cookiepublic void sendRPC(java.lang.String mod,
java.lang.String fun,
com.ericsson.otp.erlang.OtpErlangList args)
throws ConnectionException
mod - the module of the function to callfun - the function to callargs - the function's argumentsConnectionException - if the connection is not active, a communication error
occurs, an exit signal is received from a process on the
peer node or the remote node sends a message containing an
invalid cookiepublic void sendRPC(java.lang.String mod,
java.lang.String fun,
com.ericsson.otp.erlang.OtpErlangObject[] args)
throws ConnectionException
mod - the module of the function to callfun - the function to callargs - the function's argumentsConnectionException - if the connection is not active, a communication error
occurs, an exit signal is received from a process on the
peer node or the remote node sends a message containing an
invalid cookiepublic void close()
public com.ericsson.otp.erlang.OtpSelf getSelf()
public PeerNode getRemote()
public com.ericsson.otp.erlang.OtpConnection getConnection()