code: private UserRegistry getActiveUserRegistry() throws WSSecurityException {
          final String METHOD = "getUserRegistry";
          UserRegistry activeUserRegistry = null;
          try {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, METHOD + " securityServiceRef " + securityServiceRef);
              }
              SecurityService ss = securityServiceRef.getService();
              if (ss == null) {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, METHOD + " No SecurityService, returning null");
                  }
              } else {
                  UserRegistryService urs = ss.getUserRegistryService();
                  if (urs == null) {
                      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                          Tr.debug(tc, METHOD + " No UserRegistryService, returning null");
                      }
                  } else {
                      if (urs.isUserRegistryConfigured()) {
                          com.ibm.ws.security.registry.UserRegistry userRegistry = urs.getUserRegistry();
                          activeUserRegistry = urs.getExternalUserRegistry(userRegistry);
                      } else {
                          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                              Tr.debug(tc, METHOD + " Security enabled but no registry configured");
                          }
                      }
                  }
              }
          } catch (RegistryException e) {
              String msg = "getUserRegistryWrapper failed due to an internal error: " + e.getMessage();
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, msg, e);
              }
              throw new WSSecurityException(msg, e);
          }
          return activeUserRegistry;
      }
docs: Returns the active UserRegistry. If the active user registry is an instance of
  com.ibm.ws.security.registry.UserRegistry, then it will be wrapped. Otherwise,
  if the active user registry is an instance of CustomUserRegistryWrapper, then the
  underlying com.ibm.websphere.security.UserRegistry will be returned.
  
  @return UserRegistry the active user registry.
  @throws WSSecurityException