use of org.apache.activemq.artemis.jms.server.JMSServerManager in project wildfly by wildfly.
the class JMSQueueService method stop.
@Override
public synchronized void stop(final StopContext context) {
final JMSServerManager jmsManager = jmsServer.getValue();
final Runnable task = new Runnable() {
@Override
public void run() {
try {
jmsManager.removeQueueFromBindingRegistry(queueName);
queue = null;
} catch (Throwable e) {
MessagingLogger.ROOT_LOGGER.failedToDestroy(e, "queue", queueName);
}
context.complete();
}
};
// JMS Server Manager uses locking which waits on service completion, use async to prevent starvation
try {
executorInjector.getValue().execute(task);
} catch (RejectedExecutionException e) {
task.run();
} finally {
context.asynchronous();
}
}
use of org.apache.activemq.artemis.jms.server.JMSServerManager in project wildfly by wildfly.
the class JMSTopicService method stop.
@Override
public synchronized void stop(final StopContext context) {
final JMSServerManager jmsManager = jmsServer.getValue();
final Runnable task = new Runnable() {
@Override
public void run() {
try {
jmsManager.removeTopicFromBindingRegistry(name);
topic = null;
} catch (Throwable e) {
MessagingLogger.ROOT_LOGGER.failedToDestroy(e, "jms topic", name);
}
context.complete();
}
};
// JMS Server Manager uses locking which waits on service completion, use async to prevent starvation
try {
executorInjector.getValue().execute(task);
} catch (RejectedExecutionException e) {
task.run();
} finally {
context.asynchronous();
}
}
Aggregations