Package lupos.event.communication

Examples of lupos.event.communication.SerializingMessageService.sendMessage()


    // create communication channel
    SerializingMessageService msgService = null;
    try {
      msgService = new SerializingMessageService(TcpMessageTransport.class);
      msgService.connect(new TcpConnectInfo(JOptionPane.showInputDialog("Enter the host IP adress of the MasterBroker:", "localhost"), Integer.parseInt(JOptionPane.showInputDialog("Enter the host port of the MasterBroker:", "4444"))));
      msgService.sendMessage(new ConnectionRequest(ConnectionRequest.REQUESTTYPE_PRODUCER));
    } catch (Exception e) {
      e.printStackTrace();
    }
    return msgService;
  }
View Full Code Here


      switch (((ConnectionRequest) msg).getRequestType()){
     
      case ConnectionRequest.REQUESTTYPE_PRODUCER:
        TcpConnectInfo tcpInfo = getProducerConnectBroker();
        try {
          msgService.sendMessage(tcpInfo);
          System.out.println("Producer redirected to "+tcpInfo.getHost()+":"+tcpInfo.getPort());
        } catch (IOException e) {
          e.printStackTrace();
        }
        break;
View Full Code Here

        break;
       
      case ConnectionRequest.REQUESTTYPE_CONSUMER:
        TcpConnectInfo tcpInfo2 = getConsumerConnectBroker();
        try {
          msgService.sendMessage(tcpInfo2);
          System.out.println("Consumer redirected to "+tcpInfo2.getHost()+":"+tcpInfo2.getPort());
        } catch (IOException e) {
          e.printStackTrace();
        }
        break
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.