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); }
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); } }
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; }
protected void loadConfigurations(ConfigElement config) { path = (String) config.getAttributeValueByName(ATTR_POLICY_PATH); pattern = (String) config.getAttributeValueByName(ATTR_FILENAME_PATTERN); }