code: @Override
      public Object getObjectInstance(JavaColonNamespace namespace, String name) throws NamingException {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
          if (isTraceOn && tc.isEntryEnabled())
              Tr.entry(tc, "getObjectInstance (" + namespace + ", " + name + ")");
  
          // This helper only provides support for java:comp/env
          if (namespace != JavaColonNamespace.COMP) {
              if (isTraceOn && tc.isEntryEnabled())
                  Tr.exit(tc, "getObjectInstance : null (not COMP)");
              return null;
          }
  
          boolean isFactory = false;
          ValidatorFactory vfactory = null;
  
          if (VALIDATOR_FACTORY.equals(name)) {
              isFactory = true;
          } else if (!VALIDATOR.equals(name)) {
              if (isTraceOn && tc.isEntryEnabled())
                  Tr.exit(tc, "getObjectInstance : null (not ValidatorFactory or Validator)");
              return null;
          }
  
          // Retrieve the ValidatorFactory for the currently active module.
          // If there is no metadata on the thread, then a nice exception
          // will be thrown, which should be wrapped in a NamingException.
          ComponentMetaData cmd = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData();
          try {
              vfactory = AbstractBeanValidation.instance().getValidatorFactory(cmd);
          } catch (ValidationException vex) {
              NamingException nex = new NamingException("Failed to obtain object of type " + name);
              nex.initCause(vex);
              throw nex;
          }
  
          Object instance = isFactory ? vfactory : vfactory.getValidator();
  
          if (isTraceOn && tc.isEntryEnabled())
              Tr.exit(tc, "getObjectInstance : " + Util.identity(instance));
  
          return instance;
      }
docs: {@inheritDoc}