use of org.apache.handler_test.types.Ping in project cxf by apache.
the class TestHandler method handleMessage.
public boolean handleMessage(T ctx) {
methodCalled("handleMessage");
printHandlerInfo("handleMessage", isOutbound(ctx));
boolean outbound = (Boolean) ctx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
boolean ret = getHandleMessageRet();
if (!isServerSideHandler()) {
return true;
}
try {
verifyJAXWSProperties(ctx);
} catch (PingException e) {
e.printStackTrace();
throw new ProtocolException(e);
}
Object obj = ctx.getMessage().getPayload(jaxbCtx);
if (obj instanceof Ping || obj instanceof PingResponse) {
ret = handlePingMessage(outbound, ctx);
} else if (obj instanceof PingWithArgs) {
ret = handlePingWithArgsMessage(outbound, ctx);
}
return ret;
}
use of org.apache.handler_test.types.Ping in project cxf by apache.
the class TestHandler method addHandlerId.
private void addHandlerId(LogicalMessage msg, T ctx, boolean outbound) {
Object obj = msg.getPayload(jaxbCtx);
if (obj instanceof PingResponse) {
PingResponse origResp = (PingResponse) obj;
PingResponse newResp = new PingResponse();
newResp.getHandlersInfo().addAll(origResp.getHandlersInfo());
newResp.getHandlersInfo().add(getHandlerId());
msg.setPayload(newResp, jaxbCtx);
} else if (obj instanceof Ping || obj instanceof PingWithArgs) {
getHandlerInfoList(ctx).add(getHandlerId());
}
}
Aggregations