Commit 9af15aa5 authored by cdanger's avatar cdanger

Removed unchecked casts from BasePdpEngine, CLoseableAttributeProvider

and RootPolicyEvaluators
parent 0bdaefe2
......@@ -499,8 +499,8 @@ public final class BasePdpEngine implements CloseablePDP<ImmutablePdpDecisionReq
}
else
{
final DecisionCache.Factory<?> responseCacheStoreFactory = PdpExtensionLoader.getJaxbBoundExtension(DecisionCache.Factory.class, jaxbDecisionCacheConf.getClass());
this.decisionCache = ((DecisionCache.Factory<AbstractDecisionCache>) responseCacheStoreFactory).getInstance(jaxbDecisionCacheConf);
final DecisionCache.Factory<AbstractDecisionCache> responseCacheStoreFactory = PdpExtensionLoader.getDecisionCacheFactory(jaxbDecisionCacheConf);
this.decisionCache = responseCacheStoreFactory.getInstance(jaxbDecisionCacheConf);
}
final StandardEnvironmentAttributeSource validStdEnvAttrSrc = stdEnvAttributeSource == null ? DEFAULT_STD_ENV_ATTRIBUTE_SOURCE : stdEnvAttributeSource;
......
......@@ -161,8 +161,8 @@ public final class CloseableAttributeProvider extends ModularAttributeProvider i
{
try
{
final CloseableAttributeProviderModule.FactoryBuilder<AbstractAttributeProvider> attrProviderModBuilder = PdpExtensionLoader.getJaxbBoundExtension(
CloseableAttributeProviderModule.FactoryBuilder.class, jaxbAttributeProviderConf.getClass());
final CloseableAttributeProviderModule.FactoryBuilder<AbstractAttributeProvider> attrProviderModBuilder = PdpExtensionLoader
.getAttributeProviderModuleFactoryBuilder(jaxbAttributeProviderConf);
final CloseableAttributeProviderModule.DependencyAwareFactory depAwareAttrProviderModBuilder = attrProviderModBuilder.getInstance(jaxbAttributeProviderConf, environmentProperties);
final Set<AttributeDesignatorType> requiredAttrs = depAwareAttrProviderModBuilder.getDependencies();
/*
......
......@@ -43,7 +43,6 @@ import org.ow2.authzforce.core.pdp.api.EnvironmentProperties;
import org.ow2.authzforce.core.pdp.api.EvaluationContext;
import org.ow2.authzforce.core.pdp.api.ImmutablePepActions;
import org.ow2.authzforce.core.pdp.api.IndeterminateEvaluationException;
import org.ow2.authzforce.core.pdp.api.JaxbXACMLUtils;
import org.ow2.authzforce.core.pdp.api.PdpDecisionResult;
import org.ow2.authzforce.core.pdp.api.PdpDecisionResults;
import org.ow2.authzforce.core.pdp.api.StatusHelper;
......@@ -145,14 +144,10 @@ public final class RootPolicyEvaluators
this.expressionFactory = new ExpressionFactoryImpl(attributeFactory, functionRegistry, jaxbAttributeProviderConfs, maxVariableReferenceDepth, enableXPath, strictAttributeIssuerMatch,
environmentProperties);
final RootPolicyProviderModule.Factory<?> rootPolicyProviderModFactory = PdpExtensionLoader.getJaxbBoundExtension(RootPolicyProviderModule.Factory.class,
jaxbRootPolicyProviderConf.getClass());
final RefPolicyProviderModule.Factory<?> refPolicyProviderModFactory = jaxbRefPolicyProviderConf == null ? null : PdpExtensionLoader.getJaxbBoundExtension(
RefPolicyProviderModule.Factory.class, jaxbRefPolicyProviderConf.getClass());
rootPolicyProviderMod = ((RootPolicyProviderModule.Factory<AbstractPolicyProvider>) rootPolicyProviderModFactory).getInstance(jaxbRootPolicyProviderConf,
JaxbXACMLUtils.getXACMLParserFactory(enableXPath), this.expressionFactory, combiningAlgRegistry, jaxbRefPolicyProviderConf,
(RefPolicyProviderModule.Factory<AbstractPolicyProvider>) refPolicyProviderModFactory, maxPolicySetRefDepth, environmentProperties);
final RefPolicyProviderModule.Factory<AbstractPolicyProvider> refPolicyProviderModFactory = jaxbRefPolicyProviderConf == null ? null : PdpExtensionLoader
.getRefPolicyProviderModuleFactory(jaxbRefPolicyProviderConf);
rootPolicyProviderMod = PdpExtensionLoader.getRootPolicyProviderModule(jaxbRootPolicyProviderConf, enableXPath, this.expressionFactory, combiningAlgRegistry, jaxbRefPolicyProviderConf,
refPolicyProviderModFactory, maxPolicySetRefDepth, environmentProperties);
isRootPolicyProviderStatic = rootPolicyProviderMod instanceof StaticRootPolicyProviderModule;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment