I am trying to figure out how to perform runtime discovery of arbitrary services without violating IoC.
Currently, I have several services that are all accessed through an identical interface. Each service has a unique name. I would also like to be able to deploy several versions of the service inside the same merlin instance. All services have the appropriate avalon:meta tagging and resulting .x* files built by maven. (All of which I found very useful and convenient, props to all.)
I have another service that provides network hooks to these services. Currently every service that wants to be 'published' must have knowledge about the specific publisher. The relationship between publisher and service is coupled very tightly and frankly I'm rather ashamed of it. :)
What I would like to accomplish is to allow the publisher to 'discover' a running service, by name and version, in the local container. Security is not an overriding concern at this juncture, but I'd like the solution to allow for tighter control in the future.
I have considered several solutions:
1) simply setting the service name in meta data to reflect the version and then discovering by that key. I'm not sure that this would work of course, but it seems like a poor approach when the meta data is already there.
2) Attempt to design a Lifecycle pattern and custom meta data. This seems to have potential, but it seems like Merlin is already solving the problem and I just don't know where to look.
3) Stick with the tight coupling and cry myself to sleep at night.
Is there a replacement for ServiceManager/Serviceable that would allow me to resolve a service by ServiceDescriptor? Or perhaps some other mechanism entirely?
Thanks, Corey
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
