docs: @Override
      public synchronized Subject getSubject () {
          if ( this.cachedSubject != null ) {
              return this.cachedSubject;
          }
  
          try {
              log.debug("Logging on");
              LoginContext lc;
  
  	    Subject ps = super.getSubject();
  
              if ( this.configuration != null ) {
                  lc = new LoginContext(this.serviceName, ps, this, this.configuration);
              }
              else if ( ps != null ) {
                  lc = new LoginContext(this.serviceName, ps, this);
              } else {
                  lc = new LoginContext(this.serviceName, this);
  	    }
              lc.login();
  
              Subject s = lc.getSubject();
              if ( log.isDebugEnabled() ) {
                  log.debug("Got subject: " + s.getPrincipals());
              }
              if ( log.isTraceEnabled() ) {
                  log.trace("Got subject " + s);
              }
  
              this.cachedSubject = s;
              return this.cachedSubject;
          }
          catch ( LoginException e ) {
              log.error("Failed to create login context", e);
              this.cachedSubject = new Subject();
              return null;
          }
      }