[ http://issues.apache.org/jira/browse/HIVEMIND-179?page=comments#action_12428450 ] James Carman commented on HIVEMIND-179: ---------------------------------------
I recommend creating a new class called InvocationContext or something which would allow you to access stuff like this. Maybe one of the methods could be getRegistry() or getModule(). Anyway, it would give you information about the current method invocation. It'd look like this... InvocationContext.getInstance(); This would use a ThreadLocal variable or something. The "outer proxy" could set the reference prior to any method invocation and clear it upon completion. > Provide access to the Registry > ------------------------------ > > Key: HIVEMIND-179 > URL: http://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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
