}
}
public void engageModuleToOperation(AxisOperation axisOperation, ModuleDescription module)
throws PhaseException {
Flow flow = null;
for (int type = IN_FLOW; type < OUT_FAULT_FLOW; type++) {
switch (type) {
case PhaseMetadata.IN_FLOW : {
ArrayList phases = new ArrayList();
if (axisConfig != null) {
Iterator itr_axis_config =
axisConfig.getInPhasesUptoAndIncludingPostDispatch().iterator();
while (itr_axis_config.hasNext()) {
Object o = itr_axis_config.next();
phases.add(o);
}
}
Iterator itr_ops = axisOperation.getRemainingPhasesInFlow().iterator();
while (itr_ops.hasNext()) {
Object o = itr_ops.next();
phases.add(o);
}
phaseHolder = new PhaseHolder(phases);
break;
}
case PhaseMetadata.OUT_FLOW : {
ArrayList phases = new ArrayList();
Iterator itr_ops = axisOperation.getPhasesOutFlow().iterator();
while (itr_ops.hasNext()) {
Object o = itr_ops.next();
phases.add(o);
}
if (axisConfig != null) {
Iterator itr_axis_config = axisConfig.getGlobalOutPhases().iterator();
while (itr_axis_config.hasNext()) {
Object o = itr_axis_config.next();
phases.add(o);
}
}
phaseHolder = new PhaseHolder(phases);
break;
}
case PhaseMetadata.FAULT_IN_FLOW : {
ArrayList phases = new ArrayList();
if (axisConfig != null) {
Iterator itr_axis_config = axisConfig.getInFaultFlow().iterator();
while (itr_axis_config.hasNext()) {
Object o = itr_axis_config.next();
phases.add(o);
}
}
Iterator itr_ops = axisOperation.getPhasesInFaultFlow().iterator();
while (itr_ops.hasNext()) {
Object o = itr_ops.next();
phases.add(o);
}
phaseHolder = new PhaseHolder(phases);
break;
}
case PhaseMetadata.FAULT_OUT_FLOW : {
phaseHolder = new PhaseHolder(axisOperation.getPhasesOutFaultFlow());
break;
}
}
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;
}
}
if (flow != null) {
for (int j = 0; j < flow.getHandlerCount(); j++) {
HandlerDescription metadata = flow.getHandler(j);
phaseHolder.addHandler(metadata);
}
}
}