use of com.swiftmq.tools.requestreply.Reply in project swiftmq-client by iitsoftware.
the class SessionImpl method recover.
public synchronized void recover() throws JMSException {
verifyState();
if (!transacted) {
startRecoverConsumers();
Reply reply = null;
try {
reply = requestRegistry.request(new RecoverSessionRequest(dispatchId));
} catch (Exception e) {
throw ExceptionConverter.convert(e);
}
if (reply.isOk()) {
endRecoverConsumers();
} else {
throw ExceptionConverter.convert(reply.getException());
}
} else {
throw new javax.jms.IllegalStateException("Session is transacted - recover not allowed");
}
}
use of com.swiftmq.tools.requestreply.Reply in project swiftmq-client by iitsoftware.
the class TopicConnectionConsumerImpl method createDurableSubscriber.
void createDurableSubscriber(TopicImpl topic, String messageSelector, String durableName) throws JMSException {
try {
SwiftUtilities.verifyDurableName(durableName);
} catch (Exception e) {
throw new JMSException(e.getMessage());
}
Reply reply = null;
try {
reply = requestRegistry.request(new CreateDurableRequest(dispatchId, topic, messageSelector, false, durableName));
} catch (Exception e) {
throw ExceptionConverter.convert(e);
}
if (reply.isOk()) {
queueName = ((CreateDurableReply) reply).getQueueName();
} else {
throw ExceptionConverter.convert(reply.getException());
}
fillCache();
}
use of com.swiftmq.tools.requestreply.Reply in project swiftmq-client by iitsoftware.
the class QueueBrowserImpl method close.
/**
* Since a provider may allocate some resources on behalf of a
* QueueBrowser 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.
*
* @throws JMSException if a JMS fails to close this
* Browser due to some JMS error.
*/
public void close() throws JMSException {
verifyState();
closed = true;
Reply reply = null;
try {
reply = requestRegistry.request(new com.swiftmq.jms.smqp.v500.CloseBrowserRequest(dispatchId, browserDispatchId));
} 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 SessionImpl method createShadowConsumer.
void createShadowConsumer(String queueName) throws Exception {
Reply reply = requestRegistry.request(new CreateShadowConsumerRequest(dispatchId, queueName));
if (!reply.isOk())
throw reply.getException();
shadowConsumerCreated = true;
}
use of com.swiftmq.tools.requestreply.Reply in project swiftmq-client by iitsoftware.
the class TopicConnectionConsumerImpl method createSubscriber.
void createSubscriber(TopicImpl topic, String messageSelector) throws JMSException {
Reply reply = null;
try {
reply = requestRegistry.request(new CreateSubscriberRequest(dispatchId, (TopicImpl) topic, messageSelector, false));
} catch (Exception e) {
throw ExceptionConverter.convert(e);
}
if (reply.isOk()) {
queueName = ((CreateSubscriberReply) reply).getTmpQueueName();
} else {
throw ExceptionConverter.convert(reply.getException());
}
fillCache();
}
Aggregations