cloud.orbit.actors.cluster.ClusterPeer
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 | Description |
---|---|
FakeClusterPeer() |
Modifier and Type | Method | Description |
---|---|---|
<K,V> ConcurrentMap<K,V> |
getCache(String name) |
|
cloud.orbit.concurrent.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) |
public cloud.orbit.concurrent.Task<Void> join(String clusterName, String nodeName)
join
in interface cloud.orbit.actors.cluster.ClusterPeer
public void leave()
leave
in interface cloud.orbit.actors.cluster.ClusterPeer
public 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.ClusterPeer
public void registerViewListener(cloud.orbit.actors.cluster.ViewListener viewListener)
registerViewListener
in interface cloud.orbit.actors.cluster.ClusterPeer
public void registerMessageReceiver(cloud.orbit.actors.cluster.MessageListener messageListener)
registerMessageReceiver
in interface cloud.orbit.actors.cluster.ClusterPeer
public void sendMessage(cloud.orbit.actors.cluster.NodeAddress to, byte[] message)
sendMessage
in interface cloud.orbit.actors.cluster.ClusterPeer
public <K,V> ConcurrentMap<K,V> getCache(String name)
getCache
in interface cloud.orbit.actors.cluster.ClusterPeer
Copyright © 2018 Electronic Arts Inc. All rights reserved.