if (authMgr.isValid(principal, passwordChars, subject)) { SecurityActions.pushSubjectContext(principal, passwordChars, subject); if (trace) log.trace("Username: " + user + " is authenticated"); return subject; } else { if (trace) log.trace("User: " + user + " is NOT authenticated"); throw new JMSSecurityException("User: " + user + " is NOT authenticated"); }
   public Subject authenticate(String user, String password) throws JMSSecurityException   {      boolean trace = log.isTraceEnabled();            if (trace)      {         log.trace("Authenticating, username=" + user);      }            SimplePrincipal principal = new SimplePrincipal(user);      char[] passwordChars = null;      if (password != null)         passwordChars = password.toCharArray();      Subject subject = new Subject();            if (authMgr.isValid(principal, passwordChars, subject))      {         SecurityActions.pushSubjectContext(principal, passwordChars, subject);         if (trace)            log.trace("Username: " + user + " is authenticated");                           return subject;      }      else      {         if (trace)            log.trace("User: " + user + " is NOT authenticated");         throw new JMSSecurityException("User: " + user + " is NOT authenticated");      }   }