Ejemplo n.º 1
0
 protected void loadConfigurations(ConfigElement config) throws XMLGeneralException {
   domain = (String) config.getAttributeValueByName(ATTR_DOMAINNAME);
   multiPoliciesCombineAlg = (URI) config.getAttributeValueByName(ATTR_MULTIPOLICYCOMBALG);
   supportMustBePresent = (Boolean) config.getAttributeValueByName(ATTR_MUSTBEPRESENT);
   // FIXME should we remove support inner expression option?
   supportInnerExpression = (Boolean) config.getAttributeValueByName(ATTR_INNEREXPRESSION);
   resolveReferencedPoliciesOnLoad = (Boolean) config.getAttributeValueByName(ATTR_RESOLVEPOLICY);
   dsConfig = (ConfigElement) config.getSingleXMLElementByType(ELEMTYPE_DATASTORE);
   ctxConfig = (ConfigElement) config.getSingleXMLElementByType(ELEMTYPE_CONTEXT_FACTORY);
   cacheConfig = (ConfigElement) config.getSingleXMLElementByName(ELEM_CACHE_MANAGER);
   policyResConfig = (ConfigElement) config.getSingleXMLElementByName(ELEM_POLICY_RESOLVER);
   attrRtrConfig = (ConfigElement) config.getSingleXMLElementByName(ELEM_ATTRIBUTE_FACTORY);
 }
Ejemplo n.º 2
0
  private static Logger createLogger(String tag)
      throws ConfigurationException, LogInitializationException {
    if (!hasInitialized) {
      throw new LogInitializationException("LogFactory has NOT been initialized.");
    }

    try {
      String loggerClassName = (String) config.getAttributeValueByName(ATTR_LOGGER_CLASSNAME);
      Class<?> loggerClass = Class.forName(loggerClassName);
      Constructor<?> loggerCons =
          loggerClass.getDeclaredConstructor(new Class[] {config.getClass(), String.class});
      Logger logger = (Logger) loggerCons.newInstance(config, tag);

      return logger;
    } catch (Exception e) {
      throw new ConfigurationException("Error occurs when initialize the Logger.", e);
    }
  }
Ejemplo n.º 3
0
  public static synchronized PDP getInstance(ConfigElement config) throws PDPInitializeException {
    String domainName = (String) config.getAttributeValueByName(ATTR_DOMAINNAME);
    PDP pdp = pdpRegistry.get(domainName);
    if (pdp == null) {
      pdp = new PDP(config);
      pdpRegistry.put(domainName, pdp);
    }

    return pdp;
  }
Ejemplo n.º 4
0
 protected void loadConfigurations(ConfigElement config) {
   path = (String) config.getAttributeValueByName(ATTR_POLICY_PATH);
   pattern = (String) config.getAttributeValueByName(ATTR_FILENAME_PATTERN);
 }