PDPEngineFactory factory = getPdpEngineFactory();
PDPEngine engine = factory.newEngine(properties);
if (engine != null) {
+ //
+ // If there is a previous engine have it shutdown.
+ //
+ this.destroyEngine();
+ //
+ // Save it off
+ //
this.pdpEngine = engine;
}
} catch (FactoryException e) {
}
}
+ protected synchronized void destroyEngine() {
+ if (this.pdpEngine == null) {
+ return;
+ }
+ try {
+ this.pdpEngine.shutdown();
+ } catch (Exception e) {
+ LOGGER.warn("Exception thrown when destroying XACML PDP engine.", e);
+ }
+ this.pdpEngine = null;
+ }
+
/**
* Make a decision call.
*