mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jdemendi
05.08.2008 4a41c53f70eaf12d28215a8aee4fef4d02bc5a57
opends/src/server/org/opends/server/core/networkgroups/NetworkGroup.java
@@ -94,6 +94,7 @@
  private static NetworkGroup adminNetworkGroup =
      new NetworkGroup (ADMIN_NETWORK_GROUP_NAME);
  // The internal network group (singleton).
  // The internal network group has no criterion, no policy, and gives
  // access to all the workflows. The purpose of the internal network
@@ -214,6 +215,8 @@
  /**
   * Deregisters the current network group (this) with the server.
   * The method also decrements the reference counter of the workflows
   * so that workflows can be disabled or deleted if needed.
   */
  public void deregister()
  {
@@ -224,6 +227,27 @@
      networkGroups.remove(networkGroupID);
      registeredNetworkGroups = networkGroups;
      orderedNetworkGroups.remove(this);
      // decrement the reference counter of the workflows registered with
      // this network group
      updateWorkflowReferenceCounters();
    }
  }
  /**
   * Decrements the workflow reference counters of all the workflows
   * registered with this network group.
   */
  private void updateWorkflowReferenceCounters()
  {
    synchronized (registeredWorkflowNodesLock)
    {
      for (WorkflowTopologyNode workflowNode: registeredWorkflowNodes.values())
      {
        WorkflowImpl workflowImpl = workflowNode.getWorkflowImpl();
        workflowImpl.decrementReferenceCounter();
      }
    }
  }