Package org.jboss.as.threads

Examples of org.jboss.as.threads.ManagedQueueExecutorService


  }

  protected boolean scheduleShortRunningWork(Runnable runnable) {

    ManagedQueueExecutorService managedQueueExecutorService = managedQueueInjector.getValue();
   
    try {
     
      managedQueueExecutorService.executeBlocking(runnable);
      return true;
     
    } catch (InterruptedException e) {
      // the the acquisition thread is interrupted, this probably means the app server is turning the lights off -> ignore         
    } catch (Exception e) {     
View Full Code Here


    return false;
  }

  protected boolean scheduleLongRunningWork(Runnable runnable) {
   
    final ManagedQueueExecutorService managedQueueExecutorService = managedQueueInjector.getValue();

    boolean rejected = false;
    try {
     
      // wait for 2 seconds for the job to be accepted by the pool.
      managedQueueExecutorService.executeBlocking(runnable, 2, TimeUnit.SECONDS);
     
    } catch (InterruptedException e) {
      // the acquisition thread is interrupted, this probably means the app server is turning the lights off -> ignore         
    } catch (ExecutionTimedOutException e) {
      rejected = true;
View Full Code Here

TOP

Related Classes of org.jboss.as.threads.ManagedQueueExecutorService

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.