public MarkableIterator(boolean marked) { List<MarkableSampleHandler> matchingHandlers = new ArrayList<MarkableSampleHandler>(); List<MarkableSampleHandler> handlers = SampleHandlers.this.currentHandlers(); for (MarkableSampleHandler handler : handlers) { if (handler.isMarked() == marked) { matchingHandlers.add(handler); } } this.iterator = matchingHandlers.iterator(); }
if (!handler.isMarked()) { List<ResourceType> allocatedResourceTypes = new ArrayList<ResourceType>(); for (ResourceInstance resourceInstance : resources) {
private void notifyOldHandlersOfResourceType(List<MarkableSampleHandler> handlers, ResourceType type) { final boolean isDebugEnabled_STATISTICS = logger.isTraceEnabled(LogMarker.STATISTICS_VERBOSE); if (isDebugEnabled_STATISTICS) { logger.trace(LogMarker.STATISTICS_VERBOSE, "SampleCollector#notifyOldHandlersOfResourceType type={}", type); } int count = 0; for (MarkableSampleHandler handler : handlers) { if (handler.isMarked()) { handler.allocatedResourceType(type); count++; } } if (isDebugEnabled_STATISTICS) { logger.trace(LogMarker.STATISTICS_VERBOSE, "SampleCollector#notifyOldHandlersOfResourceType notified {} old handlers", count); } }
private void notifyOldHandlers(List<MarkableSampleHandler> handlers, List<ResourceInstance> ri) { final boolean isDebugEnabled_STATISTICS = logger.isTraceEnabled(LogMarker.STATISTICS_VERBOSE); if (isDebugEnabled_STATISTICS) { logger.trace(LogMarker.STATISTICS_VERBOSE, "SampleCollector#notifyOldHandlers ri={}", ri); } int count = 0; for (ResourceInstance resource : ri) { for (MarkableSampleHandler handler : handlers) { if (handler.isMarked()) { handler.destroyedResourceInstance(resource); count++; } } } if (isDebugEnabled_STATISTICS) { logger.trace(LogMarker.STATISTICS_VERBOSE, "SampleCollector#notifyOldHandlers notified {} old handlers", count); } }
private void notifyOldHandlersOfResource(List<MarkableSampleHandler> handlers, ResourceInstance resource) { final boolean isDebugEnabled_STATISTICS = logger.isTraceEnabled(LogMarker.STATISTICS_VERBOSE); if (isDebugEnabled_STATISTICS) { logger.trace(LogMarker.STATISTICS_VERBOSE, "SampleCollector#notifyOldHandlersOfResource resource={}", resource); } int count = 0; for (MarkableSampleHandler handler : handlers) { if (handler.isMarked()) { handler.allocatedResourceInstance(resource); count++; } } if (isDebugEnabled_STATISTICS) { logger.trace(LogMarker.STATISTICS_VERBOSE, "SampleCollector#notifyOldHandlersOfResource notified {} old handlers", count); } }