*/
private void buildExcutionChains(int type, OperationDescription operation)
throws AxisFault, PhaseException {
ArrayList allHandlers = new ArrayList();
ModuleDescription module;
Flow flow = null;
///////////////////////////////////////////////////////////////////////////////////////////
////////////////////////// Handlers from axis2.xml from modules/////////////////////////
ArrayList modulqnames = (ArrayList) ((AxisConfigurationImpl) axisConfig).getEngadgedModules();
for (int i = 0; i < modulqnames.size(); i++) {
QName modulename = (QName) modulqnames.get(i);
module = axisConfig.getModule(modulename);
if (module != null) {
switch (type) {
case PhaseMetadata.IN_FLOW:
{
flow = module.getInFlow();
break;
}
case PhaseMetadata.OUT_FLOW:
{
flow = module.getOutFlow();
break;
}
case PhaseMetadata.FAULT_IN_FLOW:
{
flow = module.getFaultInFlow();
break;
}
case PhaseMetadata.FAULT_OUT_FLOW:
{
flow = module.getFaultOutFlow();
break;
}
}
axisService.addToEngagModuleList(module);
operation.addToEngageModuleList(module);
} else {
throw new PhaseException(Messages.getMessage(
DeploymentErrorMsgs.INVALID_MODULE_REF, modulename.getLocalPart()));
}
if (flow != null) {
for (int j = 0; j < flow.getHandlerCount(); j++) {
HandlerDescription metadata = flow.getHandler(j);
if (!PhaseValidator.isSystemPhases(metadata.getRules().getPhaseName())) {
allHandlers.add(metadata);
} else {
/**
*This handler is trying to added to system pre defined phases , but those handlers
* are already added to global chain which run irrespective of the service
*
*/
}
}
}
}
///////////////////////////////////////////////////////////////////////////////////////////
////////////////////////// SERVICE HANDLERS ///////////////////////////////////////////////
switch (type) {
case PhaseMetadata.IN_FLOW:
{
flow = axisService.getInFlow();
break;
}
case PhaseMetadata.OUT_FLOW:
{
flow = axisService.getOutFlow();
break;
}
case PhaseMetadata.FAULT_IN_FLOW:
{
flow = axisService.getFaultInFlow();
break;
}
case PhaseMetadata.FAULT_OUT_FLOW:
{
flow = axisService.getFaultOutFlow();
break;
}
}
if (flow != null) {
for (int j = 0; j < flow.getHandlerCount(); j++) {
HandlerDescription metadata = flow.getHandler(j);
// todo change this in properway
if (metadata.getRules().getPhaseName().equals("")) {
throw new PhaseException(
Messages.getMessage(DeploymentErrorMsgs.PHASE_DOES_NOT_SPECIFED,