use of org.jgroups.blocks.RpcDispatcher in project JGroups by belaban.
the class RpcDispatcherBlocking method start.
public void start() throws Exception {
int c;
RspList rsps;
// default props
channel = new JChannel();
disp = new RpcDispatcher(channel, this).setReceiver(this);
channel.connect("rpc-test");
while (true) {
System.out.println("[x]: exit [s]: send sync group RPC");
System.out.flush();
c = System.in.read();
switch(c) {
case 'x':
channel.close();
disp.stop();
return;
case 's':
rsps = sendGroupRpc();
System.out.println("responses:\n" + rsps);
break;
}
System.in.skip(System.in.available());
}
}
use of org.jgroups.blocks.RpcDispatcher in project JGroups by belaban.
the class UnicastTestRpc method init.
public void init(String props, final String name, String cluster_name) throws Exception {
if (cluster_name != null)
groupname = cluster_name;
channel = new JChannel(props);
if (name != null)
channel.setName(name);
disp = new RpcDispatcher(channel, this).setMethodLookup(id -> METHODS[id]).setReceiver(this);
channel.connect(groupname);
local_addr = channel.getAddress();
try {
MBeanServer server = Util.getMBeanServer();
JmxConfigurator.registerChannel(channel, server, "jgroups", channel.getClusterName(), true);
} catch (Throwable ex) {
System.err.println("registering the channel in JMX failed: " + ex);
}
}
use of org.jgroups.blocks.RpcDispatcher in project JGroups by belaban.
the class FlowControlUnitTest method setup.
@BeforeMethod
protected void setup() throws Exception {
a = create("A");
b = create("B");
da = new RpcDispatcher(a, this);
db = new RpcDispatcher(b, this);
a.connect("FlowControlUnitTest");
b.connect("FlowControlUnitTest");
received_msgs.reset();
}
use of org.jgroups.blocks.RpcDispatcher in project wildfly by wildfly.
the class ForkChannelTransport method createRpcDispatcher.
@Override
protected RpcDispatcher createRpcDispatcher() {
RpcDispatcher dispatcher = super.createRpcDispatcher();
dispatcher.setResponseMarshaller(this);
return dispatcher;
}
use of org.jgroups.blocks.RpcDispatcher in project JGroups by belaban.
the class QuoteServer method start.
public void start() {
try {
channel = new JChannel(props);
disp = (RpcDispatcher) new RpcDispatcher(channel, this).setMembershipListener(this).setStateListener(this);
channel.connect(channel_name);
System.out.println("\nQuote Server started at " + new Date());
System.out.println("Joined channel '" + channel_name + "' (" + channel.getView().size() + " members)");
channel.getState(null, 0);
System.out.println("Ready to serve requests");
} catch (Exception e) {
log.error("QuoteServer.start() : " + e);
System.exit(-1);
}
}
Aggregations