servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r707552 - in /servicemix/utils/trunk/src/main/java/org/apache/servicemix/executors: ExecutorFactory.java impl/ExecutorFactoryImpl.java
Date Fri, 24 Oct 2008 05:54:05 GMT
Author: ffang
Date: Thu Oct 23 22:54:05 2008
New Revision: 707552

URL: http://svn.apache.org/viewvc?rev=707552&view=rev
Log:
[SM-1660] add createDaemonExecutor api for ExecutorFactory

Modified:
    servicemix/utils/trunk/src/main/java/org/apache/servicemix/executors/ExecutorFactory.java
    servicemix/utils/trunk/src/main/java/org/apache/servicemix/executors/impl/ExecutorFactoryImpl.java

Modified: servicemix/utils/trunk/src/main/java/org/apache/servicemix/executors/ExecutorFactory.java
URL: http://svn.apache.org/viewvc/servicemix/utils/trunk/src/main/java/org/apache/servicemix/executors/ExecutorFactory.java?rev=707552&r1=707551&r2=707552&view=diff
==============================================================================
--- servicemix/utils/trunk/src/main/java/org/apache/servicemix/executors/ExecutorFactory.java
(original)
+++ servicemix/utils/trunk/src/main/java/org/apache/servicemix/executors/ExecutorFactory.java
Thu Oct 23 22:54:05 2008
@@ -32,5 +32,16 @@
      * @return a configured Executor
      */
     Executor createExecutor(String id);
+
+    /**
+     * Create a new daemon executor for the given Id.
+     * The excutor should use daemon thread underlying
+     * The id may be used to provide per executor
+     * configuration.
+     *
+     * @param id the id of the executor to create
+     * @return a configured Executor
+     */
+    Executor createDaemonExecutor(String id);
     
 }

Modified: servicemix/utils/trunk/src/main/java/org/apache/servicemix/executors/impl/ExecutorFactoryImpl.java
URL: http://svn.apache.org/viewvc/servicemix/utils/trunk/src/main/java/org/apache/servicemix/executors/impl/ExecutorFactoryImpl.java?rev=707552&r1=707551&r2=707552&view=diff
==============================================================================
--- servicemix/utils/trunk/src/main/java/org/apache/servicemix/executors/impl/ExecutorFactoryImpl.java
(original)
+++ servicemix/utils/trunk/src/main/java/org/apache/servicemix/executors/impl/ExecutorFactoryImpl.java
Thu Oct 23 22:54:05 2008
@@ -58,6 +58,13 @@
         return new ExecutorImpl(createService(id, config), config.getShutdownDelay());
     }
 
+    public Executor createDaemonExecutor(String id) {
+
+        ExecutorConfig config = getConfig(id);
+        config.setThreadDaemon(true);
+        return new ExecutorImpl(createService(id, config), config.getShutdownDelay());
+    }
+
     protected ExecutorConfig getConfig(String id) {
         ExecutorConfig config = null;
         if (configs != null) {



Mime
View raw message