Ejemplo n.º 1
0
 protected List getMessages() throws Exception {
   QueueSession qs = connector.getQueueSession();
   Queue queue = qs.getQueue(endpoint.getEndpointURI().getAddress());
   UMOEvent event = (UMOEvent) queue.poll(connector.getQueueTimeout());
   if (event != null) {
     routeMessage(new MuleMessage(event.getTransformedMessage(), event.getMessage()));
   }
   return null;
 }
Ejemplo n.º 2
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());
     }
   }
 }
Ejemplo n.º 3
0
 /*
  * (non-Javadoc)
  *
  * @see org.mule.umo.UMOEventListener#onEvent(org.mule.umo.UMOEvent)
  */
 public void onEvent(UMOEvent event) throws UMOException {
   if (connector.isQueueEvents()) {
     QueueSession queueSession = connector.getQueueSession();
     Queue queue = queueSession.getQueue(endpoint.getEndpointURI().getAddress());
     try {
       queue.put(event);
     } catch (InterruptedException e) {
       throw new MuleException(
           CoreMessages.interruptedQueuingEventFor(this.endpoint.getEndpointURI()), e);
     }
   } else {
     UMOMessage msg = new MuleMessage(event.getTransformedMessage(), event.getMessage());
     synchronized (lock) {
       routeMessage(msg);
     }
   }
 }