I am still in the process of merlinizing (TM) this app of mine. I have reached the point where I want to add some listeners - which are components themselves - to a service. Obviously, I could do something like
public void service(ServiceManager sm) throws ServiceException { Listener l = (Listener) sm.lookup(Listener.class.getName());
this.addListener(l); }
in my service. This approach, however, leaves a lot to be desired:
(1) The service should not know about the listeners applied to it.
(2) Since none of those listeners are necessary for my application to work correctly I would prefer the set of listeners to be applied to my service to be configurable.
Are there any best practices for doing what I am trying to achieve? Currently, I am thinking about writing a lifecycle extension to that end. Is this a feasible solution? Or even better, does anybody have a working solution?
Take a look in merlin cvs.
Under the merlin/facilities/http directory you will find an example of a model listener. The http listener itself doesn't do much yet - but you will get an idea of the general approach. The listener is a component but its only deployable under the system container hierarchy.
Stephen.
Thanks, Olaf
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--
|------------------------------------------------| | Magic by Merlin | | Production by Avalon | | | | http://avalon.apache.org/merlin | | http://dpml.net/merlin/distributions/latest | |------------------------------------------------|
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]