Esempio n. 1
0
 public int getQueueSize() {
   if (queue == null) {
     logger.warn(
         new InitialisationException(
             MessageFactory.createStaticMessage("Queue not created for service " + name), this));
     return -1;
   }
   return queue.size();
 }
Esempio n. 2
0
 protected void doStop() throws MuleException {
   if (queue != null && queue.size() > 0) {
     try {
       stopping.whenFalse(null);
     } catch (InterruptedException e) {
       // we can ignore this
       // TODO MULE-863: Why?
     }
   }
   workManager.dispose();
 }
Esempio n. 3
0
 public int getQueueSize() {
   QueueSession session = muleContext.getQueueManager().getQueueSession();
   Queue queue = session.getQueue(name);
   if (queue == null) {
     logger.warn(
         new InitialisationException(
             MessageFactory.createStaticMessage(
                 "Queue " + name + " not created for service " + name),
             this));
     return -1;
   }
   return queue.size();
 }
Esempio n. 4
0
 protected void doConnect() throws Exception {
   if (connector.isQueueEvents()) {
     // Ensure we can create a vm queue
     QueueSession queueSession = connector.getQueueSession();
     Queue q = queueSession.getQueue(endpoint.getEndpointURI().getAddress());
     if (logger.isDebugEnabled()) {
       logger.debug(
           "Current queue depth for queue: "
               + endpoint.getEndpointURI().getAddress()
               + " is: "
               + q.size());
     }
   }
 }