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, selectNodepublic 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
ConnectionPolicyselectNode in class ConnectionPolicyE - 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 nulle - the exception that came back from the previous connection
attempt or nullE - if thrown, automatic re-connection attempts will stopUnsupportedOperationException - is thrown if the operation can not be performed, e.g. the
list is emptyE extends ExceptionConnection.connect(),
Connection.doRPC(String, String,
com.ericsson.otp.erlang.OtpErlangList),
Connection.doRPC(String, String,
com.ericsson.otp.erlang.OtpErlangObject[])