use of com.sun.messaging.jmq.io.GPacket in project openmq by eclipse-ee4j.
the class ClusterTxnInfoInfo method getGPacket.
public GPacket getGPacket() throws IOException {
GPacket gp = GPacket.getInstance();
gp.setType(ProtocolGlobals.G_TRANSACTION_INFO);
gp.putProp("transactionID", transactionID);
gp.putProp("transactionState", Integer.valueOf(transactionState));
if (owner) {
gp.putProp("owner", Boolean.TRUE);
c.marshalBrokerAddress(c.getSelfAddress(), gp);
}
if (msgStoreSession != null) {
gp.putProp("messageStoreSession", Long.valueOf(msgStoreSession.longValue()));
}
if (brokers != null) {
StringBuilder buf = new StringBuilder();
for (int i = 0; i < brokers.length; i++) {
if (i > 0) {
buf.append(',');
}
buf.append(brokers[i].toProtocolString());
}
gp.putProp("brokers", buf.toString());
}
if (waitfor != null) {
StringBuilder buf = new StringBuilder();
for (int i = 0; i < waitfor.length; i++) {
if (i > 0) {
buf.append(',');
}
buf.append(waitfor[i].toProtocolString());
}
gp.putProp("waitfor", buf.toString());
}
if (txnHome != null) {
gp.putProp("transactionHome", txnHome.toProtocolString());
}
if (xid != null) {
gp.putProp("X", xid);
}
gp.setBit(gp.A_BIT, false);
return gp;
}
Aggregations