in modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java [241:308]
public void engageNotify(AxisDescription axisDescription) throws AxisFault {
if(log.isDebugEnabled()) log.debug("Entry: SandeshaModule::engageNotify, " + axisDescription);
AxisDescription parent = axisDescription.getParent();
SandeshaPolicyBean parentPropertyBean = null;
if(parent != null) parentPropertyBean = SandeshaUtil.getPropertyBean(parent);
SandeshaPolicyBean axisDescPropertyBean = PropertyManager.loadPropertiesFromAxisDescription(axisDescription,parentPropertyBean);
if (axisDescPropertyBean!=null) {
Parameter parameter = new Parameter ();
parameter.setName(Sandesha2Constants.SANDESHA_PROPERTY_BEAN);
parameter.setValue(axisDescPropertyBean);
axisDescription.addParameter(parameter);
}
// When we engage Sandesha for a Service, we check to see if there are
// any OUT_IN MEPs on it's operations. If there are then we record that,
// so that we know we should send an Offer for WSRM 1.0 Sequences.
// We check the operation names, as the RM operations are added in as
// well, and and we only want to consider the user's operations.
if(axisDescription instanceof AxisService) {
AxisService service = (AxisService) axisDescription;
Iterator<AxisOperation> ops = service.getOperations();
while(ops.hasNext()) {
AxisOperation op = (AxisOperation) ops.next();
if (log.isDebugEnabled()) log.debug("Examining operation " + op.getName() + ", mep " + op.getMessageExchangePattern());
String name = null;
QName qName = op.getName();
if(qName != null) name = qName.getLocalPart();
//Check to see if the operation is a sandesha defined one or an axis2 defined one
if((name != null) && (name.startsWith(Sandesha2Constants.SANDESHA_OP_PREFIX) ||
qName.getNamespaceURI().equals(org.apache.axis2.namespace.Constants.AXIS2_NAMESPACE_URI)))
continue;
// If we get to here then we must have one of the user's operations, so
// check the MEP.
if(op.getAxisSpecificMEPConstant() == WSDLConstants.MEP_CONSTANT_OUT_IN) {
Parameter p = new Parameter(Sandesha2Constants.SERVICE_CONTAINS_OUT_IN_MEPS, Boolean.TRUE);
service.addParameter(p);
break;
}
}
} else if(axisDescription instanceof AxisOperation) {
AxisOperation op = (AxisOperation) axisDescription;
if (log.isDebugEnabled()) log.debug("Examining operation " + op.getName() + ", mep " + op.getAxisSpecificMEPConstant());
String name = null;
QName qName = op.getName();
if(qName != null) name = qName.getLocalPart();
//Check to see if the operation is a sandesha defined one or an axis2 defined one
if(name != null && (!name.startsWith(Sandesha2Constants.SANDESHA_OP_PREFIX)) &&
(!qName.getNamespaceURI().equals(org.apache.axis2.namespace.Constants.AXIS2_NAMESPACE_URI))) {
// If we get to here then we must have one of the user's operations, so
// check the MEP.
if(op.getAxisSpecificMEPConstant() == WSDLConstants.MEP_CONSTANT_OUT_IN) {
Parameter p = new Parameter(Sandesha2Constants.SERVICE_CONTAINS_OUT_IN_MEPS, Boolean.TRUE);
op.getParent().addParameter(p);
}
}
}
if(log.isDebugEnabled()) log.debug("Exit: SandeshaModule::engageNotify");
}