Uploaded image for project: 'HiveMind'
  1. HiveMind
  2. HIVEMIND-191

registryDidShutdown() Called Twice on Bean Service

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.1.1
    • None
    • framework
    • None
    • Win XP, Eclipse 3.2.1

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dotteben Ben Dotte
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: