|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.zib.scalaris.ConnectionPolicy
public abstract class ConnectionPolicy
Defines a policy on how to select a node to connect to from a set of possible nodes and whether to automatically re-connect.
ConnectionFactory
Constructor Summary | |
---|---|
ConnectionPolicy(List<PeerNode> availableRemoteNodes)
Creates a connection policy with the given set of nodes available for connections. |
|
ConnectionPolicy(PeerNode remoteNode)
Creates a connection policy with one available node to connect to. |
Method Summary | ||
---|---|---|
void |
availableNodeAdded(PeerNode newNode)
Signals the connection policy that the given node has been added to the list of available nodes. |
|
void |
availableNodeRemoved(PeerNode removedNode)
Signals the connection policy that the given node has been removed from the list of available nodes. |
|
void |
availableNodesReset()
Signals the connection policy that the list of available nodes has been reset (cleared). |
|
void |
nodeConnectSuccess(PeerNode node)
Acts upon a successful connect attempt of the given node. |
|
void |
nodeFailed(PeerNode node)
Acts upon a failure of the given node. |
|
void |
nodeFailReset(PeerNode node)
Acts upon a failure reset of the given node. |
|
PeerNode |
selectNode()
Selects the node to connect with when establishing a connection (no failed node, no exception that has already been thrown). |
|
abstract
|
selectNode(int retry,
PeerNode failedNode,
E e)
Selects the node to (re-)connect with. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConnectionPolicy(PeerNode remoteNode)
remoteNode
- the node available for connectionspublic ConnectionPolicy(List<PeerNode> availableRemoteNodes)
availableRemoteNodes
- available nodes to connect toMethod Detail |
---|
public void availableNodeAdded(PeerNode newNode)
newNode
- the new nodepublic void availableNodeRemoved(PeerNode removedNode)
removedNode
- the removed nodepublic void availableNodesReset()
public void nodeFailed(PeerNode node)
node
- the failed nodepublic void nodeFailReset(PeerNode node)
node
- the nodepublic void nodeConnectSuccess(PeerNode node)
node
- the nodepublic PeerNode selectNode() throws UnsupportedOperationException
UnsupportedOperationException
- is thrown if the operation can not be performed, e.g. the
list is emptyConnectionFactory
public abstract <E extends Exception> PeerNode selectNode(int retry, PeerNode failedNode, E e) throws E extends Exception, UnsupportedOperationException
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 stop
UnsupportedOperationException
- is thrown if the operation can not be performed, e.g. the
list is empty
E extends Exception
Connection.connect()
,
Connection.doRPC(String, String,
com.ericsson.otp.erlang.OtpErlangList)
,
Connection.doRPC(String, String,
com.ericsson.otp.erlang.OtpErlangObject[])
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |