public class FixedNodeConnectionPolicy extends ConnectionPolicy
ConnectionPolicy
which only supports a single node
and does not issue automatic re-tries.DefaultConnectionPolicy
Constructor and Description |
---|
FixedNodeConnectionPolicy(PeerNode remoteNode)
Creates a new connection policy working with the given remote node.
|
FixedNodeConnectionPolicy(String remoteNode)
Creates a new connection policy working with the given remote node.
|
Modifier and Type | Method and Description |
---|---|
<E extends Exception> |
selectNode(int retry,
PeerNode failedNode,
E e)
Selects the node to (re-)connect with.
|
availableNodeAdded, availableNodeRemoved, availableNodesReset, nodeConnectSuccess, nodeFailed, nodeFailReset, selectNode
public FixedNodeConnectionPolicy(PeerNode remoteNode)
remoteNode
- the (only) available remote nodepublic FixedNodeConnectionPolicy(String remoteNode)
remoteNode
- the (only) available remote nodepublic <E extends Exception> PeerNode selectNode(int retry, PeerNode failedNode, E e) throws E extends Exception, UnsupportedOperationException
ConnectionPolicy
selectNode
in class ConnectionPolicy
E
- the type of the exception that came from the failed connection
and may be re-thrownretry
- the n'th retry (initial connect = 0, 1st reconnect = 1,...)failedNode
- the node from the previous connection attempt or null
e
- the exception that came back from the previous connection
attempt or null
E
- if thrown, automatic re-connection attempts will stopUnsupportedOperationException
- is thrown if the operation can not be performed, e.g. the
list is emptyE extends Exception
Connection.connect()
,
Connection.doRPC(String, String,
com.ericsson.otp.erlang.OtpErlangList)
,
Connection.doRPC(String, String,
com.ericsson.otp.erlang.OtpErlangObject[])