Hello,
I have an event being raised from a stateless bean:
Events.instance().raiseAsynchronousEvent('myProcessComplete', processId);
this works fine when I use the @Observer annotation to implement the handler:
@Name('myProcessObserver')
@Stateless
public class MyProcessObserverImpl implements MyProcessObserver{
@Observer('myProcessComplete')
public void doSomething(Integer processId){
// do something here
}
}
What I'm needing to do is have some flexibility in what observers get called so I am tring to implement by using the components.xml file:
<event type='myProcessComplete'>
<action execute='#{myProcessObserver.doSomething}' />
</event>
I want to do this so I can easily configure some different handlers in the configuration file instead of having to make code changes:
<event type='myProcessComplete'>
<action execute='#{myProcessObserver.doSomething}' />
<action execute='#{myOtherProcessObserver.doSomething}' />
</event>
When I run this I get javax.el.MethodNotFoundException for the doSomething method. It is looking for a method signature without any method parameters.
How can I use this type of configuration and still propagate the event parameters?
I tried doing this:
<event type='myProcessComplete'>
<action execute='#{myProcessObserver.doSomething(processId)}' />
</event>
and it got around the MethodNotFoundException and actually called the correct method - except the processId was null.
Any help would be greatly appreciated
Thanks
Unfortunately we're still using Seam 2.0.1 - we have plans to update, but I can't go down this road just yet.