@Override
    public boolean isPaused(String targets) throws PauseableComponentControllerRequestFailedException {

        Set<String> foundTargets = new HashSet<String>();

        Set<String> targetList = createTargetList(targets);

        if (targetList.isEmpty()) {
            Tr.warning(tc, "warning.server.status.invalid.targets");
            throw new PauseableComponentControllerRequestFailedException(Tr.formatMessage(tc, "warning.server.status.invalid.targets"));
        }

        //Add each pauseable component to this list. If the tracked values get modified
        //while we are iterating and we start over, skip anyone already in this list
        Set<PauseableComponent> processedList = new HashSet<PauseableComponent>();

        // Sync with other methods changing/querying states for PauseableComponents
        synchronized (this) {
            while (true) {
                try {
                    for (PauseableComponent pauseableComponent : tracker.getTracked().values()) {

                        if (processedList.add(pauseableComponent)) {

                            if (targetList.contains(pauseableComponent.getName())) {
                                foundTargets.add(pauseableComponent.getName());

                                if (!pauseableComponent.isPaused()) {
                                    return false;
                                }
                            }
                        }
                    }

                    break;
                } catch (Throwable t) {
                    // Someone modified our list of services. Retry.
                }
            }
        }

        //Check which (if any) targets were not found
        targetList.removeAll(foundTargets);
        if (!targetList.isEmpty()) {
            // We could not find targets specified. Return false: not everyone was paused
            Tr.warning(tc, "warning.server.status.missing.targets", Arrays.toString(targetList.toArray()));
            throw new PauseableComponentControllerRequestFailedException(Tr.formatMessage(tc, "warning.server.status.missing.targets", Arrays.toString(targetList.toArray())));

        } else {
            return true;
        }

    }
@ Override public boolean isPaused ( String targets ) throws PauseableComponentControllerRequestFailedException { Set < String > foundTargets = new HashSet < String > ( ) ; Set < String > targetList = createTargetList ( targets ) ; if ( targetList . isEmpty ( ) ) { Tr . warning ( tc , "warning.server.status.invalid.targets" ) ; throw new PauseableComponentControllerRequestFailedException ( Tr . formatMessage ( tc , "warning.server.status.invalid.targets" ) ) ; } Set < PauseableComponent > processedList = new HashSet < PauseableComponent > ( ) ; synchronized ( this ) { while ( true ) { try { for ( PauseableComponent pauseableComponent : tracker . getTracked ( ) . values ( ) ) { if ( processedList . add ( pauseableComponent ) ) { if ( targetList . contains ( pauseableComponent . getName ( ) ) ) { foundTargets . add ( pauseableComponent . getName ( ) ) ; if ( ! pauseableComponent . isPaused ( ) ) { return false ; } } } } break ; } catch ( Throwable t ) { } } } targetList . removeAll ( foundTargets ) ; if ( ! targetList . isEmpty ( ) ) { Tr . warning ( tc , "warning.server.status.missing.targets" , Arrays . toString ( targetList . toArray ( ) ) ) ; throw new PauseableComponentControllerRequestFailedException ( Tr . formatMessage ( tc , "warning.server.status.missing.targets" , Arrays . toString ( targetList . toArray ( ) ) ) ) ; } else { return true ; } }
/*
(non-Javadoc)

@see com.ibm.ws.kernel.launch.service.PauseableComponentController#isPaused(java.lang.String)