Search in sources :

Example 11 with Adder

use of sessionport.rpc.duplex.relayed.example.Adder 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 12 with Adder

use of sessionport.rpc.duplex.relayed.example.Adder in project GIPC by pdewan.

the class AModularDuplexRPCDirectSessionPortLauncher method registerRemoteObjects.

protected void registerRemoteObjects() {
    DuplexRPCSessionPort aSessionPort = (DuplexRPCSessionPort) mainPort;
    Adder adder = new AnAdder();
    aSessionPort.register(Adder.class, adder);
}
Also used : DuplexRPCSessionPort(sessionport.rpc.duplex.DuplexRPCSessionPort) Adder(sessionport.rpc.duplex.relayed.example.Adder) AnAdder(sessionport.rpc.duplex.relayed.example.AnAdder) AnAdder(sessionport.rpc.duplex.relayed.example.AnAdder)

Aggregations

Adder (sessionport.rpc.duplex.relayed.example.Adder)12 AnAdder (sessionport.rpc.duplex.relayed.example.AnAdder)11 GroupRPCServerInputPort (inputport.rpc.group.GroupRPCServerInputPort)5 ConnectionListener (inputport.ConnectionListener)4 DuplexRPCClientInputPort (inputport.rpc.duplex.DuplexRPCClientInputPort)3 AnOldGroupCallingConnectListener (sessionport.rpc.group.AnOldGroupCallingConnectListener)3 Scanner (java.util.Scanner)2 DuplexRPCSessionPort (sessionport.rpc.duplex.DuplexRPCSessionPort)2 GroupRPCSessionPort (sessionport.rpc.group.GroupRPCSessionPort)2 PrintingTypedReceiveListener (oldtypedip.PrintingTypedReceiveListener)1 PrintingReplyingObjectReceiver (port.old.PrintingReplyingObjectReceiver)1 PrintingTypedReceiveListener (port.old.PrintingTypedReceiveListener)1 AServerPortDescription (port.sessionserver.AServerPortDescription)1 ServerPortDescription (port.sessionserver.ServerPortDescription)1 SessionObserver (port.sessionserver.SessionObserver)1 SessionServer (port.sessionserver.SessionServer)1 ADirectObjectDuplexSessionPortFactory (sessionport.datacomm.duplex.object.direct.ADirectObjectDuplexSessionPortFactory)1 ACallingConnectListener (sessionport.rpc.duplex.relayed.example.ACallingConnectListener)1