You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hivemind.apache.org by "Ben Dotte (JIRA)" <hi...@jakarta.apache.org> on 2006/11/01 16:25:16 UTC

[jira] Created: (HIVEMIND-191) registryDidShutdown() Called Twice on Bean Service

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

        

Re: [jira] Created: (HIVEMIND-191) registryDidShutdown() Called Twice on Bean Service

Posted by James Carman <ja...@carmanconsulting.com>.
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) <hi...@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
>
>
>