TestTPCallServiceXOctetZero.java
上传用户:xfwatch
上传日期:2020-12-14
资源大小:872k
文件大小:1k
源码类别:
中间件编程
开发平台:
Java
- package org.jboss.blacktie.jatmibroker.xatmi;
- import org.apache.log4j.LogManager;
- import org.apache.log4j.Logger;
- public class TestTPCallServiceXOctetZero implements BlacktieService {
- private static final Logger log = LogManager
- .getLogger(TestTPCallServiceXOctetZero.class);
- public Response tpservice(TPSVCINFO svcinfo) {
- try {
- byte[] recv = ((X_OCTET) svcinfo.getBuffer()).getByteArray();
- byte[] toSend = new byte[recv.length];
- int j = recv.length;
- for (int i = 0; i < toSend.length; i++) {
- toSend[i] = recv[--j];
- }
- X_OCTET toReturn = (X_OCTET) svcinfo.tpalloc("X_OCTET", null);
- toReturn.setByteArray(toSend);
- return new Response((short) 0, 0, toReturn, toSend.length, 0);
- } catch (ConnectionException e) {
- return new Response(Connection.TPFAIL, Connection.TPEITYPE, null,
- 0, 0);
- }
- }
- }