Package com.sun.messaging.jmq.jmsserver.data

Examples of com.sun.messaging.jmq.jmsserver.data.TransactionUID


            long transactionId, Xid xid, int flags)
        throws JMSServiceException  {
  JMSServiceReply reply;
  HashMap props = new HashMap();
  IMQConnection cxn;
  TransactionUID txnUID = null;
  JMQXid jmqXid = null;
  Integer xaFlags;
  long tid = 0;

        cxn = checkConnectionId(connectionId, "commitTransaction");

  txnUID = new TransactionUID(transactionId);
        if (xid != null)
      jmqXid = new JMQXid(xid);

  xaFlags = new Integer(flags);

  try  {
      protocol.commitTransaction(txnUID, jmqXid, xaFlags, cxn);
  } catch(BrokerException be)  {
      String errStr = "CommitTransaction: commit failed. Connection ID: "
      + connectionId
      + ", Transaction ID: "
      + transactionId;

            logger.logStack(Logger.ERROR, errStr, be);
      props.put("JMQStatus", getErrorReplyStatus(be));
      throw new JMSServiceException(errStr, be, props);
  }

  props.put("JMQStatus", JMSServiceReply.Status.OK);
  props.put("JMQTransactionID", txnUID.longValue());
  reply = new JMSServiceReply(props, null);

  return (reply);
    }
View Full Code Here


            long transactionId, Xid xid, boolean redeliver,
            boolean setRedelivered) throws JMSServiceException  {
  JMSServiceReply reply;
  HashMap props = new HashMap();
  IMQConnection cxn;
  TransactionUID txnUID = null;
  JMQXid jmqXid = null;
  Integer xaFlags = null;

        cxn = checkConnectionId(connectionId, "rollbackTransaction");

  txnUID = new TransactionUID(transactionId);

  if (xid != null)  {
      jmqXid = new JMQXid(xid);
      /*
      xaFlags = new Integer(flags);
      */
  }

  try  {
      protocol.rollbackTransaction(txnUID, jmqXid, xaFlags, cxn, redeliver, setRedelivered);
  } catch(BrokerException be)  {
      String errStr = "rollbackTransaction: rollback transaction failed. Connection ID: "
      + connectionId
      + ", Transaction ID: "
      + transactionId
      + ", XID: "
      + xid;

            logger.logStack(Logger.ERROR, errStr, be);
      props.put("JMQStatus", getErrorReplyStatus(be));
      throw new JMSServiceException(errStr, be, props);
  }

  props.put("JMQStatus", JMSServiceReply.Status.OK);
  props.put("JMQTransactionID", txnUID.longValue());
  reply = new JMSServiceReply(props, null);

  return (reply);
    }
View Full Code Here

     *          PREPARED state a zero (0L) is returned.
     */
    public long recoverTransaction(long connectionId, long transactionId)
          throws JMSServiceException  {
  IMQConnection cxn;
        TransactionUID txnUID = null;
  JMQXid jmqXids[];
  long tid = 0;

        cxn = checkConnectionId(connectionId, "recoverTransaction");
  txnUID = new TransactionUID(transactionId);

  try  {
      jmqXids = protocol.recoverTransaction(txnUID);

      if (jmqXids.length > 0)  {
View Full Code Here

  try  {
          conUID = new ConsumerUID(consumerId);
            msg = slistener.getNextConsumerPacket(conUID, timeout);
            if ((msg != null) && acknowledge) {
              TransactionUID txnUID = null;

            if (transactionId != 0)  {
                  txnUID = new TransactionUID(transactionId);
            }
                SysMessageID ids[] = new SysMessageID[1];
                ids[0] = ((Packet)msg).getSysMessageID();
                ConsumerUID cids[] = new ConsumerUID[1];
                cids[0] = conUID;
View Full Code Here

     */
    public JMSServiceReply acknowledgeMessage(long connectionId, long sessionId,
            long consumerId, SysMessageID sysMessageID, long transactionId,
            MessageAckType ackType) throws JMSServiceException  {
  boolean validate = false;
        TransactionUID txnUID = null;
        int brokerAckType;
        int deliverCnt = -1;
  SysMessageID ids[] = null;
  ConsumerUID cids[] = null;
        Throwable deadThr = null;
  String deadComment = null;
  JMSServiceReply reply;
  HashMap props = new HashMap();
  IMQConnection cxn;

        cxn = checkConnectionId(connectionId, "acknowledgeMessage");

  if (transactionId != 0)  {
      txnUID = new TransactionUID(transactionId);
  }

  brokerAckType = convertToBrokerAckType(ackType);

  ids = new SysMessageID [ 1 ];
View Full Code Here

                MessageAckType ackType, JMSPacket acks)
      throws JMSServiceException  {

  boolean validate = false;
  long transactionId = -1;
        TransactionUID txnUID = null;
        int brokerAckType;
        int deliverCnt = -1;
  SysMessageID ids[] = null;
  ConsumerUID cids[] = null;
        Throwable deadThr = null;
  String deadComment = null;
  JMSServiceReply reply;
  HashMap props = new HashMap();
  IMQConnection cxn;

        cxn = checkConnectionId(connectionId, "sendAcknowledgement");

  if (transactionId != -1)  {
      txnUID = new TransactionUID(transactionId);
  }

  brokerAckType = convertToBrokerAckType(ackType);

  try  {
View Full Code Here

            boolean setRedelivered) throws JMSServiceException  {
  JMSServiceReply reply;
  IMQConnection cxn;
  HashMap props = new HashMap();
  ConsumerUID conUIDs[] = null;
        TransactionUID txnUID = null;
  Session session;

        cxn = checkConnectionId(connectionId, "redeliverMessages");
        session = checkSessionId(sessionId, "redeliverMessages");

  if (consumerIds != null)  {
      conUIDs = new ConsumerUID [ consumerIds.length ];
      for (int i = 0; i < consumerIds.length; ++i)  {
          conUIDs[i] = new ConsumerUID(consumerIds[i]);
      }
  }

  if (transactionId != -1)  {
      txnUID = new TransactionUID(transactionId);
  }

  try  {
      protocol.redeliver(conUIDs, messageIDs, cxn, txnUID, true);
  } catch(Exception e)  {
View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.jmsserver.data.TransactionUID

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.