You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hivemind.apache.org by Massimo Lusetti <ml...@gmail.com> on 2006/01/23 10:52:27 UTC

Registry.getService(String id)

I would like to know if there's anything, which cannot see, against
the add of method
getService(String serviceId) to the Registry.

I'm integrating HiveMind as an option like a Mule
(http://mule.codehaus.org) container, and at first sight this could
make the whole process easier, so there's something/someone against
this particular request?
I mean mule use its own descriptor to configure the entire ESB manager
which is built on top of components, this components could be provided
by external container (such has hivemind).
The mule manager looks up the component from the (external) container
with a java.lang.String object.
Taking HiveMind as an example i could define a service point this way:
  <service-point id="Importer" interface="IImporter">
  	<invoke-factory>
		<construct class="ImporterImpl"/>
	</invoke-factory>
    <interceptor service-id="hivemind.LoggingInterceptor" />
  </service-point>

Using some sort of helper class i could load the Class corresponding
the service if the service id is the same as the interface but I'm no
more able to locate it if the id different from the interface name.

Thanks

Ciao
--
Massimo
http://meridio.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


Re: Registry.getService(String id)

Posted by Massimo Lusetti <ml...@gmail.com>.
On 1/23/06, Knut Wannheden <kn...@gmail.com> wrote:

> Doesn't that work for you?

Yes, sorry, i completely missunderstood you. That works pretty well.
So there's no need of that method at all, thanks for pointing me at it.

--
Massimo
http://meridio.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


Re: Registry.getService(String id)

Posted by Knut Wannheden <kn...@gmail.com>.
Massimo,

>
> I could retreive the service from hivemind as
> Register.getService("importer.Importer", IImporter.class);
> but from within mule i know only the service, so only
> importer.Importer, so from importer.Importer, i say this cause i don't
> want (and probably cannot) modify too much the way mule handle
> different containers
>
> Did i miss something?
>

You should also be able to retrieve the service with
Registry.getService("importer.Importer", Object.class); You can use
Object.class as the second parameter with any service.

Doesn't that work for you?

--knut

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


Re: Registry.getService(String id)

Posted by Massimo Lusetti <ml...@gmail.com>.
On 1/23/06, Knut Wannheden <kn...@gmail.com> wrote:

> Sounds interesting!

Good.

> I think you should be able to just specify Object.class as the service
> interface to Registry#getService(String, Class). That should always
> work.

Well i got a this service:
<?xml version="1.0" encoding="UTF-8"?>
<module id="importer" package="main.tool.importer" version="2.2.0">
  <service-point id="Importer" interface="IImporter">
	<invoke-factory>
		<construct class="ImporterImpl"/>
	</invoke-factory>
    <interceptor service-id="hivemind.LoggingInterceptor" />
  </service-point>
</module>

Where the class main.tool.importer.ImporterImpl implements the
interface main.tool.importer.IImporter declared as service id
importer.Importer.

I could retreive the service from hivemind as
Register.getService("importer.Importer", IImporter.class);
but from within mule i know only the service, so only
importer.Importer, so from importer.Importer, i say this cause i don't
want (and probably cannot) modify too much the way mule handle
different containers

Did i miss something?

Regards
--
Massimo
http://meridio.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


Re: Starting hivemind generically

Posted by Knut Wannheden <kn...@gmail.com>.
Kris,

There are two configuration points in HiveMind which may be of
interest to you: hivemind.Startup and hivemind.EagerLoad. With
hivemind.Startup you can register any java.lang.Runnable object to be
executed at registry construction time. With hivemind.EagerLoad you
can register services to be constructed and initialized at registry
contsruction time.

You will still need a Java main class which does the registry
construction. It just has to call
RegistryBuilder.constructDefaultRegistry().

Possibly we could discuss adding a static main method to the
RegistryBuilder class (simply calling constructDefaultRegistry()) so
you won't either have to write a class with this main method. Although
then you would not have access to the HiveMind registry anymore.

Regards,

--knut

On 1/22/06, Kris Bravo <kr...@corridor-software.us> wrote:
>
> Is there any interest in being able to start the hivemind microkernel
> generically?
>
> The examples in the docs include a main which doesn't do much more than
> start the registry and use it to look up and a service explicitly thereby
> causing other services to be executed.
>
> What if the configuration included which service to start (i.e., the
> startup service)? Then a simple starter class and startup scripts could be
> provided, taking another common task off the developers plate.
>
> Does this already exist?
>
> Kris Bravo
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


Starting hivemind generically

Posted by Kris Bravo <kr...@corridor-software.us>.
Is there any interest in being able to start the hivemind microkernel
generically?

The examples in the docs include a main which doesn't do much more than
start the registry and use it to look up and a service explicitly thereby
causing other services to be executed.

What if the configuration included which service to start (i.e., the
startup service)? Then a simple starter class and startup scripts could be
provided, taking another common task off the developers plate.

Does this already exist?

Kris Bravo



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


Re: Registry.getService(String id)

Posted by Massimo Lusetti <ml...@gmail.com>.
On 1/23/06, Knut Wannheden <kn...@gmail.com> wrote:

> I think you should be able to just specify Object.class as the service
> interface to Registry#getService(String, Class). That should always
> work.

I would like to note that now the support is in and run but you have
to use, as the mule reference for the component descriptor, the FQDN
of the interface of the service, so mule is able to locate the service
correctly.

So my request was to make the whole thing more smooth and less verbose
(often packages names are more longer then modules id) and usable if
you've more services with the same interface.

--
Massimo
http://meridio.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


Re: Registry.getService(String id)

Posted by Knut Wannheden <kn...@gmail.com>.
Massimo,

On 1/23/06, Massimo Lusetti <ml...@gmail.com> wrote:
> I would like to know if there's anything, which cannot see, against
> the add of method
> getService(String serviceId) to the Registry.
>
> I'm integrating HiveMind as an option like a Mule
> (http://mule.codehaus.org) container, and at first sight this could
> make the whole process easier, so there's something/someone against
> this particular request?

Sounds interesting!

I think you should be able to just specify Object.class as the service
interface to Registry#getService(String, Class). That should always
work.

Regards,

--knut

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org