if (axisModule == null) {
throw new AxisFault("invalid service name");
}
PolicySubject modulePolicySubject = axisModule.getPolicySubject();
List<PolicyComponent> policyList =
new ArrayList<PolicyComponent>(modulePolicySubject.getAttachedPolicyComponents());
// Get the merged module policy
Policy policy = null;
for (Iterator iterator = policyList.iterator(); iterator.hasNext();) {
Object policyElement = iterator.next();
if (policyElement instanceof Policy) {
policy = (policy == null) ? (Policy) policyElement
: policy.merge((Policy) policyElement);
} else {
PolicyReference policyReference = (PolicyReference) policyElement;
String key = policyReference.getURI();
int pos = key.indexOf("#");
if (pos == 0) {
key = key.substring(1);
} else if (pos > 0) {
key = key.substring(0, pos);
}
PolicyComponent attachedPolicyComponent = modulePolicySubject
.getAttachedPolicyComponent(key);
if (attachedPolicyComponent != null
&& attachedPolicyComponent instanceof Policy) {
policy = (Policy) attachedPolicyComponent;