use of inputport.rpc.group.GroupRPCServerInputPort in project GIPC by pdewan.
the class ALatecomerRelayerAndSessionsServerCreator method createLatecomerSessionsServerAndRelayer.
// no real difference between the two methods except the name of the relayers, what is going on
public static GroupRPCServerInputPort createLatecomerSessionsServerAndRelayer(String aSessionServerId, String aSessionsServerName, String aLogicalServerName) {
GroupRPCServerInputPort serverInputPort = GroupRPCInputPortSelector.createGroupRPCServerInputPort(aSessionServerId, aSessionsServerName);
LocalLatecomerSessionsServer sessionsServer = new ALatecomerSessionServer(serverInputPort);
serverInputPort.register(LatecomerSessionServer.class, sessionsServer);
serverInputPort.register(aLogicalServerName, sessionsServer);
Tracer.info("Created and registered Latecomer session server object connected to server port " + serverInputPort + " for " + aSessionServerId);
GroupRPCServerInputPort relayPort = serverInputPort;
LatecomerRelayer relayer = new ALatecomerRelayer(relayPort, sessionsServer);
relayPort.register(LatecomerRelayer.class, relayer);
relayPort.register(RELAYER_NAME, relayer);
Tracer.info("Created and registered relayer object connected to server port " + serverInputPort);
ServerPortDescription relayerPortDescription = new AServerPortDescription("localhost", "" + aSessionServerId, RELAYER_NAME);
sessionsServer.setRelayerDescripton(relayerPortDescription);
serverInputPort.connect();
return serverInputPort;
}
use of inputport.rpc.group.GroupRPCServerInputPort in project GIPC by pdewan.
the class ASingleResponseSessionServerCreator method createSingleResponseLatecomerSessionsServerAndRelayer.
public static GroupRPCServerInputPort createSingleResponseLatecomerSessionsServerAndRelayer(String aServerId, String aServerName, String aLogicalServerName) {
GroupRPCServerInputPort serverInputPort = ALatecomerRelayerAndSessionsServerCreator.createLatecomerSessionsServerAndRelayer(aServerId, aServerName, aLogicalServerName);
SingleResponseReplicatedClientServerUtlity.supportSingleResponse(serverInputPort);
return serverInputPort;
}
use of inputport.rpc.group.GroupRPCServerInputPort in project GIPC by pdewan.
the class ASingleResponseReplicatedGroupSessionPortServerLauncher method registerRemoteObjects.
// protected Counter createAndRegisterCounter(RPCRegistry aClientInputPort) {
// Counter counter = new ACounterWithObjectValue();
// aClientInputPort.register(counter);
// return counter;
// }
@Override
protected void registerRemoteObjects() {
GroupRPCServerInputPort aGroupServerInputPort = (GroupRPCServerInputPort) mainPort;
DuplexCounterAndSenderAwareSummer adder = new AGroupCounterAndSenderAwareSumPrinter(aGroupServerInputPort);
aGroupServerInputPort.register(adder);
}
use of inputport.rpc.group.GroupRPCServerInputPort in project GIPC by pdewan.
the class AGroupRPCAdderServerLauncher method registerRemoteObjects.
protected void registerRemoteObjects() {
Adder adder = new AnAdder();
((GroupRPCServerInputPort) mainPort).register(Adder.class, adder);
}
use of inputport.rpc.group.GroupRPCServerInputPort in project GIPC by pdewan.
the class AnOldSessionClientLauncher method launch.
public static void launch(String myHost, String myID, String myName) {
GroupRPCServerInputPort serverInputPort = GroupRPCInputPortSelector.createGroupRPCServerInputPort(myID, myName);
Adder adder = new AnAdder();
serverInputPort.register(Adder.class, adder);
serverInputPort.connect();
// SessionObserver observer = new APrintingSessionObserver();
SessionObserver observer = new AJoinerConnectingSessionObserver(myName);
ServerPortDescription sessionClientDescription = new AServerPortDescription(myHost, myID, myName);
DuplexRPCClientInputPort clientInputPort = DuplexRPCInputPortSelector.createDuplexRPCClientInputPort("localhost", "" + SESSION_SERVER_PORT, SESSION_SERVER_NAME, myName);
clientInputPort.connect();
try {
SessionServer sessionServerProxy = (SessionServer) DirectedRPCProxyGenerator.generateRPCProxy(clientInputPort, null, SessionServer.class, null);
Object retVal = sessionServerProxy.join("Test Session", sessionClientDescription, observer);
System.out.println(retVal);
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations