use of org.jboss.narayana.blacktie.jatmibroker.xatmi.X_OCTET in project narayana by jbosstm.
the class TPGetRplyTwoService method tpservice.
public Response tpservice(TPSVCINFO svcinfo) throws ConnectionException, ConfigurationException {
String response = "test_tpgetrply_TPGETANY_two";
log.info(response);
X_OCTET toReturn = (X_OCTET) svcinfo.getConnection().tpalloc("X_OCTET", null);
toReturn.setByteArray(response.getBytes());
return new Response(Connection.TPSUCCESS, 0, toReturn, 0);
}
use of org.jboss.narayana.blacktie.jatmibroker.xatmi.X_OCTET in project narayana by jbosstm.
the class TPConversationShortService method tpservice.
public Response tpservice(TPSVCINFO svcinfo) throws ConnectionException, ConfigurationException {
log.info("testTPConversation_short_service");
int sendlen = 4;
X_OCTET sendbuf = (X_OCTET) svcinfo.getConnection().tpalloc("X_OCTET", null);
sendbuf.setByteArray("hi0".getBytes());
svcinfo.getSession().tpsend(sendbuf, 0);
sendbuf.setByteArray("hi1".getBytes());
return new Response(Connection.TPSUCCESS, 0, sendbuf, 0);
}
use of org.jboss.narayana.blacktie.jatmibroker.xatmi.X_OCTET in project narayana by jbosstm.
the class TPGetRplyOneService method tpservice.
public Response tpservice(TPSVCINFO svcinfo) throws ConnectionException, ConfigurationException {
String response = "test_tpgetrply_TPGETANY_one";
log.info(response);
X_OCTET toReturn = (X_OCTET) svcinfo.getConnection().tpalloc("X_OCTET", null);
toReturn.setByteArray(response.getBytes());
try {
Thread.sleep(3 * 1000);
} catch (InterruptedException e) {
log.error("Could not sleep");
}
return new Response(Connection.TPSUCCESS, 0, toReturn, 0);
}
use of org.jboss.narayana.blacktie.jatmibroker.xatmi.X_OCTET in project narayana by jbosstm.
the class TTLService method tpservice.
public Response tpservice(TPSVCINFO svcinfo) throws ConnectionException, ConfigurationException {
log.info("TTLService");
X_OCTET dptr = (X_OCTET) svcinfo.getBuffer();
String data = new String(dptr.getByteArray());
log.info("test_ttl_service get data: " + data);
int len = 60;
X_OCTET toReturn = (X_OCTET) svcinfo.getConnection().tpalloc("X_OCTET", null);
log.info("Data was: " + data);
if (data.contains("counter")) {
String counter = String.valueOf(n);
toReturn.setByteArray(counter.getBytes());
len = counter.length();
} else {
try {
int timeout = 60;
log.info("TTLService sleep for " + timeout + " seconds");
Thread.sleep(timeout * 1000);
log.info("TTLService slept for " + timeout + " seconds");
toReturn.setByteArray("test_ttl_service".getBytes());
} catch (Exception e) {
log.error("sleep failed with " + e);
}
n++;
}
return new Response(Connection.TPSUCCESS, 22, toReturn, 0);
}
use of org.jboss.narayana.blacktie.jatmibroker.xatmi.X_OCTET in project narayana by jbosstm.
the class TPACallService method tpservice.
public Response tpservice(TPSVCINFO svcinfo) throws ConnectionException, ConfigurationException {
log.info("testtpacall_service");
int len = 20;
X_OCTET toReturn = (X_OCTET) svcinfo.getConnection().tpalloc("X_OCTET", null);
toReturn.setByteArray("testtpacall_service".getBytes());
return new Response(Connection.TPSUCCESS, 0, toReturn, 0);
}
Aggregations