[jboss-user] [JBoss Seam] - Re: Component-driven events scope

cavani do-not-reply at jboss.com
Thu Nov 30 07:36:24 EST 2006


I try this and it works good!

I alter Events from Seam Core to:


  |    private void eventProcessing(boolean create, String type, Object... parameters)
  |    {
  |       log.debug("Processing event:" + type);
  |       List<MethodBinding> list = listeners.get(type);
  |       if (list!=null)
  |       {
  |          for (MethodBinding listener: list )
  |          {
  |             listener.invoke(parameters);
  |          }
  |       }
  |       List<Init.ObserverMethod> observers = Init.instance().getObservers(type);
  |       if (observers!=null)
  |       {
  |          for (ObserverMethod observer: observers)
  |          {
  |             Object listener = Component.getInstance( observer.component.getName(), create );
  |             
  |             if (listener == null)
  |                continue;
  |             
  |             observer.component.callComponentMethod(listener, observer.method, parameters);
  |          }
  |       }
  |    }
  | 
  |    public void raiseEvent(String type, Object... parameters)
  |    {
  |       eventProcessing(true, type, parameters);
  |    }
  |    
  |    public void sendEvent(String type, Object... parameters)
  |    {
  |       eventProcessing(false, type, parameters);
  |    }
  | 

Gavin, any chances to have this or something like?

Thanks,

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990010#3990010

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3990010



More information about the jboss-user mailing list