public class FakeClusterPeer extends Object implements cloud.orbit.actors.cluster.ClusterPeer
Using this peer is considerably faster than using jgroups during the tests.
It's recommended to use the fake network for application unit tests.| Constructor and Description |
|---|
FakeClusterPeer() |
| Modifier and Type | Method and Description |
|---|---|
<K,V> ConcurrentMap<K,V> |
getCache(String name) |
Task<Void> |
join(String clusterName,
String nodeName) |
void |
leave() |
cloud.orbit.actors.cluster.NodeAddress |
localAddress() |
void |
onMessageReceived(cloud.orbit.actors.cluster.NodeAddress from,
byte[] buff) |
void |
onViewChanged(List<cloud.orbit.actors.cluster.NodeAddress> newView) |
void |
registerMessageReceiver(cloud.orbit.actors.cluster.MessageListener messageListener) |
void |
registerViewListener(cloud.orbit.actors.cluster.ViewListener viewListener) |
void |
sendMessage(cloud.orbit.actors.cluster.NodeAddress to,
byte[] message) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpulsepublic Task<Void> join(String clusterName, String nodeName)
join in interface cloud.orbit.actors.cluster.ClusterPeerpublic void leave()
leave in interface cloud.orbit.actors.cluster.ClusterPeerpublic void onViewChanged(List<cloud.orbit.actors.cluster.NodeAddress> newView)
public void onMessageReceived(cloud.orbit.actors.cluster.NodeAddress from, byte[] buff)
public cloud.orbit.actors.cluster.NodeAddress localAddress()
localAddress in interface cloud.orbit.actors.cluster.ClusterPeerpublic void registerViewListener(cloud.orbit.actors.cluster.ViewListener viewListener)
registerViewListener in interface cloud.orbit.actors.cluster.ClusterPeerpublic void registerMessageReceiver(cloud.orbit.actors.cluster.MessageListener messageListener)
registerMessageReceiver in interface cloud.orbit.actors.cluster.ClusterPeerpublic void sendMessage(cloud.orbit.actors.cluster.NodeAddress to, byte[] message)
sendMessage in interface cloud.orbit.actors.cluster.ClusterPeerpublic <K,V> ConcurrentMap<K,V> getCache(String name)
getCache in interface cloud.orbit.actors.cluster.ClusterPeerCopyright © 2017 Electronic Arts Inc. All rights reserved.