コード例 #1
0
 protected void enqueue(MuleEvent event) throws Exception {
   if (queue == null) {
     throw new InitialisationException(
         MessageFactory.createStaticMessage("Queue not created for service " + name), this);
   }
   if (logger.isDebugEnabled()) {
     logger.debug(
         MessageFormat.format(
             "Service {0} putting event on queue {1}: {2}", name, queue.getName(), event));
   }
   queue.put(event);
 }
コード例 #2
0
 protected void enqueue(MuleEvent event) throws Exception {
   QueueSession session = muleContext.getQueueManager().getQueueSession();
   Queue queue = session.getQueue(name);
   if (queue == null) {
     throw new InitialisationException(
         MessageFactory.createStaticMessage("Queue " + name + " not created for service " + name),
         this);
   }
   if (logger.isDebugEnabled()) {
     logger.debug("Service " + name + " putting event on queue " + name + ": " + event);
   }
   queue.put(event);
 }
コード例 #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);
     }
   }
 }
コード例 #4
0
 public void enqueue(MessageExchange exchange) throws MessagingException {
   if (!(exchange instanceof MessageExchangeProxy)) {
     throw new MessagingException("exchange should be created with MessageExchangeFactory");
   }
   MessageExchangeProxy me = (MessageExchangeProxy) exchange;
   if (me.getSyncState() == MessageExchangeProxy.SYNC_STATE_SYNC_SENT) {
     synchronized (me) {
       me.setSyncState(MessageExchangeProxy.SYNC_STATE_SYNC_RECEIVED);
       me.notify();
     }
   } else {
     try {
       QueueSession qs = container.getQueueSession();
       Queue queue = qs.getQueue(componentName);
       queue.put(me);
     } catch (InterruptedException e) {
       logger.error(e);
     }
   }
 }