Package org.jboss.fresh.events

Examples of org.jboss.fresh.events.Event


  public void ping() throws ConnectorException {
    log.info("ping()");
    try {
      sndT = Thread.currentThread();

      Event ev = new Event(host, app, componentName, agentid, "ENet", "Ignore", null);

   
      if(reset) {
        reset = false;
        throw new ConnectorException("Reset forced");
      }

      synchronized(shellout) {
        ev.setID(String.valueOf(evid++));
        //shellout.write(pinf.procid, ev);
        shout.writeObject(ev);
        shout.flush();
      }
View Full Code Here


    if((flags & SILENT) == 0) {
      Object [] dat = new Object[2];
      dat[0] = id;
      dat[1] = new ListenerData(lis, filter);

      Event ev = new Event("ECentral", "RegisterListener", dat);
      try {
        dispatch(eb.produceEvent(ev));
      } catch(Exception ex) {
        log.warn("Dispatching of RegisterListener event produced exception: ", ex);
      }
View Full Code Here

    }
    if (takeover) {
      try {
        //Event ev = new Event(hostLabel, app, "EventNetRouterImpl", componentID, "ENet", "TakeOver", null);
        log.info("Sending ENet/TakeOver to the other side ...");
        Event ev = new Event("ENet", "TakeOver");
        ev = eb.produceEvent(ev);

        // we wait up to 10 secs for event to be sent to the other side
        // sendBuffer returns after the other side actually reads what we put in.
        // maybe we need async invocation here - just put event and forget about it
View Full Code Here

    List ls = new LinkedList();
    try {
      Map bcs = ec.getBroadcasters();
      Map lrs = ec.getListeners();
      //Event ev = new Event(hostLabel, app, "EventNetRouterImpl", agentid, "ENet", "RegisteredList", new Object [] {new ArrayList(bcs.keySet()), lrs});
      Event ev = new Event("ENet", "RegisterList", new Object[]{new ArrayList(bcs.keySet()), lrs});
      ls.add(eb.produceEvent(ev));
    } catch (Exception ex) {
      throw new RuntimeException("Event creation failed: ", ex);
    }
View Full Code Here

      }
      log.info(" " + hostLabel + "/" + app + " Unregister broadcasters lists: " + unregisterBList);
      log.info(" " + hostLabel + "/" + app + " Unregister listeners lists: " + unregisterLList);
      // send out UnregisterBroadcasters event
      if (unregisterBList.size() > 0 || unregisterLList.size() > 0) {
        ev = new Event("ENet", "UnregisterList", new Object[]{unregisterBList, unregisterLList});
        ev = eb.produceEvent(ev);

//log.info(" oo OO oo OO oo   Sending UnregisterList event : " + ev);
        // we wait up to 10 secs for event to be sent to the other side
        // sendBuffer returns after the other side actually reads what we put in.
View Full Code Here

          Iterator it = l.iterator();
          while (it.hasNext()) {
            try {
              Object o = it.next();
//ieplog.error("Received: " + o);
              Event ev = (Event) o;
              ev.addTrace(agentid + "@" + hostLabel + "/" + app + "[IN]");
              if (!checkEvent(ev)) continue;
              if ("ENet".equals(ev.getEventClass())) {
                if ("TakeOver".equals(ev.getEventName())) {
                  log.info("ENet/TakeOver received ...");
                  mustStop = true;
                  it.remove();
                  continue;
                }
                it.remove();
                processENetEvent(ev);
              }
            } catch (ConnectorException th) {
              ieplog.error("Miserably failed while preprocessing incoming data for ENet events: ", th);
              ieplog.error("Time to reset connection ...");
              con.reset();
              continue masterloop;
            } catch (Throwable th) {
              ieplog.error("Exception while preprocessing incoming data for ENet events: ", th);
            }
          }
          it = l.iterator();
          while (it.hasNext()) {
            Event ev = (Event) it.next();
            try {
              if ("ECentral".equals(ev.getEventClass())) {
                if (!processECentralEvent(ev)) continue;
              }
            } catch (Throwable th) {
              ieplog.error("Exception while processing ECentral event: " + ev, th);
            }
View Full Code Here

TOP

Related Classes of org.jboss.fresh.events.Event

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.