Search in sources :

Example 6 with AServerPortDescription

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

Example 7 with AServerPortDescription

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

Example 8 with AServerPortDescription

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();
    }
}
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)

Example 9 with AServerPortDescription

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);
}
Also used : ServerPortDescription(port.sessionserver.ServerPortDescription) AServerPortDescription(port.sessionserver.AServerPortDescription) RelayerSupportingSessionServer(port.sessionserver.relay.RelayerSupportingSessionServer) DuplexRPCClientInputPort(inputport.rpc.duplex.DuplexRPCClientInputPort) AServerPortDescription(port.sessionserver.AServerPortDescription)

Example 10 with AServerPortDescription

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();
    }
}
Also used : AServerPortDescription(port.sessionserver.AServerPortDescription) ServerPortDescription(port.sessionserver.ServerPortDescription) AServerPortDescription(port.sessionserver.AServerPortDescription)

Aggregations

AServerPortDescription (port.sessionserver.AServerPortDescription)12 ServerPortDescription (port.sessionserver.ServerPortDescription)9 GroupRPCServerInputPort (inputport.rpc.group.GroupRPCServerInputPort)6 DuplexRPCClientInputPort (inputport.rpc.duplex.DuplexRPCClientInputPort)3 RelayerSupportingSessionServer (port.sessionserver.relay.RelayerSupportingSessionServer)3 ARelayer (port.relay.ARelayer)2 Relayer (port.relay.Relayer)2 APrintingSessionObserver (port.sessionserver.example.APrintingSessionObserver)2 DuplexRPCServerInputPort (inputport.rpc.duplex.DuplexRPCServerInputPort)1 GenericRelayingCollaborativeFrostyModel (port.relay.mvc.example.GenericRelayingCollaborativeFrostyModel)1 JoinInfo (port.sessionserver.JoinInfo)1 SessionObserver (port.sessionserver.SessionObserver)1 SessionServer (port.sessionserver.SessionServer)1 ARelayerSupportingSessionServer (port.sessionserver.relay.ARelayerSupportingSessionServer)1 ARelayingSession (port.sessionserver.relay.ARelayingSession)1 RelayingSession (port.sessionserver.relay.RelayingSession)1 LatecomerSessionServer (port.sessionserver.relay.late.LatecomerSessionServer)1 Adder (sessionport.rpc.duplex.relayed.example.Adder)1 AnAdder (sessionport.rpc.duplex.relayed.example.AnAdder)1