Examples of TPCThreadManager


Examples of org.apache.excalibur.event.command.TPCThreadManager

        {
            m_threadManager = (ThreadManager)m_rootContext.get( ThreadManager.ROLE );
        }
        catch( ContextException e )
        {
            final ThreadManager tm = new TPCThreadManager();

            assumeOwnership( tm );

            // Get the context Logger Manager
            final Logger tmLogger = m_loggerManager.getLoggerForCategory( "system.threadmgr" );
View Full Code Here

Examples of org.apache.excalibur.event.command.TPCThreadManager

     */
    public void testThreadContention() throws Exception
    {
        // enforces only 1 thread and no timeout which makes it
        // fail quickly
        final TPCThreadManager threadManager = new TPCThreadManager();

        threadManager.parameterize( createParameters( 1, 0 ) );
        threadManager.initialize();

        // an obviously syncronized component
        final StringBuffer result = new StringBuffer();
        final StringWriter exceptionBuffer = new StringWriter();
        final PrintWriter errorOut = new PrintWriter( exceptionBuffer );

        threadManager.register( new Pipeline( result, errorOut ) );

        // sleeps for 1 more scheduling timeout to surely go over limit
        Thread.sleep( SCHEDULING_TIMEOUT * ( MINIMAL_NUMBER_INVOCATIONS + 1 ) );

        int numberCalls = result.length();
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.