Package edu.emory.mathcs.backport.java.util.concurrent

Examples of edu.emory.mathcs.backport.java.util.concurrent.Executor


   * TaskExecutor interface, delegating to the ThreadPoolExecutor instance.
   * @see edu.emory.mathcs.backport.java.util.concurrent.Executor#execute(Runnable)
   * @see org.springframework.core.task.TaskExecutor#execute(Runnable)
   */
  public void execute(Runnable task) {
    Executor executor = getThreadPoolExecutor();
    try {
      executor.execute(task);
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here


   * TaskExecutor interface, delegating to the ThreadPoolExecutor instance.
   * @see edu.emory.mathcs.backport.java.util.concurrent.Executor#execute(Runnable)
   * @see org.springframework.core.task.TaskExecutor#execute(Runnable)
   */
  public void execute(Runnable task) {
    Executor executor = getThreadPoolExecutor();
    try {
      executor.execute(task);
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here

*/
public class ExecutorThreadModelFactoryBeanTest extends TestCase
{
    public void testSuccessfulCreationWithExecutor() throws Exception
    {
        Executor executor = new ThreadPoolExecutor( 1, 10, 3600, TimeUnit.SECONDS, new SynchronousQueue() );
        ExecutorThreadModelFactoryBean factory = new  ExecutorThreadModelFactoryBean();
        factory.setServiceName( "foo" );
        factory.setExecutor( executor );
        factory.afterPropertiesSet();
        ExecutorThreadModel threadModel = ( ExecutorThreadModel ) factory.getObject();
View Full Code Here

   * TaskExecutor interface, delegating to the ThreadPoolExecutor instance.
   * @see edu.emory.mathcs.backport.java.util.concurrent.Executor#execute(Runnable)
   * @see org.springframework.core.task.TaskExecutor#execute(Runnable)
   */
  public void execute(Runnable task) {
    Executor executor = getThreadPoolExecutor();
    try {
      executor.execute(task);
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here

* @author The Apache Directory Project (mina-dev@directory.apache.org)
* @version $Rev$, $Date$
*/
public class ExecutorThreadModelFactoryBeanTest extends TestCase {
    public void testSuccessfulCreationWithExecutor() throws Exception {
        Executor executor = new ThreadPoolExecutor(1, 10, 3600,
                TimeUnit.SECONDS, new SynchronousQueue());
        ExecutorThreadModelFactoryBean factory = new ExecutorThreadModelFactoryBean();
        factory.setServiceName("foo");
        factory.setExecutor(executor);
        factory.afterPropertiesSet();
View Full Code Here

   * TaskExecutor interface, delegating to the ThreadPoolExecutor instance.
   * @see edu.emory.mathcs.backport.java.util.concurrent.Executor#execute(Runnable)
   * @see org.springframework.core.task.TaskExecutor#execute(Runnable)
   */
  public void execute(Runnable task) {
    Executor executor = getThreadPoolExecutor();
    try {
      executor.execute(task);
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here

TOP

Related Classes of edu.emory.mathcs.backport.java.util.concurrent.Executor

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.