Examples of Sample02AsyncListener


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
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.