Package lupos.event.communication

Examples of lupos.event.communication.SerializingMessageService


  }

  @Override
  public void messageReceived(Object src, Serializable msg) {
    if (msg instanceof ConnectionRequest){
      SerializingMessageService msgService = (SerializingMessageService) src;
      msgService.setConnectionPort(((ConnectionRequest)msg).getPort());
     
      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;
       
      case ConnectionRequest.REQUESTTYPE_BROKER:
        // put this sub broker in a hashtable
        SubBrokerData subBroker = new SubBrokerData(msgService);
        this.subBrokers.put(subBroker.getID(), subBroker);
        subBroker.getMessageService().addDisconnectHandler(this);
        System.out.println("Registered a SubBroker connection: "+msgService.getConnectionInfo().getHost()+":"+msgService.getConnectionInfo().getPort());
       
        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


   * @throws Exception
   */
  public static void main(String[] args) throws Exception {

    // create communication channel
    SerializingMessageService msgService = new SerializingMessageService(
        TcpMessageTransport.class);
    msgService.connect(new TcpConnectInfo(
        ProducerBase.askForHostOfBroker(), 4444));

    // create new AlarmWindow
    AlarmWindow aw = new AlarmWindow();

View Full Code Here

  /**
   * This is {@link #main(String[])}. It does {@link #main(String[])}.
   */
  public static void main(String[] args) throws Exception {
    // create communication channel
    SerializingMessageService msgService = new SerializingMessageService(
        TcpMessageTransport.class);
    msgService.connect(new TcpConnectInfo("localhost", 4444));

    // start producer
    new MensaProducer(msgService, 30000).start();
  }
View Full Code Here

   * @param args command line parameter
   * @throws Exception
   */
  public static void main(String[] args) throws Exception {
    // create communication channel
    SerializingMessageService msgService = ProducerBase.connectToMaster();
   
    // create new WeatherProducer
    MoonProducer mp = new MoonProducer(msgService);
   
    // create windows to choose the country and city you want to search
View Full Code Here

  }
 
 
  public static void main(String[] args) throws Exception {
    // create communication channel
    SerializingMessageService msgService = new SerializingMessageService(TcpMessageTransport.class);
    msgService.connect(new TcpConnectInfo("localhost", 4444));
   
    // start producer
    new EbayProducer(msgService).start();
  }
View Full Code Here

 
  public static void main(String[] args) throws Exception {
   
    // create communication channel
    SerializingMessageService msgService = ProducerBase.connectToMaster();
   
    // start producer
    new BTDevicesProducer(msgService).start();
  }
View Full Code Here

  }

 
  public static void main(String[] args) throws Exception {
    // create communication channel
    SerializingMessageService msgService = ProducerBase.connectToMaster();
   
    // start producer
    new CountProducer(msgService).start();
  }
View Full Code Here

  }
 
 
  public static void main(String[] args) throws Exception {
    // create communication channel
    SerializingMessageService msgService = ProducerBase.connectToMaster();
   
    // create producer
    final ButtonClickedProducer producer = new ButtonClickedProducer(msgService);
   
    // create gui
View Full Code Here

    return null;
  }
 
  public static void main(String[] args) throws Exception {
    //Create communication channel
    SerializingMessageService msgService = ProducerBase.connectToMaster();
   
    FinanceProducer tsp = new FinanceProducer(msgService);
   
    //Show dialog message box/   
    tsp.SEARCH_SYMBOL = JOptionPane.showInputDialog("Enter Company name", tsp.SEARCH_SYMBOL);
View Full Code Here

  }

 
  public static void main(String[] args) throws Exception {
    //Create communication channel
    SerializingMessageService msgService = ProducerBase.connectToMaster();
   
    String namespace = JOptionPane.showInputDialog("Namespace", "http://localhost/events/YQLQueryProducer/");
    String query = JOptionPane.showInputDialog("query", "select * from local.search where query=\"sushi\" and location=\"san francisco, ca\" and Rating.AverageRating=\"4.5\"");
    String name = JOptionPane.showInputDialog("name", "YQLQueryProducer");
   
View Full Code Here

TOP

Related Classes of lupos.event.communication.SerializingMessageService

Copyright © 2018 www.massapicom. 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.