use of port.relay.Relayer in project GIPC by pdewan.
the class ARelayerConnectionListener method initInputPort.
@Override
public void initInputPort(InputPort anInputPort) {
super.initInputPort(anInputPort);
Relayer relayerProxy = (Relayer) ((DuplexRPCInputPort) inputPort).getRPCProxyGenerator().generateRPCProxy(ARelayer.class);
addModelAsReceiveListener();
// ((DuplexRPCClientInputPort) inputPort).addReceiveListener(model);
model.setRelayer(relayerProxy);
}
use of port.relay.Relayer 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();
}
use of port.relay.Relayer 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);
}
Aggregations