Package org.apache.tapestry5.ioc.services

Examples of org.apache.tapestry5.ioc.services.ParallelExecutor


    @Primary
    private StackTraceElementAnalyzer frameAnalyzer;

    void setupRender()
    {
        ExceptionAnalysis analysis = analyzer.analyze(exception);

        stack = analysis.getExceptionInfos();

        toggleId = renderSupport.allocateClientId("toggleStack");
    }
View Full Code Here


    {
        int count = 100;

        List<StringHolder> thunks = CollectionFactory.newList();

        ParallelExecutor parallelExecutor = getService(ParallelExecutor.class);

        for (int i = 0; i < count; i++)
        {
            final String value = String.format("Value[%d]", i);

            Invokable<StringHolder> inv = new Invokable<StringHolder>()
            {
                public StringHolder invoke()
                {
                    StringHolder holder = new StringHolderImpl();
                    holder.setValue(value);
                   
                    try
                    {
                        Thread.sleep(100l);
                    }
                    catch (InterruptedException ie)
                    {
                        // Swallow
                    }

                    return holder;
                }
            };

            thunks.add(parallelExecutor.invoke(StringHolder.class, inv));
        }

        for (int j = 0; j < 2; j++)
        {
            for (int i = 0; i < count; i++)
View Full Code Here

    }

    @Test
    public void exception_thrown_by_invocation()
    {
        ParallelExecutor parallelExecutor = getService(ParallelExecutor.class);

        Invokable<StringHolder> inv = new Invokable<StringHolder>()
        {
            public StringHolder invoke()
            {
                throw new RuntimeException("Future failure!");
            }
        };

        StringHolder holder = parallelExecutor.invoke(StringHolder.class, inv);

        assertEquals(holder.toString(), "FutureThunk[org.apache.tapestry5.ioc.StringHolder]");

        try
        {
View Full Code Here

    {
        int count = 100;

        List<StringHolder> thunks = CollectionFactory.newList();

        ParallelExecutor parallelExecutor = getService(ParallelExecutor.class);

        for (int i = 0; i < count; i++)
        {
            final String value = String.format("Value[%d]", i);

            Invokable inv = new Invokable()
            {
                public Object invoke()
                {
                    StringHolder holder = new StringHolderImpl();
                    holder.setValue(value);

                    return holder;
                }
            };

            thunks.add(parallelExecutor.invoke(StringHolder.class, inv));
        }

        for (int j = 0; j < 2; j++)
        {
            for (int i = 0; i < count; i++)
View Full Code Here

    }

    @Test
    public void exception_thrown_by_invocation()
    {
        ParallelExecutor parallelExecutor = getService(ParallelExecutor.class);

        Invokable inv = new Invokable()
        {
            public Object invoke()
            {
                throw new RuntimeException("Future failure!");
            }
        };

        StringHolder holder = parallelExecutor.invoke(StringHolder.class, inv);

        assertEquals(holder.toString(), "FutureThunk[org.apache.tapestry5.ioc.StringHolder]");

        try
        {
View Full Code Here

    {
        int count = 100;

        List<StringHolder> thunks = CollectionFactory.newList();

        ParallelExecutor parallelExecutor = getService(ParallelExecutor.class);

        for (int i = 0; i < count; i++)
        {
            final String value = String.format("Value[%d]", i);

            Invokable<StringHolder> inv = new Invokable<StringHolder>()
            {
                public StringHolder invoke()
                {
                    StringHolder holder = new StringHolderImpl();
                    holder.setValue(value);

                    return holder;
                }
            };

            thunks.add(parallelExecutor.invoke(StringHolder.class, inv));
        }

        for (int j = 0; j < 2; j++)
        {
            for (int i = 0; i < count; i++)
View Full Code Here

    }

    @Test
    public void exception_thrown_by_invocation()
    {
        ParallelExecutor parallelExecutor = getService(ParallelExecutor.class);

        Invokable<StringHolder> inv = new Invokable<StringHolder>()
        {
            public StringHolder invoke()
            {
                throw new RuntimeException("Future failure!");
            }
        };

        StringHolder holder = parallelExecutor.invoke(StringHolder.class, inv);

        assertEquals(holder.toString(), "FutureThunk[org.apache.tapestry5.ioc.StringHolder]");

        try
        {
View Full Code Here

    @Test
    public void unknown_validator_type()
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        Map<String, Validator> map = newMap();
View Full Code Here

    @Test
    public void validator_with_no_constraint() throws Exception
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
View Full Code Here

    @Test
    public void component_messages_overrides_validator_messages() throws Exception
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.ioc.services.ParallelExecutor

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.