Search in sources :

Example 1 with AnOldGroupCallingConnectListener

use of sessionport.rpc.group.AnOldGroupCallingConnectListener in project GIPC by pdewan.

the class AnOlderGroupRPCStaticSessionPortLauncher method launchStaticSessionPartipant.

public static void launchStaticSessionPartipant(ServerPortDescription[] aServerList, String anId, String aName) {
    Tracer.showInfo(true);
    RelayerClientAndServerSupport.setRelayedCommunicaton(false);
    GroupRPCSessionPort sessionPort = null;
    // fix this later if needed
    // GroupRPCStaticSessionPortSelector.createGroupRPCStaticSessionPort(aServerList, anId, aName, REMOTE_END_POINT, null
    // );
    ConnectionListener connectListener = new AnOldGroupCallingConnectListener(sessionPort);
    sessionPort.addConnectionListener(connectListener);
    Adder adder = new AnAdder();
    sessionPort.register(Adder.class, adder);
    Scanner in = new Scanner(System.in);
    System.out.println("Press any key to connect to peers");
    String message = in.nextLine();
    Tracer.info("About to connect to peers");
    sessionPort.connect();
}
Also used : Scanner(java.util.Scanner) GroupRPCSessionPort(sessionport.rpc.group.GroupRPCSessionPort) AnOldGroupCallingConnectListener(sessionport.rpc.group.AnOldGroupCallingConnectListener) 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 AnOldGroupCallingConnectListener

use of sessionport.rpc.group.AnOldGroupCallingConnectListener in project GIPC by pdewan.

the class AnOldestGroupRPCSessionPortLauncher method launchSessionPartipant.

public static void launchSessionPartipant(String anId, String aName) {
    Tracer.showInfo(true);
    RelayerClientAndServerSupport.setRelayedCommunicaton(false);
    GroupRPCSessionPort sessionPort = GroupRPCSessionPortSelector.createGroupRPCSessionPort("localhost", "" + SESSION_SERVER_PORT, SESSION_SERVER_NAME, "Test Session", anId, aName, ParticipantChoice.MEMBER);
    ConnectionListener connectListener = new AnOldGroupCallingConnectListener(sessionPort);
    sessionPort.addConnectionListener(connectListener);
    Adder adder = new AnAdder();
    sessionPort.register(Adder.class, adder);
    sessionPort.connect();
}
Also used : GroupRPCSessionPort(sessionport.rpc.group.GroupRPCSessionPort) AnOldGroupCallingConnectListener(sessionport.rpc.group.AnOldGroupCallingConnectListener) 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 3 with AnOldGroupCallingConnectListener

use of sessionport.rpc.group.AnOldGroupCallingConnectListener in project GIPC by pdewan.

the class AGroupRPCClientLauncher method launchClient.

public static void launchClient(String aName) {
    Tracer.showInfo(true);
    RelayerClientAndServerSupport.setRelayedCommunicaton(false);
    GroupRPCServerInputPort sessionPort = GroupRPCStaticSessionPortSelector.createGroupRPCStaticSessionPort(servers, REMOTE_END_POINT, aName, "Add Servers", ParticipantChoice.SYMMETRIC_JOIN);
    ConnectionListener connectListener = new AnOldGroupCallingConnectListener(sessionPort);
    sessionPort.addConnectionListener(connectListener);
    Adder adder = new AnAdder();
    sessionPort.register(Adder.class, adder);
    Scanner in = new Scanner(System.in);
    String message = in.nextLine();
    Tracer.info("About to connect to peers");
    sessionPort.connect();
    in.nextLine();
}
Also used : Scanner(java.util.Scanner) AnOldGroupCallingConnectListener(sessionport.rpc.group.AnOldGroupCallingConnectListener) ConnectionListener(inputport.ConnectionListener) 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)

Aggregations

ConnectionListener (inputport.ConnectionListener)3 Adder (sessionport.rpc.duplex.relayed.example.Adder)3 AnAdder (sessionport.rpc.duplex.relayed.example.AnAdder)3 AnOldGroupCallingConnectListener (sessionport.rpc.group.AnOldGroupCallingConnectListener)3 Scanner (java.util.Scanner)2 GroupRPCSessionPort (sessionport.rpc.group.GroupRPCSessionPort)2 GroupRPCServerInputPort (inputport.rpc.group.GroupRPCServerInputPort)1