|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Dynamically access services inside a serviceHello, I'm working now on a prototype for evaluating HiveMind in our company. I need to do something like that:
1. One service receiving via configuration a list of other services (all implementing the same interface) 2. That service at runtime (basing on its input parameters) chooses the right service from that list and invokes it. For doing that I've written something like this: - configuration (hivemodule.xml): <service-point id="BarAction" interface="Action"> <invoke-factory model="singleton"> <construct class="actions.BarAction" /> </invoke-factory> </service-point> (...) <contribution configuration-id="foo.FooActions"> <action name="bar" action="foo.BarAction" /> </contribution> - service: Registry registry = RegistryBuilder.constructDefaultRegistry(); (...) Action action = (Action) registry.getService(configuration.getAction(), Action.class); Is that the only way for doing that? I would like not to use RegistryBuilder inside my services, perhaps having in the configuration something as (a-la-tapestry): <action name="bar" action="service:BarAction" /> Is it possible? Thanks in advance |
|
|
Re: Dynamically access services inside a serviceI'd probably do it like this:
<action name="bar" object="service:foo.Bar" /> On 3/8/07, Roberto Fasciolo <roberto.fasciolo@...> wrote:
|
| Free embeddable forum powered by Nabble | Forum Help |