}
}
+ synchronized (executors) {
+ for ( int i=0; i<executors.size(); i++ ) {
+ executors.get(i).start();
+ }
+ }
+
// Start our defined Connectors second
synchronized (connectors) {
for (int i = 0; i < connectors.length; i++) {
}
}
- synchronized (executors) {
- for ( int i=0; i<executors.size(); i++ ) {
- executors.get(i).start();
- }
- }
-
// Notify our interested LifecycleListeners
lifecycle.fireLifecycleEvent(AFTER_START_EVENT, null);
}
}
+ synchronized (executors) {
+ for ( int i=0; i<executors.size(); i++ ) {
+ executors.get(i).stop();
+ }
+ }
+
if( oname==controller ) {
// we registered ourself on init().
// That should be the typical case - this object is just for
// backward compat, nobody should bother to load it explicitely
Registry.getRegistry(null, null).unregisterComponent(oname);
+ Executor[] executors = findExecutors();
+ for (int i = 0; i < executors.length; i++) {
+ try {
+ ObjectName executorObjectName =
+ new ObjectName(domain + ":type=Executor,name=" + executors[i].getName());
+ Registry.getRegistry(null, null).unregisterComponent(executorObjectName);
+ } catch (Exception e) {
+ // Ignore (invalid ON, which cannot happen)
+ }
+ }
}
this.controller=oname;
Registry.getRegistry(null, null)
.registerComponent(this, oname, null);
+
+ Executor[] executors = findExecutors();
+ for (int i = 0; i < executors.length; i++) {
+ ObjectName executorObjectName =
+ new ObjectName(domain + ":type=Executor,name=" + executors[i].getName());
+ Registry.getRegistry(null, null)
+ .registerComponent(executors[i], executorObjectName, null);
+ }
+
} catch (Exception e) {
log.error(sm.getString("standardService.register.failed",domain),e);
}
lifecycle.removeLifecycleListener(listener);\r
}\r
\r
+ // Statistics from the thread pool\r
+ public int getActiveCount() {\r
+ return (executor != null) ? executor.getActiveCount() : 0;\r
+ }\r
\r
- \r
+ public long getCompletedTaskCount() {\r
+ return (executor != null) ? executor.getCompletedTaskCount() : 0;\r
+ }\r
+\r
+ public int getCorePoolSize() {\r
+ return (executor != null) ? executor.getCorePoolSize() : 0;\r
+ }\r
+\r
+ public int getLargestPoolSize() {\r
+ return (executor != null) ? executor.getLargestPoolSize() : 0;\r
+ }\r
\r
+ public int getPoolSize() {\r
+ return (executor != null) ? executor.getPoolSize() : 0;\r
+ }\r
\r
// ---------------------------------------------- TaskQueue Inner Class\r
class TaskQueue extends LinkedBlockingQueue<Runnable> {\r