Package org.mule.util.queue

Examples of org.mule.util.queue.QueueSession


        Transaction tx = TransactionCoordination.getInstance().getTransaction();
        if (tx != null)
        {
            if (tx.hasResource(queueManager))
            {
                final QueueSession queueSession = (QueueSession) tx.getResource(queueManager);
                if (logger.isDebugEnabled())
                {
                    logger.debug("Retrieved VM queue session " + queueSession + " from current transaction " + tx);
                }
                return queueSession;
            }
        }

        //This get printed every second for every thread
//        if (logger.isDebugEnabled())
//        {
//            logger.debug("Retrieving new VM queue session from queue manager");
//        }

        QueueSession session = queueManager.getQueueSession();
        if (tx != null)
        {
            //This get printed every second for every thread
//            if (logger.isDebugEnabled())
//            {
View Full Code Here


    public VMTransaction(MuleContext muleContext) throws TransactionException
    {
        super(muleContext);
        QueueManager qm = muleContext.getQueueManager();
        QueueSession qs = qm.getQueueSession();
        bindResource(qm, qs);
    }
View Full Code Here

        if (endpointUri == null)
        {
            throw new DispatchException(CoreMessages.objectIsNull("Endpoint"), event,
                getEndpoint());
        }
        QueueSession session = connector.getQueueSession();
        Queue queue = session.getQueue(endpointUri.getAddress());
        if (!queue.offer(event, connector.getQueueTimeout()))
        {
            // queue is full
            throw new DispatchException(VMMessages.queueIsFull(queue.getName(), queue.size()),
                    event, getEndpoint());
View Full Code Here

    protected void doConnect() throws Exception
    {
        if (!endpoint.getExchangePattern().hasResponse())
        {
            // 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());
            }
View Full Code Here

    }
   
    protected List<MuleMessage> getFirstMessages() throws Exception
    {
        // The queue from which to pull events
        QueueSession qs = connector.getQueueSession();
        Queue queue = qs.getQueue(endpoint.getEndpointURI().getAddress());

        // The list of retrieved messages that will be returned
        List<MuleMessage> messages = new LinkedList<MuleMessage>();

        int batchSize = getBatchSize(queue.size());
View Full Code Here

    }
   
    protected MuleEvent getFirstMessage() throws Exception
    {
        // The queue from which to pull events
        QueueSession qs = connector.getQueueSession();
        Queue queue = qs.getQueue(endpoint.getEndpointURI().getAddress());
        // try to get the first event off the queue
        return (MuleEvent) queue.poll(connector.getQueueTimeout());
    }
View Full Code Here

     */
    protected MuleMessage doRequest(long timeout) throws Exception
    {
        try
        {
            QueueSession queueSession = connector.getQueueSession();
            Queue queue = queueSession.getQueue(endpoint.getEndpointURI().getAddress());

            if (queue == null)
            {
                if (logger.isDebugEnabled())
                {
View Full Code Here

     * events in the queue.
     */
    public void run()
    {
        DefaultMuleEvent event = null;
        QueueSession queueSession = muleContext.getQueueManager().getQueueSession();

        running.set(true);
        while (!lifecycleManager.getState().isStopped())
        {
            try
View Full Code Here

  public MessageExchange accept() throws MessagingException {
    if (this.closed) {
      throw new MessagingException("Channel is closed");
    }
    try {
      QueueSession qs = container.getQueueSession();
      Queue queue = qs.getQueue(componentName);
      MessageExchange me = (MessageExchange) queue.take();
      if (me != null) {
        handleReceive(me);
      }
      return me;
View Full Code Here

  public MessageExchange accept(long timeout) throws MessagingException {
    if (this.closed) {
      throw new MessagingException("Channel is closed");
    }
    try {
      QueueSession qs = container.getQueueSession();
      Queue queue = qs.getQueue(componentName);
      MessageExchange me = (MessageExchange) queue.poll(timeout);
      if (me != null) {
        handleReceive(me);
      }
      return me;
View Full Code Here

TOP

Related Classes of org.mule.util.queue.QueueSession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.