Search in sources :

Example 6 with ServerPortDescription

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

the class ASessionServerRelayerPortFactory method createRelayerPort.

public GroupRPCServerInputPort createRelayerPort(String aRelayerServerId, String aRelayerServerName, DuplexRPCClientInputPort aSessionServerClientPort, String aSessionName) {
    GroupRPCServerInputPort retVal = createRelayerPort(aRelayerServerId, aRelayerServerName);
    String myHostName = "localhost";
    try {
        myHostName = InetAddress.getLocalHost().getHostName();
    } catch (Exception e) {
        e.printStackTrace();
    }
    ServerPortDescription serverPortDescription = new AServerPortDescription(myHostName, aRelayerServerId, aRelayerServerName);
    RelayerSupportingSessionServer sessionsServer = (RelayerSupportingSessionServer) DirectedRPCProxyGenerator.generateRPCProxy(aSessionServerClientPort, null, ARelayerSupportingSessionServer.class, aSessionServerClientPort.getLogicalRemoteEndPoint());
    aSessionServerClientPort.addConnectionListener(new ASessionServerToRelayerConnectionListener(aSessionServerClientPort, sessionsServer, serverPortDescription, aSessionName));
    aSessionServerClientPort.connect();
    return retVal;
}
Also used : ServerPortDescription(port.sessionserver.ServerPortDescription) AServerPortDescription(port.sessionserver.AServerPortDescription) AServerPortDescription(port.sessionserver.AServerPortDescription) GroupRPCServerInputPort(inputport.rpc.group.GroupRPCServerInputPort)

Example 7 with ServerPortDescription

use of port.sessionserver.ServerPortDescription 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;
}
Also used : ServerPortDescription(port.sessionserver.ServerPortDescription) AServerPortDescription(port.sessionserver.AServerPortDescription) AServerPortDescription(port.sessionserver.AServerPortDescription) GroupRPCServerInputPort(inputport.rpc.group.GroupRPCServerInputPort)

Example 8 with ServerPortDescription

use of port.sessionserver.ServerPortDescription 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;
}
Also used : ServerPortDescription(port.sessionserver.ServerPortDescription) AServerPortDescription(port.sessionserver.AServerPortDescription) AServerPortDescription(port.sessionserver.AServerPortDescription) GroupRPCServerInputPort(inputport.rpc.group.GroupRPCServerInputPort)

Example 9 with ServerPortDescription

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

the class AThreeDepPortClientPseudoLauncher method doPostConnectsAsyncOperations.

@Override
protected void doPostConnectsAsyncOperations() {
    ServerPortDescription relayerPortDescription = sessionServerProxy.getRelayerDescripton(sessionName);
    JoinInfo joinInfo = joinSessionServer();
    ServerPortDescription mvcServerPortDescription = null;
    List<SessionParticipantDescription> servers = joinInfo.getServers();
    if (servers.size() > 0) {
        mvcServerPortDescription = servers.get(0);
    } else {
        mvcServerHasNotJoined();
    }
    processMemberJoinInfo(joinInfo);
    chainConnectListeners(relayerPortDescription, mvcServerPortDescription);
}
Also used : JoinInfo(port.sessionserver.JoinInfo) AServerPortDescription(port.sessionserver.AServerPortDescription) ServerPortDescription(port.sessionserver.ServerPortDescription) SessionParticipantDescription(port.sessionserver.SessionParticipantDescription)

Example 10 with ServerPortDescription

use of port.sessionserver.ServerPortDescription 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

ServerPortDescription (port.sessionserver.ServerPortDescription)14 AServerPortDescription (port.sessionserver.AServerPortDescription)11 GroupRPCServerInputPort (inputport.rpc.group.GroupRPCServerInputPort)7 RelayerSupportingSessionServer (port.sessionserver.relay.RelayerSupportingSessionServer)4 DuplexRPCClientInputPort (inputport.rpc.duplex.DuplexRPCClientInputPort)3 ARelayer (port.relay.ARelayer)2 Relayer (port.relay.Relayer)2 JoinInfo (port.sessionserver.JoinInfo)2 SessionParticipantDescription (port.sessionserver.SessionParticipantDescription)2 ARelayerSupportingSessionServer (port.sessionserver.relay.ARelayerSupportingSessionServer)2 ConnectionListener (inputport.ConnectionListener)1 DuplexRPCServerInputPort (inputport.rpc.duplex.DuplexRPCServerInputPort)1 SessionObserver (port.sessionserver.SessionObserver)1 SessionServer (port.sessionserver.SessionServer)1 ARelayingSession (port.sessionserver.relay.ARelayingSession)1 RelayingSession (port.sessionserver.relay.RelayingSession)1 Adder (sessionport.rpc.duplex.relayed.example.Adder)1 AnAdder (sessionport.rpc.duplex.relayed.example.AnAdder)1 AConnectionEvent (util.trace.port.AConnectionEvent)1