Package org.codehaus.spice.threadpool

Examples of org.codehaus.spice.threadpool.ThreadControl


    public void testThreadPoolInvoked()
        throws Exception
    {
        final Mock mockControl = new Mock( ThreadControl.class );
        final ThreadControl control = (ThreadControl)mockControl.proxy();

        final Mock mockHandler = new Mock( RequestHandler.class );
        final RequestHandler handler = (RequestHandler)mockHandler.proxy();

        final Mock mockPool = new Mock( ThreadPool.class );
View Full Code Here


     * @param socket the socket to handle
     */
    public void handleConnection( final Socket socket )
    {
        final Runnable runnable = createRunnable( socket );
        final ThreadControl control = m_threadPool.execute( runnable );
        m_controlMap.put( socket, control );
    }
View Full Code Here

            controls = (ThreadControl[])collection.
                toArray( new ThreadControl[ collection.size() ] );
        }
        for( int i = 0; i < controls.length; i++ )
        {
            final ThreadControl control = controls[ i ];
            if( !control.isFinished() )
            {
                control.interrupt();
            }
        }
        super.shutdown( timeout );
        for( int i = 0; i < controls.length; i++ )
        {
            final ThreadControl control = controls[ i ];
            if( !control.isFinished() )
            {
                try
                {
                    control.join( timeout );
                }
                catch( final InterruptedException ie )
                {
                    //Ignore
                }
View Full Code Here

TOP

Related Classes of org.codehaus.spice.threadpool.ThreadControl

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.