/*
(non-Javadoc)

@see org.kie.common.AgendaI#clearAgendaGroup(java.lang.String)
507141
public void clearAndCancelAgendaGroup(final String name) {
        InternalAgendaGroup agendaGroup = this.agendaGroups.get( name );
        if ( agendaGroup != null ) {
            clearAndCancelAgendaGroup( agendaGroup );
        }
    }
998050
private void clearAuthorizationTable() {
        userToAccessId.clear();
        groupToAccessId.clear();
        userToRoles.clear();
        groupToRoles.clear();
        specialSubjectToRoles.clear();
        accessIdToRoles.clear();
        explicitAccessIdToRoles.clear();
    }
1010679
@Override
	public void removeByGroupId(long groupId) {
		for (CPSpecificationOption cpSpecificationOption : findByGroupId(
				groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(cpSpecificationOption);
		}
	}
1229379
@Override
	public void removeListeners(String nodeID) {
		boolean found = false;
		writeLock.lock();
		try {
			Iterator<HashMap<String, Strategy<ListenerEndpoint>>> groupIterator = listeners.values().iterator();
			while (groupIterator.hasNext()) {
				HashMap<String, Strategy<ListenerEndpoint>> groups = groupIterator.next();
				Iterator<Strategy<ListenerEndpoint>> strategyIterator = groups.values().iterator();
				while (strategyIterator.hasNext()) {
					Strategy<ListenerEndpoint> strategy = strategyIterator.next();
					if (strategy.remove(nodeID)) {
						found = true;
						if (strategy.isEmpty()) {
							strategyIterator.remove();
						}
					}
				}
				if (groups.isEmpty()) {
					groupIterator.remove();
				}
			}
		} finally {

			// Clear caches
			if (found) {
				emitterCache.clear();
				broadcasterCache.clear();
				localBroadcasterCache.clear();
			}

			writeLock.unlock();
		}
	}
1266639
private void remove(ThreadGroup g) {
        synchronized (this) {
            if (destroyed) {
                return;
            }
            for (int i = 0 ; i < ngroups ; i++) {
                if (groups[i] == g) {
                    ngroups -= 1;
                    System.arraycopy(groups, i + 1, groups, i, ngroups - i);
                    // Zap dangling reference to the dead group so that
                    // the garbage collector will collect it.
                    groups[ngroups] = null;
                    break;
                }
            }
            if (nthreads == 0) {
                notifyAll();
            }
            if (daemon && (nthreads == 0) &&
                (nUnstartedThreads == 0) && (ngroups == 0))
            {
                destroy();
            }
        }
    }
1289146
public void reset() {
        totalTargetsLabel.setVisible(false);
        populateGroupsLegendByTargetCounts(Collections.emptyList());
        if (groupsLegend.getComponentCount() > MAX_GROUPS_TO_BE_DISPLAYED) {
            groupsLegend.getComponent(MAX_GROUPS_TO_BE_DISPLAYED).setVisible(false);
        }
    }
888151
@Override
    public void deleteGroup(IEntityGroup group) throws GroupsException {
        throwExceptionIfNotInternallyManaged();
        synchronizeGroupMembersOnDelete(group);
        getGroupStore().delete(group);
        if (cacheInUse()) {
            cacheRemove(group);
        }
    }
81121
@Override
	public void removeByGroupId(long groupId) {
		for (CommerceNotificationQueueEntry commerceNotificationQueueEntry : findByGroupId(
				groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceNotificationQueueEntry);
		}
	}
1331686
public void removeGroup(String group) {

        if (m_fieldsByGroup.get(group) != null) {
            List<I_CmsFormField> fieldsToRemove = new ArrayList<I_CmsFormField>(m_fieldsByGroup.get(group));
            for (I_CmsFormField field : fieldsToRemove) {
                removeField(field);
            }
        }
        m_fieldsByGroup.removeAll(group);
    }
1084133
@Override
	public void clearCache(CPDefinitionGroupedEntry cpDefinitionGroupedEntry) {
		entityCache.removeResult(CPDefinitionGroupedEntryModelImpl.ENTITY_CACHE_ENABLED,
			CPDefinitionGroupedEntryImpl.class,
			cpDefinitionGroupedEntry.getPrimaryKey());

		finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
		finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);

		clearUniqueFindersCache((CPDefinitionGroupedEntryModelImpl)cpDefinitionGroupedEntry,
			true);
	}
1285950
public void remove(Paintable paintable, Object group) {
		String className = paintable.getClass().getName();
		if (painters.containsKey(className)) {
			List<Painter> list = painters.get(className);
			for (Painter painter : list) {
				painter.deleteShape(paintable, group, context);
			}
		}
	}
327521
public void removeAllQueriesAndGroups() {
		List<QueryControllerEntity> elements = getElements();
		for (QueryControllerEntity treeElement : elements) {
			fireElementRemoved(treeElement);
		}
		entities.clear();
	}
1115189
public void removeWorldFromGroup(String world) {
        String groupName = getWorldGroupName(world);
        if (!groupName.equals(DEFAULT_GROUP_NAME)) {
            list.get(groupName).removeWorld(world);
        }
    }
537427
@Override
	public void removeByGroupId(long groupId) {
		for (CommerceOrder commerceOrder : findByGroupId(groupId,
				QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceOrder);
		}
	}
771980
@Override
	public void removeByGroupId(long groupId) {
		for (CommerceWarehouse commerceWarehouse : findByGroupId(groupId,
				QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceWarehouse);
		}
	}
77619
protected void synchronizeGroupMembersOnDelete(IEntityGroup group) throws GroupsException {
        GroupMemberImpl gmi = null;

        for (Iterator it = group.getChildren().iterator(); it.hasNext(); ) {
            gmi = (GroupMemberImpl) it.next();
            gmi.invalidateInParentGroupsCache(Collections.singleton((IGroupMember) gmi));
            if (cacheInUse()) {
                cacheUpdate(gmi);
            }
        }
    }
617286
private void clearAuthorizationTable() {
        accessIdToRoles.clear();
        userToAccessId.clear();
        groupToAccessId.clear();
        userToRoles.clear();
        groupToRoles.clear();
    }