incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mahrw...@apache.org
Subject svn commit: r931474 - in /incubator/aries/trunk: blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ jmx/jmx-core/src/main/java/org/apache/aries/jmx/ jmx/jmx-core/src/main/java/org/apache/aries/jmx/agent/ jmx/jmx-core/src/main/...
Date Wed, 07 Apr 2010 09:20:34 GMT
Author: mahrwald
Date: Wed Apr  7 09:20:32 2010
New Revision: 931474

URL: http://svn.apache.org/viewvc?rev=931474&view=rev
Log:
ARIES-271 Integrate patch

Added:
    incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintThreadFactory.java
    incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/JMXThreadFactory.java
Modified:
    incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintEventDispatcher.java
    incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
    incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/agent/JMXAgentImpl.java
    incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleState.java
    incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/framework/ServiceState.java

Modified: incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintEventDispatcher.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintEventDispatcher.java?rev=931474&r1=931473&r2=931474&view=diff
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintEventDispatcher.java
(original)
+++ incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintEventDispatcher.java
Wed Apr  7 09:20:32 2010
@@ -64,7 +64,7 @@ class BlueprintEventDispatcher implement
 
     private final Set<BlueprintListener> listeners = new CopyOnWriteArraySet<BlueprintListener>();
     private final Map<Bundle, BlueprintEvent> states = new ConcurrentHashMap<Bundle,
BlueprintEvent>();
-    private final ExecutorService executor = Executors.newSingleThreadExecutor();
+    private final ExecutorService executor = Executors.newSingleThreadExecutor(new BlueprintThreadFactory("Blueprint
Event Dispatcher"));
     private final ExecutorService sharedExecutor;
     private final EventAdminListener eventAdminListener;
     private final ServiceTracker containerListenerTracker;

Modified: incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=931474&r1=931473&r2=931474&view=diff
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
(original)
+++ incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
Wed Apr  7 09:20:32 2010
@@ -76,7 +76,7 @@ public class BlueprintExtender implement
 
         this.context = context;
         handlers = new NamespaceHandlerRegistryImpl(context);
-        executors = Executors.newScheduledThreadPool(3);
+        executors = Executors.newScheduledThreadPool(3, new BlueprintThreadFactory("Blueprint
Extender"));
         eventDispatcher = new BlueprintEventDispatcher(context, executors);
         containers = new HashMap<Bundle, BlueprintContainerImpl>();
 

Added: incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintThreadFactory.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintThreadFactory.java?rev=931474&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintThreadFactory.java
(added)
+++ incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintThreadFactory.java
Wed Apr  7 09:20:32 2010
@@ -0,0 +1,38 @@
+/*
+ * 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.aries.blueprint.container;
+
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class BlueprintThreadFactory implements ThreadFactory {
+    private final ThreadFactory factory = Executors.defaultThreadFactory();
+    private final AtomicInteger count = new AtomicInteger();
+    private final String name;
+        
+    public BlueprintThreadFactory(String name) {
+        this.name = name;
+    }
+
+    public Thread newThread(Runnable r) {
+        final Thread t = factory.newThread(r);
+        t.setName(name + ": " + count.incrementAndGet());
+        t.setDaemon(true);
+        return t;
+    }
+}

Added: incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/JMXThreadFactory.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/JMXThreadFactory.java?rev=931474&view=auto
==============================================================================
--- incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/JMXThreadFactory.java
(added)
+++ incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/JMXThreadFactory.java
Wed Apr  7 09:20:32 2010
@@ -0,0 +1,36 @@
+/*
+ * 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.aries.jmx;
+
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadFactory;
+
+public class JMXThreadFactory implements ThreadFactory {
+    private final ThreadFactory factory = Executors.defaultThreadFactory();
+    private final String name;
+    
+    public JMXThreadFactory(String name) {
+        this.name = name;
+    }
+
+    public Thread newThread(Runnable r) {
+        final Thread t = factory.newThread(r);
+        t.setName(name);
+        t.setDaemon(true);
+        return t;
+    }
+}

Modified: incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/agent/JMXAgentImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/agent/JMXAgentImpl.java?rev=931474&r1=931473&r2=931474&view=diff
==============================================================================
--- incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/agent/JMXAgentImpl.java
(original)
+++ incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/agent/JMXAgentImpl.java
Wed Apr  7 09:20:32 2010
@@ -30,6 +30,7 @@ import javax.management.NotCompliantMBea
 import javax.management.ObjectName;
 import javax.management.StandardMBean;
 
+import org.apache.aries.jmx.JMXThreadFactory;
 import org.apache.aries.jmx.Logger;
 import org.apache.aries.jmx.MBeanHandler;
 import org.apache.aries.jmx.MBeanServiceTracker;
@@ -77,7 +78,7 @@ public class JMXAgentImpl implements JMX
     public JMXAgentImpl(Logger logger) {
         this.logger = logger;
         this.mbeansHandlers = new HashSet<MBeanHandler>();
-        this.registrationExecutor = Executors.newSingleThreadExecutor();
+        this.registrationExecutor = Executors.newSingleThreadExecutor(new JMXThreadFactory("JMX
OSGi Agent"));
     }
 
     /**

Modified: incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleState.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleState.java?rev=931474&r1=931473&r2=931474&view=diff
==============================================================================
--- incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleState.java
(original)
+++ incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleState.java
Wed Apr  7 09:20:32 2010
@@ -50,6 +50,7 @@ import javax.management.ObjectName;
 import javax.management.openmbean.TabularData;
 import javax.management.openmbean.TabularDataSupport;
 
+import org.apache.aries.jmx.JMXThreadFactory;
 import org.apache.aries.jmx.Logger;
 import org.apache.aries.jmx.codec.BundleData;
 import org.apache.aries.jmx.codec.BundleEventData;
@@ -299,7 +300,7 @@ public class BundleState extends Notific
      */
     public void postRegister(Boolean registrationDone) {
         if (registrationDone && registrations.incrementAndGet() == 1) {
-            eventDispatcher = Executors.newSingleThreadExecutor();
+            eventDispatcher = Executors.newSingleThreadExecutor(new JMXThreadFactory("JMX
OSGi Bundle State Event Dispatcher"));
             bundleContext.addBundleListener(bundleListener);
         }
     }

Modified: incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/framework/ServiceState.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/framework/ServiceState.java?rev=931474&r1=931473&r2=931474&view=diff
==============================================================================
--- incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/framework/ServiceState.java
(original)
+++ incubator/aries/trunk/jmx/jmx-core/src/main/java/org/apache/aries/jmx/framework/ServiceState.java
Wed Apr  7 09:20:32 2010
@@ -37,6 +37,7 @@ import javax.management.ObjectName;
 import javax.management.openmbean.TabularData;
 import javax.management.openmbean.TabularDataSupport;
 
+import org.apache.aries.jmx.JMXThreadFactory;
 import org.apache.aries.jmx.Logger;
 import org.apache.aries.jmx.codec.PropertyData;
 import org.apache.aries.jmx.codec.ServiceData;
@@ -160,7 +161,7 @@ public class ServiceState extends Notifi
      */
     public void postRegister(Boolean registrationDone) {
         if (registrationDone && registrations.incrementAndGet() == 1) {
-            eventDispatcher = Executors.newSingleThreadExecutor();
+            eventDispatcher = Executors.newSingleThreadExecutor(new JMXThreadFactory("JMX
OSGi Service State Event Dispatcher"));
             bundleContext.addServiceListener(serviceListener);
         }
     }



Mime
View raw message