Search in sources :

Example 1 with DuplexRPCSessionPort

use of sessionport.rpc.duplex.DuplexRPCSessionPort in project GIPC by pdewan.

the class ADuplexRPCDirectSessionPortLauncher method launchSessionPartipant.

public static void launchSessionPartipant(String anId, String aName, ParticipantChoice aChoice) {
    // Tracer.showInfo(true);
    ObjectDuplexSessionPortSelector.setDuplexSessionPortFactory(new ADirectObjectDuplexSessionPortFactory());
    // ObjectDuplexSessionPortSelector.setDuplexSessionPortFactory(
    // new ARelayingObjectDuplexSessionPortFactory());
    DuplexRPCSessionPort sessionPort = DuplexRPCSessionPortSelector.createDuplexRPCSessionPort("localhost", "" + SESSION_SERVER_PORT, SESSION_SERVER_NAME, "Test Session", anId, aName, aChoice);
    // DuplexRPCSessionPort sessionPort = DuplexRPCSessionPortSelector.createDuplexRPCSessionPort("localhost",
    // "" + SESSION_SERVER_PORT, aSessionServerName, "Test Session", anId, aName,
    // aChoice
    // );
    ConnectionListener connectListener = new ACallingConnectListener(sessionPort);
    sessionPort.addConnectionListener(connectListener);
    Adder adder = new AnAdder();
    sessionPort.register(Adder.class, adder);
    sessionPort.connect();
}
Also used : ACallingConnectListener(sessionport.rpc.duplex.relayed.example.ACallingConnectListener) ADirectObjectDuplexSessionPortFactory(sessionport.datacomm.duplex.object.direct.ADirectObjectDuplexSessionPortFactory) DuplexRPCSessionPort(sessionport.rpc.duplex.DuplexRPCSessionPort) ConnectionListener(inputport.ConnectionListener) AnAdder(sessionport.rpc.duplex.relayed.example.AnAdder) Adder(sessionport.rpc.duplex.relayed.example.Adder) AnAdder(sessionport.rpc.duplex.relayed.example.AnAdder)

Example 2 with DuplexRPCSessionPort

use of sessionport.rpc.duplex.DuplexRPCSessionPort in project GIPC by pdewan.

the class AModularDuplexRPCRelayedSessionPortLauncher 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)

Example 3 with DuplexRPCSessionPort

use of sessionport.rpc.duplex.DuplexRPCSessionPort 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)

Example 4 with DuplexRPCSessionPort

use of sessionport.rpc.duplex.DuplexRPCSessionPort in project GIPC by pdewan.

the class ADuplexRPCRelayedSessionPortLauncher method launchSessionPartipant.

public static void launchSessionPartipant(String anId, String aName, ParticipantChoice aChoice) {
    // Tracer.showInfo(true);
    // ObjectDuplexSessionPortSelector.setDuplexSessionPortFactory(
    // new ADirectObjectDuplexSessionPortFactory());
    // ObjectDuplexSessionPortSelector.setDuplexSessionPortFactory(
    // new ARelayingObjectDuplexSessionPortFactory());
    DuplexRPCSessionPort sessionPort = DuplexRPCSessionPortSelector.createDuplexRPCSessionPort("localhost", "" + SESSION_SERVER_PORT, SESSION_SERVER_NAME, "Test Session", anId, aName, aChoice);
    // DuplexRPCSessionPort sessionPort = DuplexRPCSessionPortSelector.createDuplexRPCSessionPort("localhost",
    // "" + SESSION_SERVER_PORT, aSessionServerName, "Test Session", anId, aName,
    // aChoice
    // );
    ConnectionListener connectListener = new ACallingConnectListener(sessionPort);
    sessionPort.addConnectionListener(connectListener);
    Adder adder = new AnAdder();
    sessionPort.register(Adder.class, adder);
    sessionPort.connect();
}
Also used : DuplexRPCSessionPort(sessionport.rpc.duplex.DuplexRPCSessionPort) ConnectionListener(inputport.ConnectionListener)

Example 5 with DuplexRPCSessionPort

use of sessionport.rpc.duplex.DuplexRPCSessionPort in project GIPC by pdewan.

the class ASessionPortCounterClientLauncher method createUI.

@Override
protected void createUI(InputPort anInputPort) {
    Scanner aScanner = new Scanner(System.in);
    for (; ; ) {
        System.out.println("Enter user name whose counter is to be incremented:");
        String aName = aScanner.nextLine();
        Counter aCounter = (Counter) DirectedRPCProxyGenerator.generateRPCProxy((DuplexRPCSessionPort) mainPort, aName, ACounter.class, null);
        aCounter.increment(1);
        System.out.println("New counter value:" + aCounter.getValue());
    }
}
Also used : Scanner(java.util.Scanner) Counter(examples.mvc.local.duplex.Counter) ACounter(examples.mvc.local.duplex.ACounter) ACounter(examples.mvc.local.duplex.ACounter) DuplexRPCSessionPort(sessionport.rpc.duplex.DuplexRPCSessionPort)

Aggregations

DuplexRPCSessionPort (sessionport.rpc.duplex.DuplexRPCSessionPort)5 ConnectionListener (inputport.ConnectionListener)2 Adder (sessionport.rpc.duplex.relayed.example.Adder)2 AnAdder (sessionport.rpc.duplex.relayed.example.AnAdder)2 ACounter (examples.mvc.local.duplex.ACounter)1 Counter (examples.mvc.local.duplex.Counter)1 Scanner (java.util.Scanner)1 ADirectObjectDuplexSessionPortFactory (sessionport.datacomm.duplex.object.direct.ADirectObjectDuplexSessionPortFactory)1 ACallingConnectListener (sessionport.rpc.duplex.relayed.example.ACallingConnectListener)1