OMElement corelateOn = elem.getFirstChildWithName(CORELATE_ON_Q);
if (corelateOn != null) {
OMAttribute corelateExpr = corelateOn.getAttribute(EXPRESSION_Q);
if (corelateExpr != null) {
try {
AXIOMXPath xp = new AXIOMXPath(corelateExpr.getAttributeValue());
OMElementUtils.addNameSpaces(xp, corelateOn, log);
mediator.setCorelateExpression(xp);
} catch (JaxenException e) {
handleException("Unable to load the corelate XPATH expression", e);
}
}
}
OMElement completeCond = elem.getFirstChildWithName(COMPLETE_CONDITION_Q);
if (completeCond != null) {
OMAttribute completeTimeout = completeCond.getAttribute(TIMEOUT_Q);
if (completeTimeout != null) {
mediator.setCompleteTimeout(
Long.parseLong(completeTimeout.getAttributeValue()) * 1000);
}
OMElement messageCount = completeCond.getFirstChildWithName(MESSAGE_COUNT_Q);
if (messageCount != null) {
OMAttribute min = messageCount.getAttribute(MIN_Q);
if (min != null) {
mediator.setMinMessagesToComplete(Integer.parseInt(min.getAttributeValue()));
}
OMAttribute max = messageCount.getAttribute(MAX_Q);
if (max != null) {
mediator.setMaxMessagesToComplete(Integer.parseInt(max.getAttributeValue()));
}
}
}
OMElement invalidate = elem.getFirstChildWithName(INVALIDATE_Q);
if (invalidate != null) {
OMAttribute sequenceRef = invalidate.getAttribute(SEQUENCE_Q);
if (sequenceRef != null) {
mediator.setInvalidMsgSequenceRef(sequenceRef.getAttributeValue());
} else if (invalidate.getFirstElement() != null) {
mediator.setInvalidMsgSequence(
(new SequenceMediatorFactory()).createAnonymousSequence(invalidate));
}
OMAttribute timeout = invalidate.getAttribute(TIMEOUT_Q);
if (timeout != null) {
mediator.setInvlidateToDestroyTime(Long.parseLong(timeout.getAttributeValue()));
} else {
mediator.setInvlidateToDestroyTime(300);
}
}
OMElement onComplete = elem.getFirstChildWithName(ON_COMPLETE_Q);
if (onComplete != null) {
OMAttribute aggregateExpr = onComplete.getAttribute(EXPRESSION_Q);
if (aggregateExpr != null) {
try {
AXIOMXPath xp = new AXIOMXPath(aggregateExpr.getAttributeValue());
OMElementUtils.addNameSpaces(xp, onComplete, log);
mediator.setAggregationExpression(xp);
} catch (JaxenException e) {
handleException("Unable to load the aggregating XPATH", e);
}