Search in sources :

Example 6 with GroupRPCServerInputPort

use of inputport.rpc.group.GroupRPCServerInputPort in project GIPC by pdewan.

the class ADelayingRelayingSessionsServerLauncher method main.

public static void main(String[] args) {
    // Tracer.showInfo(true);
    // Message.setKeyWordStatus(Message.ALL_KEYWORDS, false);
    // Message.setKeyWordStatus("nioip", true);
    // GlobalState.setDelayServerBufferSends(true);
    // GlobalState.getDelayManager().setMinimumDelay("Alice", 1000);
    // GlobalState.getDelayManager().setMinimumDelay("Bob", 100);
    // GlobalState.getDelayManager().setMinimumDelay("Cathy", 500);
    // GroupRPCServerInputPort serverInputPort = GroupRPCInputPortSelector.createGroupRPCServerInputPort("" +
    // ASessionsServer.SESSION_SERVER_PORT, ASessionsServer.SESSION_SERVER_NAME);
    DuplexRPCServerInputPort serverInputPort = DuplexRPCInputPortSelector.createDuplexRPCServerInputPort("" + SESSION_SERVER_PORT, SESSION_SERVER_NAME);
    RelayerSupportingSessionServer sessionServer = new ARelayerSupportingSessionServer(serverInputPort);
    ServerPortDescription serverPortDescription = new AServerPortDescription("localhost", "" + RELAYER_PORT, RELAYER_NAME);
    sessionServer.setRelayerDescripton(serverPortDescription);
    serverInputPort.register(RelayerSupportingSessionServer.class, sessionServer);
    serverInputPort.register(SESSION_SERVER_NAME, sessionServer);
    serverInputPort.connect();
    GroupRPCServerInputPort relayerPort = GroupRPCInputPortSelector.createGroupRPCServerInputPort("" + RELAYER_PORT, RELAYER_NAME);
    Relayer relayer = new ARelayer(relayerPort);
    relayerPort.register(Relayer.class, relayer);
    serverInputPort.register(RELAYER_NAME, relayer);
    relayerPort.connect();
}
Also used : RelayerSupportingSessionServer(port.sessionserver.relay.RelayerSupportingSessionServer) ARelayerSupportingSessionServer(port.sessionserver.relay.ARelayerSupportingSessionServer) ServerPortDescription(port.sessionserver.ServerPortDescription) AServerPortDescription(port.sessionserver.AServerPortDescription) ARelayer(port.relay.ARelayer) Relayer(port.relay.Relayer) AServerPortDescription(port.sessionserver.AServerPortDescription) ARelayer(port.relay.ARelayer) DuplexRPCServerInputPort(inputport.rpc.duplex.DuplexRPCServerInputPort) ARelayerSupportingSessionServer(port.sessionserver.relay.ARelayerSupportingSessionServer) GroupRPCServerInputPort(inputport.rpc.group.GroupRPCServerInputPort)

Example 7 with GroupRPCServerInputPort

use of inputport.rpc.group.GroupRPCServerInputPort in project GIPC by pdewan.

the class ADelayingRelayerLauncher method main.

public static void main(String[] args) {
    // Tracer.showInfo(true);
    // Message.setKeyWordStatus(Message.ALL_KEYWORDS, false);
    // Message.setKeyWordStatus("nioip", true);
    // GlobalState.setDelayServerBufferSends(true);
    DelayUtlity.getDelayManager().setMinimumDelay("Alice", 1000);
    DelayUtlity.getDelayManager().setMinimumDelay("Bob", 100);
    DelayUtlity.getDelayManager().setMinimumDelay("Cathy", 500);
    // GroupRPCServerInputPort serverInputPort = GroupRPCInputPortSelector.createGroupRPCServerInputPort("" +
    // ASessionsServer.SESSION_SERVER_PORT, ASessionsServer.SESSION_SERVER_NAME);
    GroupRPCServerInputPort serverInputPort = GroupRPCInputPortSelector.createGroupRPCServerInputPort("" + RELAYER_PORT, RELAYER_NAME);
    Relayer relayer = new ARelayer(serverInputPort);
    serverInputPort.register(Relayer.class, relayer);
    serverInputPort.register(RELAYER_NAME, relayer);
    serverInputPort.connect();
    ServerPortDescription serverPortDescription = new AServerPortDescription("localhost", "" + RELAYER_PORT, RELAYER_NAME);
    DuplexRPCClientInputPort sessionServerClientPort = DuplexRPCInputPortSelector.createDuplexRPCClientInputPort("localhost", "" + ADelayingSessionsServerLauncher.SESSION_SERVER_PORT, ADelayingSessionsServerLauncher.SESSION_SERVER_NAME, RELAYER_NAME);
    RelayerSupportingSessionServer sessionsServer = (RelayerSupportingSessionServer) DirectedRPCProxyGenerator.generateRPCProxy(sessionServerClientPort, null, RelayerSupportingSessionServer.class, null);
    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) ARelayer(port.relay.ARelayer) Relayer(port.relay.Relayer) AServerPortDescription(port.sessionserver.AServerPortDescription) ARelayer(port.relay.ARelayer) GroupRPCServerInputPort(inputport.rpc.group.GroupRPCServerInputPort)

Example 8 with GroupRPCServerInputPort

use of inputport.rpc.group.GroupRPCServerInputPort in project GIPC by pdewan.

the class AGroupRPCClientLauncher method launchClient.

public static void launchClient(String aName) {
    Tracer.showInfo(true);
    RelayerClientAndServerSupport.setRelayedCommunicaton(false);
    GroupRPCServerInputPort sessionPort = GroupRPCStaticSessionPortSelector.createGroupRPCStaticSessionPort(servers, REMOTE_END_POINT, aName, "Add Servers", ParticipantChoice.SYMMETRIC_JOIN);
    ConnectionListener connectListener = new AnOldGroupCallingConnectListener(sessionPort);
    sessionPort.addConnectionListener(connectListener);
    Adder adder = new AnAdder();
    sessionPort.register(Adder.class, adder);
    Scanner in = new Scanner(System.in);
    String message = in.nextLine();
    Tracer.info("About to connect to peers");
    sessionPort.connect();
    in.nextLine();
}
Also used : Scanner(java.util.Scanner) AnOldGroupCallingConnectListener(sessionport.rpc.group.AnOldGroupCallingConnectListener) ConnectionListener(inputport.ConnectionListener) AnAdder(sessionport.rpc.duplex.relayed.example.AnAdder) Adder(sessionport.rpc.duplex.relayed.example.Adder) AnAdder(sessionport.rpc.duplex.relayed.example.AnAdder) GroupRPCServerInputPort(inputport.rpc.group.GroupRPCServerInputPort)

Example 9 with GroupRPCServerInputPort

use of inputport.rpc.group.GroupRPCServerInputPort 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 10 with GroupRPCServerInputPort

use of inputport.rpc.group.GroupRPCServerInputPort 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)

Aggregations

GroupRPCServerInputPort (inputport.rpc.group.GroupRPCServerInputPort)18 ServerPortDescription (port.sessionserver.ServerPortDescription)7 AServerPortDescription (port.sessionserver.AServerPortDescription)6 Adder (sessionport.rpc.duplex.relayed.example.Adder)5 AnAdder (sessionport.rpc.duplex.relayed.example.AnAdder)5 DuplexCounterAndSenderAwareSummer (inputport.rpc.duplex.example.DuplexCounterAndSenderAwareSummer)3 DuplexRPCClientInputPort (inputport.rpc.duplex.DuplexRPCClientInputPort)2 AGroupCounterAndSenderAwareSumPrinter (inputport.rpc.group.example.AGroupCounterAndSenderAwareSumPrinter)2 ARelayer (port.relay.ARelayer)2 Relayer (port.relay.Relayer)2 RelayerSupportingSessionServer (port.sessionserver.relay.RelayerSupportingSessionServer)2 ConnectionListener (inputport.ConnectionListener)1 DuplexRPCServerInputPort (inputport.rpc.duplex.DuplexRPCServerInputPort)1 Scanner (java.util.Scanner)1 PrintingReplyingObjectReceiver (port.old.PrintingReplyingObjectReceiver)1 SessionObserver (port.sessionserver.SessionObserver)1 SessionServer (port.sessionserver.SessionServer)1 ARelayerSupportingSessionServer (port.sessionserver.relay.ARelayerSupportingSessionServer)1 AnOldGroupCallingConnectListener (sessionport.rpc.group.AnOldGroupCallingConnectListener)1