Package com.righettod.jee6s3.listener

Examples of com.righettod.jee6s3.listener.Sample02AsyncListener


    System.out.printf("Sample02AsyncServlet::The current thread is '%s'\n", Thread.currentThread().getName());
    // Pass in async mode
    AsyncContext aCtx = req.startAsync();
    aCtx.setTimeout(25000);// Timeout setted to 25 seconds
    // Add a async events listener
    aCtx.addListener(new Sample02AsyncListener());
    // Launch async processing using a dedicated thread
    ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1);
    executor.execute(new RequestProcessor(aCtx));
    // Never forget to close the executor in order to release all thread
    // objects link in memory...
View Full Code Here


    aCtx.setTimeout(25000);// Timeout setted to 25 seconds
    // Add a async events listener
    aCtx.addListener(new Sample02AsyncListener());
    // Launch async processing using a dedicated thread
    ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1);
    executor.execute(new RequestProcessor(aCtx));
    // Never forget to close the executor in order to release all thread
    // objects link in memory...
    executor.shutdown();
    System.out.println("Sample02AsyncServlet::EndOfDoGet");
  }
View Full Code Here

TOP

Related Classes of com.righettod.jee6s3.listener.Sample02AsyncListener

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.