Package org.codehaus.spice.netserve.connection

Examples of org.codehaus.spice.netserve.connection.RequestHandler


{
    public void testNullThreadPoolPassedToCtor()
        throws Exception
    {
        final Mock mockHandler = new Mock( RequestHandler.class );
        final RequestHandler handler = (RequestHandler)mockHandler.proxy();
        try
        {
            new ThreadPerRequestHandler( handler, null );
        }
        catch( final NullPointerException npe )
View Full Code Here


    {
        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 );
        mockPool.expectAndReturn( "execute", C.args( C.isA( Runnable.class ) ), control );
        final ThreadPool threadPool = (ThreadPool)mockPool.proxy();
View Full Code Here

      final Mock mockHandler = new Mock( RequestHandler.class );
      final Socket socket = new Socket();
      final Long timeout = new Long( 23 );
      mockHandler.expect( "handleConnection", C.args( C.eq( socket ) ) );
      mockHandler.expect( "shutdown", C.args( C.eq( timeout ) ) );
      final RequestHandler handler = (RequestHandler) mockHandler.proxy();
      final DelegatingRequestHandler delegatingHandler =
         new DelegatingRequestHandler( handler );

      delegatingHandler.handleConnection( socket );
      delegatingHandler.shutdown( 23 );
View Full Code Here

        throws Exception
    {
        final Mock mockHandler = new Mock( RequestHandler.class );
        final Socket socket = new Socket();
        mockHandler.expect( "handleConnection", C.args( C.eq( socket ) ) );
        final RequestHandler handler = (RequestHandler)mockHandler.proxy();

        final Mock mockManager = new Mock( RequestManager.class );
        mockManager.expectAndReturn( "aquireHandler",
                                     C.args( C.isA( Socket.class ) ),
                                     handler );
View Full Code Here

     * @throws Exception if an erro roccurs
     */
    protected void doPerformRequest( final Socket socket )
        throws Exception
    {
        final RequestHandler handler = aquireHandler( socket );
        try
        {
            handler.handleConnection( socket );
        }
        finally
        {
            releaseHandler( handler );
        }
View Full Code Here

TOP

Related Classes of org.codehaus.spice.netserve.connection.RequestHandler

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.