Search in sources :

Example 1 with SessionServer

use of port.sessionserver.SessionServer in project GIPC by pdewan.

the class AReplicatedSessionServerLauncher method launchServer.

public static void launchServer(String aSessionServerName, String aSessionServerPort) {
    Tracer.showInfo(true);
    DuplexRPCServerInputPort serverInputPort = DuplexRPCInputPortSelector.createDuplexRPCServerInputPort("" + aSessionServerPort, aSessionServerName);
    DuplexSingleResponseUtlity.supportSingleResponse(serverInputPort);
    SessionServer sessionServer = new ASessionServer(serverInputPort);
    // RelayerSupportingSessionsServer sessionServer = new ARelayerSupportingSessionsServer(serverInputPort);
    serverInputPort.register(RelayerSupportingSessionServer.class, sessionServer);
    serverInputPort.register(AFaultTolerantSessionPortLauncher.SESSION_SERVER_NAME, sessionServer);
    serverInputPort.connect();
}
Also used : DuplexRPCServerInputPort(inputport.rpc.duplex.DuplexRPCServerInputPort) ASessionServer(port.sessionserver.ASessionServer) ASessionServer(port.sessionserver.ASessionServer) RelayerSupportingSessionServer(port.sessionserver.relay.RelayerSupportingSessionServer) SessionServer(port.sessionserver.SessionServer)

Example 2 with SessionServer

use of port.sessionserver.SessionServer 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();
    }
}
Also used : ServerPortDescription(port.sessionserver.ServerPortDescription) AServerPortDescription(port.sessionserver.AServerPortDescription) DuplexRPCClientInputPort(inputport.rpc.duplex.DuplexRPCClientInputPort) SessionObserver(port.sessionserver.SessionObserver) AServerPortDescription(port.sessionserver.AServerPortDescription) AnAdder(sessionport.rpc.duplex.relayed.example.AnAdder) Adder(sessionport.rpc.duplex.relayed.example.Adder) AnAdder(sessionport.rpc.duplex.relayed.example.AnAdder) SessionServer(port.sessionserver.SessionServer) GroupRPCServerInputPort(inputport.rpc.group.GroupRPCServerInputPort)

Aggregations

SessionServer (port.sessionserver.SessionServer)2 DuplexRPCClientInputPort (inputport.rpc.duplex.DuplexRPCClientInputPort)1 DuplexRPCServerInputPort (inputport.rpc.duplex.DuplexRPCServerInputPort)1 GroupRPCServerInputPort (inputport.rpc.group.GroupRPCServerInputPort)1 AServerPortDescription (port.sessionserver.AServerPortDescription)1 ASessionServer (port.sessionserver.ASessionServer)1 ServerPortDescription (port.sessionserver.ServerPortDescription)1 SessionObserver (port.sessionserver.SessionObserver)1 RelayerSupportingSessionServer (port.sessionserver.relay.RelayerSupportingSessionServer)1 Adder (sessionport.rpc.duplex.relayed.example.Adder)1 AnAdder (sessionport.rpc.duplex.relayed.example.AnAdder)1