use of com.swiftmq.tools.requestreply.Reply in project swiftmq-client by iitsoftware.
the class ConnectionConsumerImpl method close.
public void close() throws JMSException {
if (closed)
return;
Reply reply = null;
try {
reply = requestRegistry.request(new CloseSessionRequest(dispatchId));
} catch (Exception e) {
throw ExceptionConverter.convert(e);
}
deliveryQueue.stopQueue();
deliveryQueue.close();
myConnection.removeRequestService(myDispatchId);
myConnection.removeConnectionConsumer(this);
if (!reply.isOk()) {
throw ExceptionConverter.convert(reply.getException());
}
}
use of com.swiftmq.tools.requestreply.Reply in project swiftmq-client by iitsoftware.
the class MessageConsumerImpl method close.
private void close(String exception) throws JMSException {
synchronized (this) {
messageCache.clear();
notify();
}
if (isClosed())
return;
closed = true;
synchronized (mySession) {
Reply reply = null;
// must be released by the connection!
try {
reply = requestRegistry.request(new CloseConsumerRequest(dispatchId, dispatchId, serverQueueConsumerId, exception));
} catch (Exception e) {
throw ExceptionConverter.convert(e);
}
if (!reply.isOk()) {
throw ExceptionConverter.convert(reply.getException());
}
}
mySession.removeMessageConsumerImpl(this);
}
use of com.swiftmq.tools.requestreply.Reply in project swiftmq-client by iitsoftware.
the class MessageProducerImpl method close.
/**
* Since a provider may allocate some resources on behalf of a
* MessageProducer outside the JVM, clients should close them when they
* are not needed. Relying on garbage collection to eventually reclaim
* these resources may not be timely enough.
*/
public void close() throws JMSException {
if (closed || mySession.isClosed())
return;
closed = true;
// Fix: 2.1.0
if (producerId == -1)
return;
Reply reply = null;
try {
reply = requestRegistry.request(new CloseProducerRequest(dispatchId, producerId));
} catch (Exception e) {
throw ExceptionConverter.convert(e);
}
if (!reply.isOk()) {
throw ExceptionConverter.convert(reply.getException());
}
}
use of com.swiftmq.tools.requestreply.Reply in project swiftmq-client by iitsoftware.
the class SMQPVisitorAdapter method visit.
public void visit(XAResPrepareRequest req) {
Reply reply = req.createReply();
reply.setOk(false);
reply.setException(new Exception("Please install the JMS XA/ASF Swiftlet to use this functionality!"));
reply.send();
}
use of com.swiftmq.tools.requestreply.Reply in project swiftmq-client by iitsoftware.
the class SMQPVisitorAdapter method visit.
public void visit(XAResCommitRequest req) {
Reply reply = req.createReply();
reply.setOk(false);
reply.setException(new Exception("Please install the JMS XA/ASF Swiftlet to use this functionality!"));
reply.send();
}
Aggregations