* this AxisDescription instance successfully or no module to
* execute some portion (one or more PrimtiveAssertions ) of
* that effective policy.
*/
public void applyPolicy(Policy policy) throws AxisFault {
AxisConfiguration configuration = getAxisConfiguration();
if (configuration == null) {
// FIXME return or throw an Exception?
return;
}
// sets AxisDescription policy
getPolicyInclude().setPolicy(policy);
/*
* now we should take the effective one .. it is necessary since
* AxisDescription.applyPolicy(..) doesn't override policies at the
* Upper levels.
*/
Policy effPolicy = getPolicyInclude().getEffectivePolicy();
/*
* for the moment we consider policies with only one alternative. If the
* policy contains multiple alternatives only the first alternative will
* be considered.
*/
Iterator iterator = effPolicy.getAlternatives();
if (!iterator.hasNext()) {
throw new AxisFault(
"Policy doesn't contain any policy alternatives");
}
List assertionList = (List) iterator.next();
Assertion assertion;
String namespaceURI;
List moduleList;
List namespaceList = new ArrayList();
List modulesToEngage = new ArrayList();
for (Iterator assertions = assertionList.iterator(); assertions
.hasNext();) {
assertion = (Assertion) assertions.next();
namespaceURI = assertion.getName().getNamespaceURI();
moduleList = configuration
.getModulesForPolicyNamesapce(namespaceURI);
if (moduleList == null) {
log.debug("can't find any module to process "
+ assertion.getName() + " type assertions");