Re: Barracuda: Automatic creation of ListenerFactories?
Jacob Kjome <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
Well, you can avoid the creating the inner classes with:
specifyLocalEventInterests(new
EventConnectorFactory(DoUpdateAccountHandler.class), DoUpdateAccount.class);
Your handler doesn't need to be an inner class in this case. Of course it
can, but you have a choice.
Other than that, I think Christian had some thoughts about possibly getting
rid of the need for specifyLocalEventInterests() altogether....at least I
think that is what it was? Well, I'll let him comments about that.
Jake
At 12:43 PM 12/4/2002 -0800, you wrote:
>This may have come up before, but has anyone given any thought to having the
>ApplicationAssembler automatically create ListenerFactories based on the
>assembly descriptor file?
>
>For instance, instead of having a lot of lines like this in my gateways:
>
>private ListenerFactory doUpdateAccountFactory = new DefaultListenerFactory()
>{public BaseEventListener getInstance() {return new
>DoUpdateAccountHandler();} public String getListenerID() {return
>getID(DoUpdateAccountHandler.class);}};
>
>I would love to put something like this into my descriptor instead:
>
><event-interest handler="DoUpdateAccountHandler"
>factoryClass="DefaultListenerFactory"
>event="com.eb5.website.events.DoUpdateAccount" />
>
>...and have the ApplicationAssembler create the factories for me. Or maybe
>the factory should be seperate to better support multiple listeners/events
>like this:
>
><factory name="doUpdateAccountFactory" handler="DoUpdateAccountHandler"
>factoryClass="DefaultListenerFactory" />
>
>Then the <event-interest>s would stay as they are now:
>
><event-interest factory="doUpdateAccountFactory"
>event="com.eb5.website.events.DoUpdateAccount" />
>
>One thing to note, my handler classes are usually inner classes of the
>gateway
>and I don't know how that would affect things. Thoughts anyone?
>
>Ron
>
>_______________________________________________
>Barracuda mailing list
>[email protected]
>http://www.enhydra.org/mailman/listinfo.cgi/barracuda
>FAQ - http://www.jguru.com/faq/Barracuda