Search in sources :

Example 6 with ConnectionListener

use of inputport.ConnectionListener 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)

Example 7 with ConnectionListener

use of inputport.ConnectionListener in project GIPC by pdewan.

the class ABufferDuplexSessionPortLauncher method launchSessionPartipant.

public static void launchSessionPartipant(String anId, String aName, ParticipantChoice aJoinChoice) {
    // Tracer.showInfo(true);
    DuplexSessionPort<ByteBuffer> sessionPort = BufferDuplexSessionPortSelector.createBufferDuplexSessionPort("localhost", "" + SESSION_SERVER_PORT, SESSION_SERVER_NAME, "Test Session", anId, aName, ParticipantChoice.MEMBER);
    // DuplexServerInputPort<ByteBuffer> sessionPort =	new ADuplexBufferSessionPortFullP2P("localhost",
    // "" + ASessionsServer.SESSION_SERVER_PORT, ASessionsServer.SESSION_SERVER_NAME, "Test Session", anId, aName);
    // PrintingReplyingReceiveListener printingReplyingReceiveListener = new PrintingReplyingReceiveListener(sessionPort);
    ConnectionListener connectListener = new ASendingConnectListener(sessionPort);
    // sessionPort.addConnectListener(printingReplyingReceiveListener);
    sessionPort.addConnectionListener(connectListener);
    sessionPort.addReceiveListener(new ABufferDuplexReceiveListener());
    // serverInputPort.addDisconnectListener(echoingReceiveListener);
    // sessionPort.addReceiveListener(printingReplyingReceiveListener);
    sessionPort.connect();
}
Also used : ABufferDuplexReceiveListener(sessionport.datacomm.duplex.buffer.ABufferDuplexReceiveListener) ConnectionListener(inputport.ConnectionListener) ByteBuffer(java.nio.ByteBuffer) ASendingConnectListener(sessionport.datacomm.duplex.buffer.ASendingConnectListener)

Example 8 with ConnectionListener

use of inputport.ConnectionListener in project GIPC by pdewan.

the class AnObjectGroupSessionPortLauncher method launchSessionPartipant.

public static void launchSessionPartipant(String anId, String aName, ParticipantChoice aChoice) {
    // Tracer.showInfo(true);
    RelayerClientAndServerSupport.setRelayedCommunicaton(false);
    GroupSessionPort<Object> sessionPort = ObjectGroupSessionPortSelector.createObjectGroupSessionPort("localhost", "" + SESSION_SERVER_PORT, SESSION_SERVER_NAME, "Test Session", anId, aName, aChoice);
    // DuplexServerInputPort<ByteBuffer> sessionPort =	new ADuplexBufferSessionPortFullP2P("localhost",
    // "" + ASessionsServer.SESSION_SERVER_PORT, ASessionsServer.SESSION_SERVER_NAME, "Test Session", anId, aName);
    // PrintingReplyingReceiveListener printingReplyingReceiveListener = new PrintingReplyingReceiveListener(sessionPort);
    ConnectionListener connectListener = new AnObjectGroupSendingConnectListener(sessionPort);
    // sessionPort.addConnectListener(printingReplyingReceiveListener);
    sessionPort.addConnectionListener(connectListener);
    sessionPort.addReceiveListener(new AnObjectDuplexReceiveListener());
    // serverInputPort.addDisconnectListener(echoingReceiveListener);
    // sessionPort.addReceiveListener(printingReplyingReceiveListener);
    sessionPort.connect();
}
Also used : AnObjectDuplexReceiveListener(sessionport.datacomm.duplex.object.AnObjectDuplexReceiveListener) ConnectionListener(inputport.ConnectionListener)

Example 9 with ConnectionListener

use of inputport.ConnectionListener in project GIPC by pdewan.

the class AnObjectDuplexSessionPortLauncher method launchSessionPartipant.

public static void launchSessionPartipant(String anId, String aName, ParticipantChoice aJoinChoice) {
    // Tracer.showInfo(true);
    DuplexSessionPort<Object> sessionPort = ObjectDuplexSessionPortSelector.createObjectDuplexSessionPort("localhost", "" + SESSION_SERVER_PORT, SESSION_SERVER_NAME, "Test Session", anId, aName, aJoinChoice);
    ConnectionListener connectListener = new AnObjectSendingConnectListener(sessionPort);
    sessionPort.addConnectionListener(connectListener);
    sessionPort.addReceiveListener(new AnObjectDuplexReceiveListener());
    sessionPort.connect();
}
Also used : AnObjectDuplexReceiveListener(sessionport.datacomm.duplex.object.AnObjectDuplexReceiveListener) ConnectionListener(inputport.ConnectionListener)

Example 10 with ConnectionListener

use of inputport.ConnectionListener in project GIPC by pdewan.

the class ABufferGroupSessionPortLauncher method launchSessionPartipant.

// public static String SESSION_SERVER_NAME = "Sessions Server";
public static void launchSessionPartipant(String anId, String aName) {
    // Tracer.showInfo(true);
    GroupServerInputPort<ByteBuffer> sessionPort = BufferGroupSessionPortSelector.createBufferGroupSessionPort("localhost", "" + SESSION_SERVER_PORT, SessionServerLauncher.SESSION_SERVER_NAME, "Test Session", anId, aName, ParticipantChoice.MEMBER);
    // DuplexServerInputPort<ByteBuffer> sessionPort =	new ADuplexBufferSessionPortFullP2P("localhost",
    // "" + ASessionsServer.SESSION_SERVER_PORT, ASessionsServer.SESSION_SERVER_NAME, "Test Session", anId, aName);
    // PrintingReplyingReceiveListener printingReplyingReceiveListener = new PrintingReplyingReceiveListener(sessionPort);
    ConnectionListener connectListener = new AGroupSendingConnectListener(sessionPort);
    // sessionPort.addConnectListener(printingReplyingReceiveListener);
    sessionPort.addConnectionListener(connectListener);
    sessionPort.addReceiveListener(new ABufferDuplexReceiveListener());
    // serverInputPort.addDisconnectListener(echoingReceiveListener);
    // sessionPort.addReceiveListener(printingReplyingReceiveListener);
    sessionPort.connect();
}
Also used : ABufferDuplexReceiveListener(sessionport.datacomm.duplex.buffer.ABufferDuplexReceiveListener) AGroupSendingConnectListener(sessionport.datacomm.group.buffer.AGroupSendingConnectListener) ConnectionListener(inputport.ConnectionListener) ByteBuffer(java.nio.ByteBuffer)

Aggregations

ConnectionListener (inputport.ConnectionListener)14 Scanner (java.util.Scanner)6 DuplexRPCClientInputPort (inputport.rpc.duplex.DuplexRPCClientInputPort)4 AnObjectGroupSendingConnectListener (sessionport.datacomm.group.object.example.AnObjectGroupSendingConnectListener)4 Adder (sessionport.rpc.duplex.relayed.example.Adder)4 AnAdder (sessionport.rpc.duplex.relayed.example.AnAdder)4 AnEchoingObjectReceiveListener (port.delay.example.AnEchoingObjectReceiveListener)3 AnObjectGroupSendingReceiveListener (port.delay.example.AnObjectGroupSendingReceiveListener)3 AnOldGroupCallingConnectListener (sessionport.rpc.group.AnOldGroupCallingConnectListener)3 ByteBuffer (java.nio.ByteBuffer)2 ABufferDuplexReceiveListener (sessionport.datacomm.duplex.buffer.ABufferDuplexReceiveListener)2 AnObjectDuplexReceiveListener (sessionport.datacomm.duplex.object.AnObjectDuplexReceiveListener)2 DuplexRPCSessionPort (sessionport.rpc.duplex.DuplexRPCSessionPort)2 GroupRPCSessionPort (sessionport.rpc.group.GroupRPCSessionPort)2 GroupRPCServerInputPort (inputport.rpc.group.GroupRPCServerInputPort)1 ServerPortDescription (port.sessionserver.ServerPortDescription)1 ARelayerSupportingSessionServer (port.sessionserver.relay.ARelayerSupportingSessionServer)1 RelayerSupportingSessionServer (port.sessionserver.relay.RelayerSupportingSessionServer)1 ASendingConnectListener (sessionport.datacomm.duplex.buffer.ASendingConnectListener)1 ADirectObjectDuplexSessionPortFactory (sessionport.datacomm.duplex.object.direct.ADirectObjectDuplexSessionPortFactory)1