commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1612971 - in /commons/proper/exec/trunk/src: changes/changes.xml main/java/org/apache/commons/exec/DaemonExecutor.java
Date Wed, 23 Jul 2014 23:22:18 GMT
Author: ggregory
Date: Wed Jul 23 23:22:18 2014
New Revision: 1612971

URL: http://svn.apache.org/r1612971
Log:
[EXEC-69] DefaultExecutor async execute prevents shutdown hooks running.

Added:
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DaemonExecutor.java  
(with props)
Modified:
    commons/proper/exec/trunk/src/changes/changes.xml

Modified: commons/proper/exec/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/changes/changes.xml?rev=1612971&r1=1612970&r2=1612971&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/changes/changes.xml (original)
+++ commons/proper/exec/trunk/src/changes/changes.xml Wed Jul 23 23:22:18 2014
@@ -24,6 +24,9 @@
     </properties>
     <body>
         <release version="1.3" date="TBD" description="Maintenance and feature Release">
+            <action issue="EXEC-69" dev="ggregory" type="add" due-to="Richard Atkins,
Michael Vorburger">
+                DefaultExecutor async execute prevents shutdown hooks running.
+            </action>
             <action issue="EXEC-81" dev="ggregory" type="fix" date="2014-02-04" due-to="Stephen
Compall">
                 Remove remaining raw types, unchecked conversions
             </action>

Added: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DaemonExecutor.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DaemonExecutor.java?rev=1612971&view=auto
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DaemonExecutor.java (added)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DaemonExecutor.java Wed
Jul 23 23:22:18 2014
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.exec;
+
+/**
+ * Runs daemon processes asynchronously. Callers are expected to register a {@link ProcessDestroyer}
before executing
+ * any processes.
+ * 
+ * @since 1.3
+ */
+public class DaemonExecutor extends DefaultExecutor {
+
+    /**
+     * Factory method to create a thread waiting for the result of an asynchronous execution.
+     *
+     * @param runnable
+     *            the runnable passed to the thread
+     * @param name
+     *            the name of the thread
+     * @return the thread
+     */
+    @Override
+    protected Thread createThread(Runnable runnable, String name) {
+        Thread t = super.createThread(runnable, name);
+        t.setDaemon(true);
+        return t;
+    }
+}

Propchange: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DaemonExecutor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DaemonExecutor.java
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message