Details

      Description

      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);
      }

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                dimitris Dimitrios Andreadis
                Reporter:
                fabcipriano Fabiano C. de Oliveira
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: