|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.zib.scalaris.Connection
public class Connection
Wraps an OtpConnection and allows automatic re-connects using a
ConnectionPolicy object.
| Constructor Summary | |
|---|---|
Connection(OtpSelf self,
ConnectionPolicy connectionPolicy)
Creates a new connection between the a self node and one of the remoteNodes, selected by the connectionPolicy. |
|
Connection(OtpSelf self,
PeerNode remote)
Creates a new connection using the given nodes and a default connection policy. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the connection to the remote node. |
OtpErlangObject |
doRPC(String mod,
String fun,
OtpErlangList args)
Sends the given RPC and waits for a result. |
OtpErlangObject |
doRPC(String mod,
String fun,
OtpErlangObject[] args)
Sends the given RPC and waits for a result. |
OtpConnection |
getConnection()
Gets the encapsulated OTP connection object. |
PeerNode |
getRemote()
Gets the remote node connected to. |
OtpSelf |
getSelf()
Gets the local node used for the connection. |
void |
sendRPC(String mod,
String fun,
OtpErlangList args)
Sends the given RPC and returns immediately. |
void |
sendRPC(String mod,
String fun,
OtpErlangObject[] args)
Sends the given RPC and returns immediately. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Connection(OtpSelf self,
PeerNode remote)
throws UnknownHostException,
IOException,
OtpAuthException
self - the local noderemote - the remote node to connect to
UnknownHostException - if the remote host could not be found
IOException - if it was not possible to connect to the remote node
OtpAuthException - if the connection was refused by the remote node
public Connection(OtpSelf self,
ConnectionPolicy connectionPolicy)
throws UnknownHostException,
IOException,
OtpAuthException
self - the local nodeconnectionPolicy - the connection policy to use
UnknownHostException - if the remote host could not be found
IOException - if it was not possible to connect to the remote node
OtpAuthException - if the connection was refused by the remote node| Method Detail |
|---|
public OtpErlangObject doRPC(String mod,
String fun,
OtpErlangList args)
throws ConnectionException
mod - the module of the function to callfun - the function to callargs - the function's arguments
ConnectionException - 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 cookie
public OtpErlangObject doRPC(String mod,
String fun,
OtpErlangObject[] args)
throws ConnectionException
mod - the module of the function to callfun - the function to callargs - the function's arguments
ConnectionException - 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 cookie
public void sendRPC(String mod,
String fun,
OtpErlangList args)
throws ConnectionException
mod - the module of the function to callfun - the function to callargs - the function's arguments
ConnectionException - 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 cookie
public void sendRPC(String mod,
String fun,
OtpErlangObject[] args)
throws ConnectionException
mod - the module of the function to callfun - the function to callargs - the function's arguments
ConnectionException - 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 OtpSelf getSelf()
public PeerNode getRemote()
public OtpConnection getConnection()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||