Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-2812

Duplicate ServiceProxy objects

XMLWordPrintable

      The method ServiceController.register(ServiceContext ctx, Collection depends) throws Exception; can duplicate, triplicate or "n-plicate" ServiceProxy objects. This can happen when the deployment have many dependencys and register is called n-times.

      a solution may be.:
      /**

      • Register the service context and its dependencies against the microkernel.
      • If the context is already registered it does nothing.
        */
        private void register(ServiceContext ctx, Collection depends) throws Exception
        {
        boolean registered = installedServices.contains(ctx);

      if ((registered) && (ctx.proxy != null))

      { //dont duplicate ServiceProxy objname return; }

      else if (!registered) {
      installedServices.add(ctx);

      if (depends != null)
      {
      log.debug("adding depends in ServiceController.register: " + depends);
      for (Iterator i = depends.iterator(); i.hasNext()

      { registerDependency(ctx.objectName, (ObjectName) i.next()); }

      }
      }

      // Get the fancy service proxy (for the lifecycle API)
      ctx.proxy = getServiceProxy(ctx.objectName, null);
      }

              dandread1@redhat.com Dimitrios Andreadis
              fabcipriano_jira Fabiano C. de Oliveira (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: