1 21 22 package org.jacorb.notification.engine; 23 24 import org.jacorb.notification.interfaces.CallbackingDisposable; 25 import org.jacorb.notification.interfaces.Disposable; 26 27 public class DefaultPushTaskExecutorFactory implements PushTaskExecutorFactory 28 { 29 private final int numberOfWorkersPerExecutor_; 30 31 public DefaultPushTaskExecutorFactory(int numberOfWorkersPerExecutor) 32 { 33 numberOfWorkersPerExecutor_ = numberOfWorkersPerExecutor; 34 } 35 36 public PushTaskExecutor newExecutor(CallbackingDisposable callbackingDisposable) 37 { 38 final PushTaskExecutor executor = new DefaultPushTaskExecutor(numberOfWorkersPerExecutor_); 39 40 callbackingDisposable.addDisposeHook(new Disposable() 41 { 42 public void dispose() 43 { 44 executor.dispose(); 45 } 46 }); 47 48 return executor; 49 } 50 } 51 | Popular Tags |