1 10 11 27 28 package org.mule.impl.work; 29 30 import org.mule.config.ThreadingProfile; 31 32 35 public class NullWorkExecutorPool implements WorkExecutorPool 36 { 37 38 private ThreadingProfile profile; 39 private String name; 40 41 public NullWorkExecutorPool(ThreadingProfile profile, String name) 42 { 43 this.profile = profile; 44 this.name = name; 45 } 46 47 public int getPoolSize() 48 { 49 return 0; 50 } 51 52 public int getMaximumPoolSize() 53 { 54 return profile.getMaxThreadsActive(); 55 } 56 57 public void setMaximumPoolSize(int maxSize) 58 { 59 profile.setMaxThreadsActive(maxSize); 60 } 61 62 public WorkExecutorPool start() 63 { 64 return new WorkExecutorPoolImpl(profile, name); 65 } 66 67 public WorkExecutorPool stop() 68 { 69 return this; 70 } 71 72 public void execute(Runnable command) 73 { 74 throw new IllegalStateException ("Stopped"); 75 } 76 } 77 | Popular Tags |