Package org.mule.util.concurrent

Examples of org.mule.util.concurrent.Latch.release()


            {
                if (message.getData() != null)
                {
                    //This simulate what the browser would receive
                    data.set((message.getData()));
                    latch.release();
                }
            }
        });
        //The '/response' channel is set on the request message
        client.subscribe("/response");
View Full Code Here


                if (message.getData() != null)
                {
                    // This simulates what the browser would receive
                    data.set(message.toString());
                    latch.release();
                }
            }
        });
        bayeuxClient.subscribe("/test1");
View Full Code Here

            {
                if (message.getData() != null)
                {
                    // This simulate what the browser would receive
                    data.set(message.toString());
                    latch.release();
                }
            }
        });
        client.subscribe("/test1");
View Full Code Here

        when(mockRetryTemplate.execute(any(RetryCallback.class), any(WorkManager.class))).thenAnswer(new Answer<Object>()
        {
            @Override
            public Object answer(InvocationOnMock invocationOnMock) throws Throwable
            {
                acceptCalledLath.release();
                throw new Exception();
            }
        });
        when(mockHttpConnector.getMuleContext().getExceptionListener()).thenReturn(mockExceptionListener);
        Thread dispatcherThread = createDispatcherThread(httpRequestDispatcher);
View Full Code Here

        Mockito.doAnswer(new Answer<Object>()
        {
            @Override
            public Object answer(InvocationOnMock invocationOnMock) throws Throwable
            {
                acceptCalledLath.release();
                return null;
            }
        }).when(mockExecutor).execute(any(HttpRequestDispatcherWork.class));
        Thread dispatcherThread = createDispatcherThread(httpRequestDispatcher);
        dispatcherThread.start();
View Full Code Here

                {
                    try
                    {
                        QueueSession s = mgr.getQueueSession();
                        Queue q = s.getQueue("queue1");
                        putExecutionLatch.release();
                        q.put("String1");
                    }
                    catch (Exception e)
                    {
                        //unlikely to happen. But if it does lets show it in the test logs.
View Full Code Here

            {
                public void run()
                {
                    try
                    {
                        takeExecutionLatch.release();
                        QueueSession s = mgr.getQueueSession();
                        Queue q = s.getQueue("queue1");
                        assertEquals("Queue content", "String1", q.take());
                    }
                    catch (Exception e)
View Full Code Here

            }

            @Override
            public void run()
            {
                workExecutedLatch.release();
            }
        });
        if (!workExecutedLatch.await(1000, TimeUnit.MILLISECONDS))
        {
            fail("Work should be executed and it was not");
View Full Code Here

            if (capturedThreads.size() > 1)
            {
                Latch latch = event.getFlowVariable("latch");
                if (latch != null)
                {
                    latch.release();
                }
            }

            return event;
        }
View Full Code Here

        FunctionalTestComponent ftc = getFunctionalTestComponent("LastMessageStateRouting");
        ftc.setEventCallback(new EventCallback()
        {
            public void eventReceived(MuleEventContext context, Object component) throws Exception
            {
                messageProcessedLatch.release();
                throw new RuntimeException();
            }
        });
        LocalMuleClient client = muleContext.getClient();
        client.dispatch("jms://in1?connector=jmsConnector", MESSAGE_TO_SEND, null);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.