if (st.contains("<arg0>99</arg0>")) {
throw new ProtocolException("I don't like the value 99");
}
String txt = String.valueOf(Integer.valueOf(getFirstArg(st)) - 1);
st = replaceFirstArg(st, txt);
msg.setPayload(new StreamSource(new StringBufferInputStream(st)));
messagecontext.put("AddNumbersLogicalHandlerInboundAppScopedProperty", "blargval");
messagecontext.setScope("AddNumbersLogicalHandlerInboundAppScopedProperty",
Scope.APPLICATION);
messagecontext.put("AddNumbersLogicalHandlerInboundHandlerScopedProperty",
"blargval");
// Check for the presences of the attachment property
String propKey = MessageContext.INBOUND_MESSAGE_ATTACHMENTS;
Map map = (Map) messagecontext.get(propKey);
if (map == null) {
throw new RuntimeException("Property " + propKey + " was null");
}
if (!(map instanceof AttachmentsAdapter)) {
throw new RuntimeException("Expected AttachmentAddapter for Property " +
propKey);
}
} else { // outbound response if we're on the server
LogicalMessage msg = messagecontext.getMessage();
String st = getStringFromSourcePayload(msg.getPayload());
String txt = String.valueOf(Integer.valueOf(getFirstArg(st)) - deduction);
st = replaceFirstArg(st, txt);
msg.setPayload(new StreamSource(new StringBufferInputStream(st)));
// Check for the presences of the attachment property
String propKey = MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS;
Map map = (Map) messagecontext.get(propKey);
if (map == null) {