Package org.jboss.narayana.blacktie.jatmibroker.xatmi

Examples of org.jboss.narayana.blacktie.jatmibroker.xatmi.X_OCTET


  public EchoServiceTestService() throws ConfigurationException {
    super();
  }

  public Response tpservice(TPSVCINFO svcinfo) throws ConnectionException {
    X_OCTET rcvd = (X_OCTET) svcinfo.getBuffer();
    X_OCTET buffer = (X_OCTET) svcinfo.getConnection().tpalloc("X_OCTET",
        null, rcvd.getByteArray().length);
    buffer.setByteArray(rcvd.getByteArray());
    return new Response(Connection.TPSUCCESS, 0, buffer, 0);
  }
View Full Code Here


      .getLogger(RollbackOnlyTpcallTPESVCFAILService.class);

  public Response tpservice(TPSVCINFO svcinfo) throws ConnectionException {
    log.info("test_tpcall_TPESVCFAIL_service");
    int len = 60;
    X_OCTET toReturn = (X_OCTET) svcinfo.getConnection().tpalloc("X_OCTET",
        null, len);
    toReturn.setByteArray("test_tpcall_TPESVCFAIL_service".getBytes());
    return new Response(Connection.TPFAIL, 0, toReturn, 0);
  }
View Full Code Here

        return args;
      }
    } else if (args.contains("tx=create")) {
      try {
        byte[] echo = args.getBytes();
        X_OCTET buffer = (X_OCTET) connection.tpalloc("X_OCTET", null,
            echo.length);
        buffer.setByteArray(echo);

        log.info("Invoking TxCreateService...");
        Response response = connection.tpcall("TxCreateService",
            buffer, 0);
        X_OCTET rcvd = (X_OCTET) response.getBuffer();
        String responseData = new String(rcvd.getByteArray());
        log.info("TxCreateService response: " + responseData);

        // check that the remote service created a transaction
        JABTransaction tx = JABTransaction.current();
        if (tx != null) {
View Full Code Here

      }
    }
  }

  public Response tpservice(TPSVCINFO svcinfo) throws ConnectionException {
    X_OCTET rcv = (X_OCTET) svcinfo.getBuffer();
    String rcvd = new String(rcv.getByteArray());
    String resp;
    try {
      resp = serviceRequest(svcinfo.getConnection(), new String(rcvd));
    } catch (javax.naming.NamingException e) {
      log.warn("error: " + e, e);
      resp = e.getMessage();
    }
    X_OCTET buffer = (X_OCTET) svcinfo.getConnection().tpalloc("X_OCTET",
        null, resp.length());
    buffer.setByteArray(resp.getBytes());
    return new Response(Connection.TPSUCCESS, 0, buffer, 0);
  }
View Full Code Here

      Thread.sleep(timeout * 1000);
      log.info("test_tpcall_TPETIME_service, slept for " + timeout
          + " seconds");

      int len = 60;
      X_OCTET toReturn = (X_OCTET) svcinfo.getConnection().tpalloc(
          "X_OCTET", null, len);
      toReturn.setByteArray("test_tpcall_TPETIME_service".getBytes());
      return new Response(Connection.TPSUCCESS, 0, toReturn, 0);
    } catch (InterruptedException e) {
      return new Response(Connection.TPFAIL, 0, null, 0);
    }
  }
View Full Code Here

TOP

Related Classes of org.jboss.narayana.blacktie.jatmibroker.xatmi.X_OCTET

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.