Пример #1
0
 /* Schedule the periodic containers to SystemTimerPool. */
 public static void doSchedule() {
   TimerPool pool = SystemTimerPool.getTimerPool();
   Date nextRun =
       new Date(((System.currentTimeMillis() + (SPCache.interval * 1000)) / 1000) * 1000);
   pool.schedule(SPCache.requestHash, nextRun);
   pool.schedule(SPCache.responseHash, nextRun);
   pool.schedule(SPCache.mniRequestHash, nextRun);
   pool.schedule(SPCache.relayStateHash, nextRun);
   pool.schedule(SPCache.logoutRequestIDHash, nextRun);
   pool.schedule(SPCache.reqParamHash, nextRun);
   pool.schedule(SPCache.assertionByIDCache, nextRun);
   pool.schedule(IDPCache.authnRequestCache, nextRun);
   pool.schedule(IDPCache.idpAuthnContextCache, nextRun);
   pool.schedule(IDPCache.assertionByIDCache, nextRun);
   pool.schedule(IDPCache.relayStateCache, nextRun);
   pool.schedule(IDPCache.responsesByArtifacts, nextRun);
   pool.schedule(IDPCache.mniRequestHash, nextRun);
   pool.schedule(IDPCache.responseCache, nextRun);
   pool.schedule(IDPCache.proxySPAuthnReqCache, nextRun);
   pool.schedule(IDPCache.proxySPLogoutReqCache, nextRun);
   pool.schedule(IDPCache.SOAPMessageByLogoutRequestID, nextRun);
   pool.schedule(IDPCache.logoutResponseCache, nextRun);
   pool.schedule(new CacheCleanUpRunnable(SPCache.interval * 1000), nextRun);
 }
Пример #2
0
  static {
    bundle = Locale.getInstallResourceBundle("libSOAPBinding");
    faultStringServerError = bundle.getString("ServerError");
    debug = Debug.getInstance("libIDWSF");

    try {
      messageFactory = MessageFactory.newInstance();
    } catch (Exception ex) {
      debug.error("Utils.static: Unable to create SOAP Message Factory", ex);
    }

    String tmpNSPre = SystemPropertiesManager.get(NAMESPACE_PREFIX_MAPPING_LIST_PROP);
    if (tmpNSPre != null && tmpNSPre.length() > 0) {
      StringTokenizer stz = new StringTokenizer(tmpNSPre, "|");
      while (stz.hasMoreTokens()) {
        String token = stz.nextToken().trim();
        int index = token.indexOf('=');
        if (index != -1 && index != 0 && index != token.length() - 1) {
          String prefix = token.substring(0, index);
          String ns = token.substring(index + 1);
          if (debug.messageEnabled()) {
            debug.message("Utils.static: add ns = " + ns + ", prefix = " + prefix);
          }
          nsPrefix.put(ns, prefix);
        } else {
          if (debug.warningEnabled()) {
            debug.warning(
                "Utils.static: Invalid syntax " + "for Namespace Prefix Mapping List: " + token);
          }
        }
      }
    }

    String tmpJaxbPkgs = SystemPropertiesManager.get(JAXB_PACKAGE_LIST_PROP);
    if (tmpJaxbPkgs != null && tmpJaxbPkgs.length() > 0) {
      jaxbPackages = DEFAULT_JAXB_PACKAGES + ":" + tmpJaxbPkgs;
    } else {
      jaxbPackages = DEFAULT_JAXB_PACKAGES;
    }
    if (debug.messageEnabled()) {
      debug.message("Utils.static: jaxbPackages = " + jaxbPackages);
    }

    try {
      jc = JAXBContext.newInstance(jaxbPackages);
    } catch (JAXBException jaxbe) {
      Utils.debug.error("Utils.static:", jaxbe);
    }

    String tmpstr = SystemPropertiesManager.get(STALE_TIME_LIMIT_PROP);
    if (tmpstr != null) {
      try {
        stale_time_limit = Integer.parseInt(tmpstr);
      } catch (Exception ex) {
        if (debug.warningEnabled()) {
          debug.warning(
              "Utils.static: Unable to get stale time " + "limit. Default value will be used");
        }
      }
    }

    tmpstr = SystemPropertiesManager.get(SUPPORTED_ACTORS_PROP);
    if (tmpstr != null) {
      StringTokenizer stz = new StringTokenizer(tmpstr, "|");
      while (stz.hasMoreTokens()) {
        String token = stz.nextToken();
        if (token.length() > 0) {
          supportedActors.add(token);
        }
      }
    }
    tmpstr = SystemPropertiesManager.get(MESSAGE_ID_CACHE_CLEANUP_INTERVAL_PROP);
    if (tmpstr != null) {
      try {
        message_ID_cleanup_interval = Integer.parseInt(tmpstr);
      } catch (Exception ex) {
        if (debug.warningEnabled()) {
          debug.warning(
              "Utils.CleanUpThread.static: Unable to"
                  + " get stale time limit. Default value "
                  + "will be used");
        }
      }
    }
    messageIDMap = new PeriodicCleanUpMap(message_ID_cleanup_interval, stale_time_limit);
    SystemTimerPool.getTimerPool()
        .schedule(
            (TaskRunnable) messageIDMap,
            new Date(((System.currentTimeMillis() + message_ID_cleanup_interval) / 1000) * 1000));
  }