Search in sources :

Example 11 with GroupRPCServerInputPort

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

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

the class ASingleResponseSessionServerCreator method createSingleResponseLatecomerSessionsServerAndRelayer.

public static GroupRPCServerInputPort createSingleResponseLatecomerSessionsServerAndRelayer(String aServerId, String aServerName, String aLogicalServerName) {
    GroupRPCServerInputPort serverInputPort = ALatecomerRelayerAndSessionsServerCreator.createLatecomerSessionsServerAndRelayer(aServerId, aServerName, aLogicalServerName);
    SingleResponseReplicatedClientServerUtlity.supportSingleResponse(serverInputPort);
    return serverInputPort;
}
Also used : GroupRPCServerInputPort(inputport.rpc.group.GroupRPCServerInputPort)

Example 13 with GroupRPCServerInputPort

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

the class ASingleResponseReplicatedGroupSessionPortServerLauncher method registerRemoteObjects.

// protected Counter createAndRegisterCounter(RPCRegistry aClientInputPort) {
// Counter counter = new ACounterWithObjectValue();
// aClientInputPort.register(counter);
// return counter;
// }
@Override
protected void registerRemoteObjects() {
    GroupRPCServerInputPort aGroupServerInputPort = (GroupRPCServerInputPort) mainPort;
    DuplexCounterAndSenderAwareSummer adder = new AGroupCounterAndSenderAwareSumPrinter(aGroupServerInputPort);
    aGroupServerInputPort.register(adder);
}
Also used : DuplexCounterAndSenderAwareSummer(inputport.rpc.duplex.example.DuplexCounterAndSenderAwareSummer) AGroupCounterAndSenderAwareSumPrinter(inputport.rpc.group.example.AGroupCounterAndSenderAwareSumPrinter) GroupRPCServerInputPort(inputport.rpc.group.GroupRPCServerInputPort)

Example 14 with GroupRPCServerInputPort

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

the class AGroupRPCAdderServerLauncher method registerRemoteObjects.

protected void registerRemoteObjects() {
    Adder adder = new AnAdder();
    ((GroupRPCServerInputPort) mainPort).register(Adder.class, adder);
}
Also used : 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 15 with GroupRPCServerInputPort

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

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