@Override
    public Collection<? extends NameClassPair> listInstances(JavaColonNamespace namespace, String nameInContext) {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "listInstances (" + namespace + ", " + nameInContext + ")");

        // This helper only provides support for java:comp/env
        if ((namespace == JavaColonNamespace.COMP) && ("".equals(nameInContext))) {
            ArrayList<NameClassPair> retVal = new ArrayList<NameClassPair>();
            retVal.add(new NameClassPair(VALIDATOR_FACTORY, ValidatorFactory.class.getName()));
            retVal.add(new NameClassPair(VALIDATOR, Validator.class.getName()));
            if (isTraceOn && tc.isEntryEnabled())
                Tr.exit(tc, "listInstances", retVal);
            return retVal;
        } else {
            if (isTraceOn && tc.isEntryEnabled())
                Tr.exit(tc, "listInstances", "empty (not COMP)");
            return Collections.emptyList();
        }

    }
@ Override public Collection < ? extends NameClassPair > listInstances ( JavaColonNamespace namespace , String nameInContext ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "listInstances (" + namespace + ", " + nameInContext + ")" ) ; if ( ( namespace == JavaColonNamespace . COMP ) && ( "" . equals ( nameInContext ) ) ) { ArrayList < NameClassPair > retVal = new ArrayList < NameClassPair > ( ) ; retVal . add ( new NameClassPair ( VALIDATOR_FACTORY , ValidatorFactory . class . getName ( ) ) ) ; retVal . add ( new NameClassPair ( VALIDATOR , Validator . class . getName ( ) ) ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "listInstances" , retVal ) ; return retVal ; } else { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "listInstances" , "empty (not COMP)" ) ; return Collections . emptyList ( ) ; } }
{@inheritDoc}