[
https://issues.apache.org/jira/browse/HIVEMIND-179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12597733#action_12597733
]
Jochen Zimmermann commented on HIVEMIND-179:
--------------------------------------------
I tried to figure this one out and spend the whole afternoon until now to find
out how the construction of a service really works ...
Correct me if I'm wrong (I'm learning ;-)
At startup of the registry Hivemind does not construct any service at all
(beside the services that are needed for Hivemind itself), but just read in all
the service-points, configurations and so on.
If registry.getService() is called a service model is created and this service
model is asked for the service instantiation. This service model creates a
proxy, but in the end the service model constructs the final service and
creates service models for services "deeper" in the chain, which create
proxies, which create service instances if asked and so on ....
I tried to follow the code, but for both solution proposals I could not find a
way to get a reference to the registry in this whole process of constructing a
service, unless there is some "hivemind magic" I don't know of :-)
Only the RegistryInfrastructure is available at one or two places (of course
this is somewhat the same, but in the end we want the registry itself) ...
Of course it is a complex prcess, so most likely I'd missed the correct place
to hook in?
Thanks for your help!
> Provide access to the Registry
> ------------------------------
>
> Key: HIVEMIND-179
> URL: https://issues.apache.org/jira/browse/HIVEMIND-179
> Project: HiveMind
> Issue Type: New Feature
> Components: framework
> Reporter: Martin Strand
>
> There is currently no way for a service to access its own Registry.
> This would be useful sometimes, for example if you've got a listener that is
> invoked from a non-Hivemind thread:
> public class MyService()
> {
> private Registry registry;
> public MyService()
> {
> registry = getRegistry(); // <-- Need this
> OutsideHivemind.registerListener(this);
> }
> public void invokeListener()
> {
> registry.setupThread();
> // Use some Hivemind services...
> registry.cleanupThread();
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.