code: @SuppressWarnings("unchecked")
      public static Subject getCallerSubject()
                      throws WSSecurityException {
          SecurityManager sm = System.getSecurityManager();
          if (sm != null) {
              sm.checkPermission(GETCALLERSUBJECT_PERM);
          }
          Subject s = null;
  
          try {
              s = (Subject) java.security.AccessController.doPrivileged(getCallerSubjectAction);
          } catch (PrivilegedActionException pae) {
              WSSecurityException e = (WSSecurityException) pae.getException();
              throw e;
          }
  
          return s;
      }
docs: <p>
  This method returns a Subject contains the principal of the J2EE caller and the
  J2EE caller credential. If there is no caller credential, a <code>null</code>
  is returned.
  </p>
  
  <p>
  If there is a caller credential in the current thread, it creates a new Subject
  that contains a <code>com.ibm.websphere.security.auth.WSPrincipal</code> and a
  <code>com.ibm.websphere.security.cred.WSCredential</code>.
  </p>
  
  <p>
  This method is protected by Java 2 Security. If Java 2 Security is enabled, then
  access will be denied if the application code is not granted the permission
  <code>javax.security.auth.AuthPermission("wssecurity.getCallerSubject")</code>.
  </p>
  
  <p>
  This is a <b>server</b> side call, i.e., should only be used by application code
  running in an application server. If this method is called by the client
  (application client or thin client), it returns <code>null</code>.
  </p>
  
  @return Subject contains the caller identity, <code>null</code> if there is no caller identity
  and if called by application client or thin client code.
  @exception WSSecurityException
  failed to get the caller identity
  @see com.ibm.websphere.security.auth.WSPrincipal
  @see com.ibm.websphere.security.cred.WSCredential