예제 #1
0
  public void reloadPolicies()
      throws DataAdapterException, CacheSizeExceedCapacityException, PolicySyntaxException,
          BuiltInFunctionNotFoundException {
    System.out.println("Reloading policies ...");
    try {
      // update status
      status.updateProperty(KEY_RUN_STATUS, STATUS_RUN_RELOADPOLICY);

      cacheMgr.policyCache.writeLock();
      // clear both result and policy cache
      cacheMgr.removeAll();
      // reload all policies
      loadPolicies();
      if (logger.isDebugEnabled()) {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        cacheMgr.policyCache.dump(out);
        logger.debug(
            "=================Dump all Cacheables that current in Policy Cache=================");
        logger.debug(
            "\nCurrent non-indexed empty target cache size = "
                + cacheMgr.policyCache.emptyTargetCache.size()
                + ".\n"
                + cacheMgr.policyCache.emptyTargetCache
                + "\n"
                + out.toString());
        logger.debug(
            "=====================================Done=========================================");
      }
    } finally {
      cacheMgr.policyCache.writeUnlock();
      status.updateProperty(KEY_RUN_STATUS, STATUS_RUN_RUNING);
    }
  }
예제 #2
0
 private void shutdownPDP() {
   status.updateProperty(KEY_RUN_STATUS, STATUS_RUN_NOTRUN);
   cacheMgr.removeAll();
   policyLoader.shutdown();
   AttributeRetrieverRegistry.removeInstance(this);
   CacheManager.removeInstance(this);
   ContextFactoryRegistry.removeContextFactory(this);
   PolicyLoaderRegistry.removeDataStore(this);
   pdpRegistry.remove(domain);
 }