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); }
protected MuleEvent dequeue() 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} polling queue {1}, timeout = {2}", name, queue.getName(), queueTimeout)); } if (getQueueTimeout() == null) { throw new InitialisationException(CoreMessages.noServiceQueueTimeoutSet(this), this); } else { return (MuleEvent) queue.poll(getQueueTimeout()); } }