use of com.swiftmq.jms.XidImpl in project swiftmq-client by iitsoftware.
the class XAResRecoverReply method writeContent.
public void writeContent(DataOutput out) throws IOException {
super.writeContent(out);
if (xids != null) {
out.writeBoolean(true);
out.writeInt(xids.size());
for (int i = 0; i < xids.size(); i++) {
XidImpl b = (XidImpl) xids.get(i);
b.writeContent(out);
}
} else
out.writeBoolean(false);
out.writeInt(errorCode);
}
use of com.swiftmq.jms.XidImpl in project swiftmq-ce by iitsoftware.
the class RecoveryReplyRequest method readContent.
public void readContent(DataInput input) throws IOException {
super.readContent(input);
int size = input.readInt();
if (size > 0) {
xidList = new ArrayList();
for (int i = 0; i < size; i++) {
XidImpl xid = new XidImpl();
xid.readContent(input);
xidList.add(xid);
}
}
}
use of com.swiftmq.jms.XidImpl in project swiftmq-ce by iitsoftware.
the class RollbackReplyRequest method readContent.
public void readContent(DataInput input) throws IOException {
super.readContent(input);
xid = new XidImpl();
xid.readContent(input);
}
use of com.swiftmq.jms.XidImpl in project swiftmq-ce by iitsoftware.
the class RollbackRequest method readContent.
public void readContent(DataInput input) throws IOException {
super.readContent(input);
xid = new XidImpl();
xid.readContent(input);
}
use of com.swiftmq.jms.XidImpl in project swiftmq-ce by iitsoftware.
the class XADeliveryStage method close.
public void close() {
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace(ctx.routingSwiftlet.getName(), toString() + "/close ...");
super.close();
closed = true;
if (notificationList.size() > 0) {
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace(ctx.routingSwiftlet.getName(), toString() + "/close, final notify ...");
for (Iterator iter = notificationList.entrySet().iterator(); iter.hasNext(); ) {
Map.Entry entry = (Map.Entry) iter.next();
DeliveryRequest dr = (DeliveryRequest) entry.getValue();
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace(ctx.routingSwiftlet.getName(), toString() + "/close, final notify: " + dr);
dr.callback.delivered(dr);
}
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace(ctx.routingSwiftlet.getName(), toString() + "/close, final notify done");
notificationList.clear();
}
if (outboundTransactions.size() > 0) {
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace(ctx.routingSwiftlet.getName(), toString() + "/close, passing prepared outbound tx to XAResourceManager ...");
for (Iterator iter = outboundTransactions.entrySet().iterator(); iter.hasNext(); ) {
try {
Map.Entry entry = (Map.Entry) iter.next();
XidImpl xid = (XidImpl) entry.getKey();
XAContext xac = ctx.xaResourceManagerSwiftlet.createXAContext(xid);
int id = xac.register(toString());
QueuePullTransaction t = (QueuePullTransaction) entry.getValue();
xac.addTransaction(id, t.getQueueName(), t);
xac.unregister(id, false);
xac.setPrepared(true);
} catch (XAContextException e) {
ctx.logSwiftlet.logError(ctx.routingSwiftlet.getName(), toString() + "/close, passing prepared outbound tx to XAResourceManager, exception: " + e);
}
}
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace(ctx.routingSwiftlet.getName(), toString() + "/close, passing prepared outbound tx to XAResourceManager done");
outboundTransactions.clear();
}
if (inboundTransactions.size() > 0) {
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace(ctx.routingSwiftlet.getName(), toString() + "/close, passing prepared inbound tx to XAResourceManager ...");
for (Iterator iter = inboundTransactions.entrySet().iterator(); iter.hasNext(); ) {
((Tx) ((Map.Entry) iter.next()).getValue()).handOver();
}
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace(ctx.routingSwiftlet.getName(), toString() + "/close, passing prepared inbound tx to XAResourceManager done");
}
for (Iterator iter = producers.entrySet().iterator(); iter.hasNext(); ) {
QueueSender sender = (QueueSender) ((Map.Entry) iter.next()).getValue();
try {
sender.close();
} catch (Exception e) {
}
}
producers.clear();
for (Iterator iter = consumers.entrySet().iterator(); iter.hasNext(); ) {
QueueReceiver receiver = (QueueReceiver) ((Map.Entry) iter.next()).getValue();
try {
receiver.close();
} catch (Exception e) {
}
}
consumers.clear();
if (throttleQueue != null)
throttleQueue.close();
visitor.setRequestHandler(com.swiftmq.impl.routing.single.smqpr.SMQRFactory.START_STAGE_REQ, null);
visitor.setRequestHandler(com.swiftmq.impl.routing.single.smqpr.SMQRFactory.SEND_ROUTE_REQ, null);
visitor.setRequestHandler(com.swiftmq.impl.routing.single.smqpr.SMQRFactory.DELIVERY_REQ, null);
visitor.setRequestHandler(com.swiftmq.impl.routing.single.smqpr.v942.SMQRFactory.ROUTE_REQ, null);
visitor.setRequestHandler(com.swiftmq.impl.routing.single.smqpr.v942.SMQRFactory.ADJUST_REQ, null);
visitor.setRequestHandler(com.swiftmq.impl.routing.single.smqpr.v942.SMQRFactory.TRANSACTION_REQ, null);
visitor.setRequestHandler(com.swiftmq.impl.routing.single.smqpr.v942.SMQRFactory.COMMIT_REQ, null);
visitor.setRequestHandler(com.swiftmq.impl.routing.single.smqpr.v942.SMQRFactory.COMMIT_REPREQ, null);
}
Aggregations