Package org.mule.util.queue

Examples of org.mule.util.queue.QueueSession


        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);
            }
        }
View Full Code Here


        public void run()
        {
            Random rnd = new Random();
            try {
                QueueSession s = mgr.getQueueSession();
                Queue q = s.getQueue(queue);

                for (int i = 0; i < OUTERLOOP; i++) {
                    for (int j = 0; j < INNERLOOP; j++) {
                        byte[] o = new byte[(rnd.nextInt(16) + 1) * OBJSIZE];
                        q.put(o);
View Full Code Here

     * While the service isn't stopped this runs a continuous loop checking for new 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

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

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

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

    {
        super(muleContext);
        if (initialize)
        {
            QueueManager qm = muleContext.getQueueManager();
            QueueSession qs = qm.getQueueSession();
            bindResource(qm, qs);
        }
    }
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.getTransactionalResource(endpoint);
        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.getTransactionalResource(endpoint);
        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

    @Override
    protected boolean hasNoMessages()
    {
        try
        {
            QueueSession qs = connector.getQueueSession();
            Queue queue = qs.getQueue(endpoint.getEndpointURI().getAddress());
            return queue.size() == 0;
        }
        catch (Exception e)
        {
            return false;
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.