Package org.jboss.fresh.events

Examples of org.jboss.fresh.events.EventFilter


  public void registerEventListener(String name, EventListener lis, String [] filters, int flags) throws InvalidFormatException {
    registerEventListener(name, lis, filters == null ? (List) null : java.util.Arrays.asList(filters), flags);
  }

  public void registerEventListener(String id, EventListener lis, List filters) throws InvalidFormatException {
    registerEventListener(id, lis, new EventFilter(filters), 0);
  }
View Full Code Here


  public void registerEventListener(String id, EventListener lis, List filters) throws InvalidFormatException {
    registerEventListener(id, lis, new EventFilter(filters), 0);
  }

  public void registerEventListener(String id, EventListener lis, List filters, int flags) throws InvalidFormatException {
    registerEventListener(id, lis, new EventFilter(filters), flags);
  }
View Full Code Here

   */
  public void registerEventListener(String id, EventListener lis, EventFilter filter, int flags) throws InvalidFormatException {

log.info("[" + host + "/" + app + "] registerEventListener() : " + id + ", " + filter + "  :: " + lis); // , new Exception("REG TRACE")

    filter = filter==null ? new EventFilter((List)null) : new EventFilter(filter, this);

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

    // we register listeners only for those interested
    Iterator it = listenersByID.entrySet().iterator();
    while(it.hasNext()) {
      Map.Entry ent = (Map.Entry) it.next();
      EventFilter filter = ((ListenerData) ent.getValue()).getFilter();
      ec.registerEventListener((String) ent.getKey(), forwardLis, filter);
    }


    // we register all broadcasters
View Full Code Here

//log.info("matchField() " + field + " on " + ev + "  for " + ls);
    Iterator it = ls.iterator();
    while(it.hasNext()) {
      Map.Entry ent = (Map.Entry) it.next();
      ListenerData data = (ListenerData)ent.getValue();
      EventFilter filt = data.getFilter();

//log.info("Matching event " + ev + " against filter: " + filt + " (" + data.getListener() + ")    for field: " + field);

      boolean bMatch = false;
     
      switch(field) {
        case 0:
          bMatch = filt.matchHost(ev);
          break;
        case 1:
          bMatch = filt.matchApplication(ev);
          break;
        case 2:
          bMatch = filt.matchComponent(ev);
          break;
        case 3:
          bMatch = filt.matchComponentID(ev);
          break;
        case 4:
          bMatch = filt.matchEventClass(ev);
          break;
        case 5:
          bMatch = filt.matchEventName(ev);
          break;
        default:
          throw new RuntimeException("Field out of range: " + field);
      }
     
View Full Code Here

          }

          // don't process our own
          continue;
        }
        EventFilter filter = ((EventCentral.ListenerData) ent.getValue()).getFilter();
        try {
//log.info("\n\n\n REGISTERING " + ent.getKey() + " with ECentralListener: " + lis + "\n\n\n");
          ec.registerEventListener((String) ent.getKey(), lis, filter);
        } catch (InvalidFormatException ex) {
          log.error("There's EventCentral in the system that does not enforce proper names: " + ex);
View Full Code Here

TOP

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

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.