Search in sources :

Example 1 with RelayerSupportingSessionServer

use of port.sessionserver.relay.RelayerSupportingSessionServer in project GIPC by pdewan.

the class ARelayerConnectingConnectListener method participateInSession.

@Override
protected void participateInSession() {
    ConnectionListener connectionListener = ASessionServerClientLauncher.createParticipatingConnectionListener(inputPort, participantChoice, ARelayerSupportingSessionServer.class, serverPortDescription, sessionObserver, uiCreator);
    ServerPortDescription relayerDesccription = ((RelayerSupportingSessionServer) sessionServerProxy).getRelayerDescripton(sessionName);
    if (relayerDesccription == null) {
        relayerPort = (DuplexRPCClientInputPort) inputPort;
    // relayerPort.addReceiveListener(receiveListener);
    // connectionListener.connected(relayerPort.getLogicalRemoteEndPoint()); // fake a connection
    // return;
    } else {
        relayerPort = DuplexRPCInputPortSelector.createDuplexRPCClientInputPort(relayerDesccription.getHost(), relayerDesccription.getID(), relayerDesccription.getName(), myName);
    }
    try {
        relayerProxy = (Relayer) DirectedRPCProxyGenerator.generateRPCProxy((DuplexRPCClientInputPort) relayerPort, null, ARelayer.class, null);
    } catch (Exception e) {
        e.printStackTrace();
    }
    if (// JOIN_ONLY
    sessionObserver != null)
        sessionObserver.setRelayerProxy(relayerProxy);
    // relayerPort.addConnectionListener(
    // ASessionServerClientLauncher.createParticipatingConnectionListener(
    // inputPort, participantChoice, RelayerSupportingSessionServer.class,  serverPortDescription, sessionObserver, uiCreator));
    relayerPort.addReceiveListener(receiveListener);
    if (relayerPort != inputPort) {
        relayerPort.addConnectionListener(connectionListener);
        // relayerPort.addReceiveListener(receiveListener);
        relayerPort.connect();
    } else {
        // fake a connection
        connectionListener.connected(relayerPort.getLogicalRemoteEndPoint(), null);
    }
}
Also used : ServerPortDescription(port.sessionserver.ServerPortDescription) RelayerSupportingSessionServer(port.sessionserver.relay.RelayerSupportingSessionServer) ARelayerSupportingSessionServer(port.sessionserver.relay.ARelayerSupportingSessionServer) ConnectionListener(inputport.ConnectionListener)

Example 2 with RelayerSupportingSessionServer

use of port.sessionserver.relay.RelayerSupportingSessionServer 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 3 with RelayerSupportingSessionServer

use of port.sessionserver.relay.RelayerSupportingSessionServer in project GIPC by pdewan.

the class ADelayingSessionsServerLauncher method main.

// public static int RELAYER_PORT = 9091;
// public static String RELAYER_NAME = "Relayer";
public static void main(String[] args) {
    Tracer.showInfo(true);
    // Message.setKeyWordStatus(Message.ALL_KEYWORDS, false);
    // Message.setKeyWordStatus("nioip", true);
    DelayUtlity.setDelayServerBufferSends();
    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);
    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();
// DuplexRPCServerInputPort relayerPort = DuplexRPCInputPortSelector.createDuplexRPCServerInputPort("" +
// 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) DuplexRPCServerInputPort(inputport.rpc.duplex.DuplexRPCServerInputPort) ARelayerSupportingSessionServer(port.sessionserver.relay.ARelayerSupportingSessionServer)

Example 4 with RelayerSupportingSessionServer

use of port.sessionserver.relay.RelayerSupportingSessionServer 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 5 with RelayerSupportingSessionServer

use of port.sessionserver.relay.RelayerSupportingSessionServer 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)

Aggregations

RelayerSupportingSessionServer (port.sessionserver.relay.RelayerSupportingSessionServer)5 ServerPortDescription (port.sessionserver.ServerPortDescription)4 AServerPortDescription (port.sessionserver.AServerPortDescription)3 ARelayerSupportingSessionServer (port.sessionserver.relay.ARelayerSupportingSessionServer)3 DuplexRPCClientInputPort (inputport.rpc.duplex.DuplexRPCClientInputPort)2 DuplexRPCServerInputPort (inputport.rpc.duplex.DuplexRPCServerInputPort)2 GroupRPCServerInputPort (inputport.rpc.group.GroupRPCServerInputPort)2 ARelayer (port.relay.ARelayer)2 Relayer (port.relay.Relayer)2 ConnectionListener (inputport.ConnectionListener)1