SandeshaPolicyBean parentPropertyBean = SandeshaUtil.getPropertyBean(axisDescription.getParent());
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 ops = service.getOperations();
while(ops.hasNext()) {
AxisOperation op = (AxisOperation) ops.next();
log.debug("Examining operation " + op.getName() + ", mep " + op.getMessageExchangePattern());
String name = null;
QName qName = op.getName();
if(qName != null) name = qName.getLocalPart();
if((name != null && name.startsWith(Sandesha2Constants.SANDESHA_OP_PREFIX)) ||
ServiceClient.ANON_OUT_IN_OP.equals(qName))
break;
// If we get to here then we must have one of the user's operations, so
// check the MEP.
if(op.getAxisSpecifMEPConstant() == 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;
log.debug("Examining operation " + op.getName() + ", mep " + op.getAxisSpecifMEPConstant());
String name = null;
QName qName = op.getName();
if(qName != null) name = qName.getLocalPart();
if((name != null && !name.startsWith(Sandesha2Constants.SANDESHA_OP_PREFIX)) &&
!ServiceClient.ANON_OUT_IN_OP.equals(qName)) {
// If we get to here then we must have one of the user's operations, so
// check the MEP.
if(op.getAxisSpecifMEPConstant() == WSDLConstants.MEP_CONSTANT_OUT_IN) {
Parameter p = new Parameter(Sandesha2Constants.SERVICE_CONTAINS_OUT_IN_MEPS, Boolean.TRUE);
op.getParent().addParameter(p);
}
}
}