}
}
public void populateModule() throws DeploymentException {
try {
OMElement moduleElement = buildOM();
// Setting Module Name
// OMAttribute moduleNameAtt = moduleElement.getAttribute(new QName(ATTRIBUTE_NAME));
//
//// if (moduleNameAtt != null) {
//// String moduleName = moduleNameAtt.getAttributeValue();
////
//// if ((moduleName != null) && !"".equals(moduleName)) {
//// module.setName(new QName(moduleName));
//// }
//// }
// Setting Module Class , if it is there
OMAttribute moduleClassAtt = moduleElement.getAttribute(new QName(TAG_CLASS_NAME));
if (moduleClassAtt != null) {
String moduleClass = moduleClassAtt.getAttributeValue();
if ((moduleClass != null) && !"".equals(moduleClass)) {
loadModuleClass(module, moduleClass);
}
}
// process service description
OMElement descriptionElement =
moduleElement.getFirstChildWithName(new QName(TAG_DESCRIPTION));
if (descriptionElement != null) {
OMElement descriptionValue = descriptionElement.getFirstElement();
if (descriptionValue != null) {
StringWriter writer = new StringWriter();
descriptionValue.build();
descriptionValue.serialize(writer);
writer.flush();
module.setModuleDescription(writer.toString());
} else {
module.setModuleDescription(descriptionElement.getText());
}
} else {
module.setModuleDescription("module description not found");
}
// setting the PolicyInclude
// processing <wsp:Policy> .. </..> elements
Iterator policyElements = moduleElement.getChildrenWithName(new QName(POLICY_NS_URI, TAG_POLICY));
if (policyElements != null) {
processPolicyElements(PolicyInclude.AXIS_MODULE_POLICY, policyElements, module.getPolicyInclude());
}
// processing <wsp:PolicyReference> .. </..> elements
Iterator policyRefElements = moduleElement.getChildrenWithName(new QName(POLICY_NS_URI, TAG_POLICY_REF));
if (policyRefElements != null) {
processPolicyRefElements(PolicyInclude.AXIS_MODULE_POLICY, policyRefElements, module.getPolicyInclude());
}
// processing Parameters
// Processing service level parameters
Iterator itr = moduleElement.getChildrenWithName(new QName(TAG_PARAMETER));
processParameters(itr, module, module.getParent());
// process INFLOW
OMElement inFlow = moduleElement.getFirstChildWithName(new QName(TAG_FLOW_IN));
if (inFlow != null) {
module.setInFlow(processFlow(inFlow, module));
}
OMElement outFlow = moduleElement.getFirstChildWithName(new QName(TAG_FLOW_OUT));
if (outFlow != null) {
module.setOutFlow(processFlow(outFlow, module));
}
OMElement inFaultFlow = moduleElement.getFirstChildWithName(new QName(TAG_FLOW_IN_FAULT));
if (inFaultFlow != null) {
module.setFaultInFlow(processFlow(inFaultFlow, module));
}
OMElement outFaultFlow = moduleElement.getFirstChildWithName(new QName(TAG_FLOW_OUT_FAULT));
if (outFaultFlow != null) {
module.setFaultOutFlow(processFlow(outFaultFlow, module));
}
OMElement supportedPolicyNamespaces = moduleElement.getFirstChildWithName(new QName(TAG_SUPPORTED_POLICY_NAMESPACES));
if (supportedPolicyNamespaces != null) {
module.setSupportedPolicyNamespaces(processSupportedPolicyNamespaces(supportedPolicyNamespaces));
}