use of port.sessionserver.AServerPortDescription in project GIPC by pdewan.
the class ALatecomerRelayerAndSessionsServerCreator method createServer.
public static GroupRPCServerInputPort createServer(String aSessionsServerName, String aSessionServerId) {
GroupRPCServerInputPort serverInputPort = GroupRPCInputPortSelector.createGroupRPCServerInputPort(aSessionServerId, aSessionsServerName);
SingleResponseReplicatedClientServerUtlity.supportSingleResponse(serverInputPort);
LocalLatecomerSessionsServer sessionsServer = new ALatecomerSessionServer(serverInputPort);
serverInputPort.register(LatecomerSessionServer.class, sessionsServer);
serverInputPort.register(aSessionsServerName, sessionsServer);
Tracer.info(sessionsServer, "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);
Tracer.info(sessionsServer, "Created and registered relayer object connected to server port " + serverInputPort);
// relayPort.register(aSessionsServerName, relayer);
ServerPortDescription relayerPortDescription = new AServerPortDescription("localhost", "" + aSessionServerId, aSessionsServerName);
Tracer.info(sessionsServer, "Registering relayer description " + relayerPortDescription + " with session server");
sessionsServer.setRelayerDescripton(relayerPortDescription);
serverInputPort.connect();
return serverInputPort;
}
use of port.sessionserver.AServerPortDescription 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 port.sessionserver.AServerPortDescription 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();
}
}
use of port.sessionserver.AServerPortDescription in project GIPC by pdewan.
the class ARelayerCreator method registerWithSessionsServer.
public static void registerWithSessionsServer(String relayerId, String relayerName, String sessionsServerHost, String sessionsServerId, String sessionsServerName) {
ServerPortDescription serverPortDescription = new AServerPortDescription("localhost", relayerId, relayerName);
DuplexRPCClientInputPort sessionServerClientPort = DuplexRPCInputPortSelector.createDuplexRPCClientInputPort(sessionsServerHost, sessionsServerId, sessionsServerName, relayerName);
RelayerSupportingSessionServer sessionsServer = (RelayerSupportingSessionServer) DirectedRPCProxyGenerator.generateRPCProxy(sessionServerClientPort, null, RelayerSupportingSessionServer.class, sessionsServerName);
sessionServerClientPort.connect();
sessionsServer.setRelayerDescripton(serverPortDescription);
}
use of port.sessionserver.AServerPortDescription in project GIPC by pdewan.
the class ABufferDuplexStaticSessionPortFullP2P method createServerPort.
// this is the part that multiserver port does not have to do. Hence multiserver port cannot be subclass of static port
protected void createServerPort() {
try {
ServerPortDescription aServerPortDescription = new AServerPortDescription(InetAddress.getLocalHost().getHostName(), id, name);
Tracer.info(this, "Asking connections manager to create server port for P2P connections");
bufferStaticSessionConnectionManager.createServerInputPort(aServerPortDescription);
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations