hivemind-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <ja...@carmanconsulting.com>
Subject Re: [jira] Created: (HIVEMIND-191) registryDidShutdown() Called Twice on Bean Service
Date Wed, 01 Nov 2006 19:20:04 GMT
I believe this is a dup and I fixed this issue at one point.  It may
not be part of a release yet.

On 11/1/06, Ben Dotte (JIRA) <hivemind-dev@jakarta.apache.org> wrote:
> registryDidShutdown() Called Twice on Bean Service
> --------------------------------------------------
>
>                  Key: HIVEMIND-191
>                  URL: http://issues.apache.org/jira/browse/HIVEMIND-191
>              Project: HiveMind
>           Issue Type: Bug
>           Components: framework
>     Affects Versions: 1.1.1
>          Environment: Win XP, Eclipse 3.2.1
>             Reporter: Ben Dotte
>
>
> When a bean service implements RegistryShutdownListener, the registryDidShutdown() method
gets called twice. This does not happen if the service implements an interface and gets wired
up through it. Here is a simple example that demonstrates the problem:
>
> in testmodule.xml:
> <service-point id="TestService" interface="TestService">
>         <invoke-factory>
>                 <construct class="TestService"/>
>         </invoke-factory>
> </service-point>
>
> in HivemindTest.java:
> public static void main(String[] args)
> {
>         RegistryBuilder builder = new RegistryBuilder();
>         builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(new DefaultClassResolver(),
"testmodule.xml"));
>         builder.addDefaultModuleDescriptorProvider();
>         Registry registry = builder.constructRegistry(Locale.getDefault());
>         ((TestService) registry.getService(TestService.class)).run();
>         registry.shutdown();
> }
>
> in TestService.java:
> public void run() { }
> public void registryDidShutdown()
> {
>         System.out.println("registryDidShutdown called");
> }
>
> Output:
> registryDidShutdown called
> registryDidShutdown called
>
> I tested this with an interface, ITestService, and "registryDidShutdown called" only
got printed once.
>
> --
> 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
>
>
>

Mime
View raw message