org.apache.activemq.command.XATransactionId.getEncodedXidBytes()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中org.apache.activemq.command.XATransactionId.getEncodedXidBytes()方法的一些代码示例,展示了XATransactionId.getEncodedXidBytes()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XATransactionId.getEncodedXidBytes()方法的具体详情如下:
包路径:org.apache.activemq.command.XATransactionId
类名称:XATransactionId
方法名:getEncodedXidBytes

XATransactionId.getEncodedXidBytes介绍

暂无

代码示例

代码示例来源:origin: apache/activemq

s.setLong(1, seq);
} else {
  byte[] xidVal = xid.getEncodedXidBytes();
  xidVal[0] = '-';
  String xidString = printBase64Binary(xidVal);

代码示例来源:origin: apache/activemq

private byte[] encodeXid(XATransactionId xid, long seq, long priority) {
  byte[] xidVal = xid.getEncodedXidBytes();
  // encode the update
  DataByteArrayOutputStream outputStream = xid.internalOutputStream();
  outputStream.position(1);
  outputStream.writeLong(seq);
  outputStream.writeByte(Long.valueOf(priority).byteValue());
  return xidVal;
}

代码示例来源:origin: apache/activemq

setBinaryData(s, 7, data);
if (xid != null) {
  byte[] xidVal = xid.getEncodedXidBytes();
  xidVal[0] = '+';
  String xidString = printBase64Binary(xidVal);

代码示例来源:origin: apache/activemq

@Override
public void doAddMessage(TransactionContext c, long sequence, MessageId messageID, ActiveMQDestination destination, byte[] data,
             long expiration, byte priority, XATransactionId xid) throws SQLException, IOException {
  PreparedStatement s = null;
  try {
    // Add the Blob record.
    s = c.getConnection().prepareStatement(statements.getAddMessageStatement());
    s.setLong(1, sequence);
    s.setString(2, messageID.getProducerId().toString());
    s.setLong(3, messageID.getProducerSequenceId());
    s.setString(4, destination.getQualifiedName());
    s.setLong(5, expiration);
    s.setLong(6, priority);
    if (s.executeUpdate() != 1) {
      throw new IOException("Failed to add broker message: " + messageID + " in container.");
    }
    s.close();
    // Select the blob record so that we can update it.
    updateBlob(c.getConnection(), statements.getFindMessageByIdStatement(), sequence, data);
    if (xid != null) {
      byte[] xidVal = xid.getEncodedXidBytes();
      xidVal[0] = '+';
      updateBlob(c.getConnection(), statements.getFindXidByIdStatement(), sequence, xidVal);
    }
  } finally {
    close(s);
  }
}

代码示例来源:origin: org.apache.activemq/activemq-all

s.setLong(1, seq);
} else {
  byte[] xidVal = xid.getEncodedXidBytes();
  xidVal[0] = '-';
  String xidString = printBase64Binary(xidVal);

代码示例来源:origin: org.apache.activemq/activemq-jdbc-store

s.setLong(1, seq);
} else {
  byte[] xidVal = xid.getEncodedXidBytes();
  xidVal[0] = '-';
  String xidString = printBase64Binary(xidVal);

代码示例来源:origin: org.apache.activemq/activemq-osgi

s.setLong(1, seq);
} else {
  byte[] xidVal = xid.getEncodedXidBytes();
  xidVal[0] = '-';
  String xidString = printBase64Binary(xidVal);

代码示例来源:origin: org.apache.activemq/activemq-all

setBinaryData(s, 7, data);
if (xid != null) {
  byte[] xidVal = xid.getEncodedXidBytes();
  xidVal[0] = '+';
  String xidString = printBase64Binary(xidVal);

代码示例来源:origin: org.apache.activemq/activemq-jdbc-store

setBinaryData(s, 7, data);
if (xid != null) {
  byte[] xidVal = xid.getEncodedXidBytes();
  xidVal[0] = '+';
  String xidString = printBase64Binary(xidVal);

代码示例来源:origin: org.apache.activemq/activemq-all

private byte[] encodeXid(XATransactionId xid, long seq, long priority) {
  byte[] xidVal = xid.getEncodedXidBytes();
  // encode the update
  DataByteArrayOutputStream outputStream = xid.internalOutputStream();
  outputStream.position(1);
  outputStream.writeLong(seq);
  outputStream.writeByte(Long.valueOf(priority).byteValue());
  return xidVal;
}

代码示例来源:origin: org.apache.activemq/activemq-jdbc-store

private byte[] encodeXid(XATransactionId xid, long seq, long priority) {
  byte[] xidVal = xid.getEncodedXidBytes();
  // encode the update
  DataByteArrayOutputStream outputStream = xid.internalOutputStream();
  outputStream.position(1);
  outputStream.writeLong(seq);
  outputStream.writeByte(Long.valueOf(priority).byteValue());
  return xidVal;
}

代码示例来源:origin: org.apache.activemq/activemq-osgi

private byte[] encodeXid(XATransactionId xid, long seq, long priority) {
  byte[] xidVal = xid.getEncodedXidBytes();
  // encode the update
  DataByteArrayOutputStream outputStream = xid.internalOutputStream();
  outputStream.position(1);
  outputStream.writeLong(seq);
  outputStream.writeByte(Long.valueOf(priority).byteValue());
  return xidVal;
}

代码示例来源:origin: org.apache.activemq/activemq-osgi

setBinaryData(s, 7, data);
if (xid != null) {
  byte[] xidVal = xid.getEncodedXidBytes();
  xidVal[0] = '+';
  String xidString = printBase64Binary(xidVal);

代码示例来源:origin: org.apache.activemq/activemq-all

@Override
public void doAddMessage(TransactionContext c, long sequence, MessageId messageID, ActiveMQDestination destination, byte[] data,
             long expiration, byte priority, XATransactionId xid) throws SQLException, IOException {
  PreparedStatement s = null;
  try {
    // Add the Blob record.
    s = c.getConnection().prepareStatement(statements.getAddMessageStatement());
    s.setLong(1, sequence);
    s.setString(2, messageID.getProducerId().toString());
    s.setLong(3, messageID.getProducerSequenceId());
    s.setString(4, destination.getQualifiedName());
    s.setLong(5, expiration);
    s.setLong(6, priority);
    if (s.executeUpdate() != 1) {
      throw new IOException("Failed to add broker message: " + messageID + " in container.");
    }
    s.close();
    // Select the blob record so that we can update it.
    updateBlob(c.getConnection(), statements.getFindMessageByIdStatement(), sequence, data);
    if (xid != null) {
      byte[] xidVal = xid.getEncodedXidBytes();
      xidVal[0] = '+';
      updateBlob(c.getConnection(), statements.getFindXidByIdStatement(), sequence, xidVal);
    }
  } finally {
    close(s);
  }
}

代码示例来源:origin: org.apache.activemq/activemq-osgi

@Override
public void doAddMessage(TransactionContext c, long sequence, MessageId messageID, ActiveMQDestination destination, byte[] data,
             long expiration, byte priority, XATransactionId xid) throws SQLException, IOException {
  PreparedStatement s = null;
  try {
    // Add the Blob record.
    s = c.getConnection().prepareStatement(statements.getAddMessageStatement());
    s.setLong(1, sequence);
    s.setString(2, messageID.getProducerId().toString());
    s.setLong(3, messageID.getProducerSequenceId());
    s.setString(4, destination.getQualifiedName());
    s.setLong(5, expiration);
    s.setLong(6, priority);
    if (s.executeUpdate() != 1) {
      throw new IOException("Failed to add broker message: " + messageID + " in container.");
    }
    s.close();
    // Select the blob record so that we can update it.
    updateBlob(c.getConnection(), statements.getFindMessageByIdStatement(), sequence, data);
    if (xid != null) {
      byte[] xidVal = xid.getEncodedXidBytes();
      xidVal[0] = '+';
      updateBlob(c.getConnection(), statements.getFindXidByIdStatement(), sequence, xidVal);
    }
  } finally {
    close(s);
  }
}

代码示例来源:origin: org.apache.activemq/activemq-jdbc-store

@Override
public void doAddMessage(TransactionContext c, long sequence, MessageId messageID, ActiveMQDestination destination, byte[] data,
             long expiration, byte priority, XATransactionId xid) throws SQLException, IOException {
  PreparedStatement s = null;
  try {
    // Add the Blob record.
    s = c.getConnection().prepareStatement(statements.getAddMessageStatement());
    s.setLong(1, sequence);
    s.setString(2, messageID.getProducerId().toString());
    s.setLong(3, messageID.getProducerSequenceId());
    s.setString(4, destination.getQualifiedName());
    s.setLong(5, expiration);
    s.setLong(6, priority);
    if (s.executeUpdate() != 1) {
      throw new IOException("Failed to add broker message: " + messageID + " in container.");
    }
    s.close();
    // Select the blob record so that we can update it.
    updateBlob(c.getConnection(), statements.getFindMessageByIdStatement(), sequence, data);
    if (xid != null) {
      byte[] xidVal = xid.getEncodedXidBytes();
      xidVal[0] = '+';
      updateBlob(c.getConnection(), statements.getFindXidByIdStatement(), sequence, xidVal);
    }
  } finally {
    close(s);
  }
}

相关文章