geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r881866 - in /geronimo/server/trunk/plugins/concurrent: concurrent/ concurrent/src/main/history/ geronimo-concurrent-builder/src/main/java/org/apache/geronimo/concurrent/builder/ geronimo-concurrent-management/ geronimo-concurrent/ geronimo...
Date Wed, 18 Nov 2009 18:31:10 GMT
Author: rickmcguire
Date: Wed Nov 18 18:31:09 2009
New Revision: 881866

URL: http://svn.apache.org/viewvc?rev=881866&view=rev
Log:
some concurrency cleanup

Modified:
    geronimo/server/trunk/plugins/concurrent/concurrent/pom.xml
    geronimo/server/trunk/plugins/concurrent/concurrent/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/concurrent/geronimo-concurrent-builder/src/main/java/org/apache/geronimo/concurrent/builder/ResourceRefBuilder.java
    geronimo/server/trunk/plugins/concurrent/geronimo-concurrent-management/pom.xml
    geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/pom.xml
    geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/ContextHandlerUtils.java
    geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/GBeanBuilder.java
    geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/context/ContextServiceGBean.java
    geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ComponentManagedExecutorServiceGBean.java
    geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ComponentManagedScheduledExecutorServiceGBean.java
    geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedExecutorServiceGBean.java
    geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedExecutorServiceWrapperGBean.java
    geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedScheduledExecutorServiceGBean.java
    geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedScheduledExecutorServiceWrapperGBean.java
    geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/thread/ManagedThreadFactoryGBean.java
    geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/thread/ManagedThreadFactoryWrapperGBean.java

Modified: geronimo/server/trunk/plugins/concurrent/concurrent/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/concurrent/concurrent/pom.xml?rev=881866&r1=881865&r2=881866&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/concurrent/concurrent/pom.xml (original)
+++ geronimo/server/trunk/plugins/concurrent/concurrent/pom.xml Wed Nov 18 18:31:09 2009
@@ -40,6 +40,11 @@
     <dependencies>
 
         <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-concurrent_1.0_spec</artifactId>
+        </dependency>
+
+        <dependency>
             <groupId>org.apache.geronimo.configs</groupId>
             <artifactId>transaction-1_6</artifactId>
             <type>car</type>

Modified: geronimo/server/trunk/plugins/concurrent/concurrent/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/concurrent/concurrent/src/main/history/dependencies.xml?rev=881866&r1=881865&r2=881866&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/concurrent/concurrent/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/concurrent/concurrent/src/main/history/dependencies.xml Wed Nov 18 18:31:09 2009
@@ -6,24 +6,34 @@
         <version>3.0-SNAPSHOT</version>
         <type>car</type>
     </module-id>
-    <dependency start="true">
+    <dependency>
         <groupId>org.apache.geronimo.configs</groupId>
         <artifactId>transaction-1_6</artifactId>
         <type>car</type>
     </dependency>
-    <dependency start="true">
+    <dependency>
         <groupId>org.apache.geronimo.modules</groupId>
         <artifactId>geronimo-concurrent</artifactId>
         <type>jar</type>
     </dependency>
-    <dependency start="true">
+    <dependency>
         <groupId>org.apache.geronimo.modules</groupId>
         <artifactId>geronimo-concurrent-core</artifactId>
         <type>jar</type>
     </dependency>
-    <dependency start="true">
+    <dependency>
         <groupId>org.apache.geronimo.modules</groupId>
         <artifactId>geronimo-concurrent-management</artifactId>
         <type>jar</type>
     </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-concurrent_1.0_spec</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>jcl-over-slf4j</artifactId>
+        <type>jar</type>
+    </dependency>
 </plugin-artifact>

Modified: geronimo/server/trunk/plugins/concurrent/geronimo-concurrent-builder/src/main/java/org/apache/geronimo/concurrent/builder/ResourceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/concurrent/geronimo-concurrent-builder/src/main/java/org/apache/geronimo/concurrent/builder/ResourceRefBuilder.java?rev=881866&r1=881865&r2=881866&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/concurrent/geronimo-concurrent-builder/src/main/java/org/apache/geronimo/concurrent/builder/ResourceRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/concurrent/geronimo-concurrent-builder/src/main/java/org/apache/geronimo/concurrent/builder/ResourceRefBuilder.java Wed Nov 18 18:31:09 2009
@@ -61,19 +61,20 @@
 import org.apache.geronimo.xbeans.javaee.XsdStringType;
 import org.apache.xmlbeans.QNameSet;
 import org.apache.xmlbeans.XmlObject;
+import org.osgi.framework.Bundle;
 
 /**
  * @version $Rev: 587764 $ $Date: 2008/03/06 22:05:03 $
  */
 public class ResourceRefBuilder extends AbstractNamingBuilder {
     private final static Log log = LogFactory.getLog(ResourceRefBuilder.class);
-      
+
     private static final QName GER_MANAGED_OBJECT_REF_QNAME = GerResourceEnvRefDocument.type.getDocumentElementName();
     private static final QNameSet GER_MANAGED_OBJECT_REF_QNAME_SET = QNameSet.singleton(GER_MANAGED_OBJECT_REF_QNAME);
 
     private final QNameSet resourceRefQNameSet;
     private final Kernel kernel;
-    
+
     public ResourceRefBuilder(Kernel kernel, Environment defaultEnvironment, String[] eeNamespaces) {
         super(defaultEnvironment);
         this.kernel = kernel;
@@ -86,7 +87,7 @@
 
     static Key<Map<String, GerResourceEnvRefType>> DEFAULT_MAPPINGS_KEY = new Key<Map<String, GerResourceEnvRefType>>() {
         public Map<String, GerResourceEnvRefType> get(Map context) {
-            Map<String, GerResourceEnvRefType> result = 
+            Map<String, GerResourceEnvRefType> result =
                 (Map<String, GerResourceEnvRefType>) context.get(this);
             if (result == null) {
                 result = new HashMap<String, GerResourceEnvRefType>();
@@ -95,11 +96,11 @@
             return result;
         }
     };
-    
+
     public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
         XmlObject[] gerResourceEnvRefsUntyped = plan == null ? NO_REFS : plan.selectChildren(GER_MANAGED_OBJECT_REF_QNAME_SET);
         Map<String, GerResourceEnvRefType> refMap = mapResourceEnvRefs(gerResourceEnvRefsUntyped);
-        
+
         // Discover and process any @Resource annotations (if !metadata-complete)
         if (module.getClassFinder() != null) {
             // Process all the annotations for this naming builder type
@@ -109,31 +110,31 @@
             } catch (Exception e) {
                 log.warn("Unable to process @Resource annotations for module " + module.getName(), e);
             }
-        }        
-                
+        }
+
         Map<String, GerResourceEnvRefType> defaultMappings = DEFAULT_MAPPINGS_KEY.get(module.getSharedContext());
         refMap.putAll(defaultMappings);
-        
+
         List<ResourceEnvRefType> resourceEnvRefsUntyped = convert(specDD.selectChildren(resourceRefQNameSet), JEE_CONVERTER, ResourceEnvRefType.class, ResourceEnvRefType.type);
-        ClassLoader cl = module.getEarContext().getClassLoader();
+        Bundle bundle = module.getEarContext().getBundle();
         for (ResourceEnvRefType resourceEnvRef : resourceEnvRefsUntyped) {
             String name = getStringValue(resourceEnvRef.getResourceEnvRefName());
             String type = getStringValue(resourceEnvRef.getResourceEnvRefType());
-            
+
             addInjections(name, resourceEnvRef.getInjectionTargetArray(), componentContext);
-            
+
             Class iface;
             try {
-                iface = cl.loadClass(type);
+                iface = bundle.loadClass(type);
             } catch (ClassNotFoundException e) {
                 throw new DeploymentException("could not load class " + type, e);
             }
-            
+
             GerResourceEnvRefType gerResourceEnvRef = refMap.remove(name);
-            
+
             String j2eeType = null;
             if (iface == ContextService.class) {
-                
+
             } else if (iface == ManagedThreadFactory.class) {
                 j2eeType = ManagedConstants.MANAGED_THREAD_FACTORY;
             } else if (iface == ManagedExecutorService.class) {
@@ -144,7 +145,7 @@
                 log.debug("Ignoring non-managed resource reference type: " + iface);
                 continue;
             }
-            
+
             try {
                 // TODO: should we also pass interfaces to discover the right gbeans?
                 AbstractNameQuery containerId = getAdminObjectContainerId(name, j2eeType, gerResourceEnvRef);
@@ -158,7 +159,7 @@
                                 + (e.isMultiple() ? "found multiple matching resources"
                                         : "no matching resources found") + ")", e);
             }
-        }              
+        }
     }
 
     private ResourceReferenceFactory buildManagedObjectReference(Module module, AbstractNameQuery containerId, Class iface) throws DeploymentException {
@@ -205,51 +206,51 @@
     public int getPriority() {
         return NORMAL_PRIORITY - 5;
     }
-    
+
     public QNameSet getSpecQNameSet() {
         return QNameSet.EMPTY;
     }
 
     public QNameSet getPlanQNameSet() {
-        return QNameSet.EMPTY;       
+        return QNameSet.EMPTY;
     }
 
     private static class ManagedResourceRefProcessor extends ResourceAnnotationHelper.ResourceProcessor {
 
         private Map<String, GerResourceEnvRefType> refMap;
         private Map sharedContext;
-        
+
         public ManagedResourceRefProcessor(Map<String, GerResourceEnvRefType> refMap,
-                                           Map sharedContext) {    
+                                           Map sharedContext) {
             this.refMap = refMap;
-            this.sharedContext = sharedContext;        
+            this.sharedContext = sharedContext;
         }
-        
+
         private static String getDefaultServiceMapping(String resourceType) {
             if (resourceType.equals(ContextService.class.getName())) {
                 return "DefaultContextService";
             } else if (resourceType.equals(ManagedThreadFactory.class.getName())) {
                 return "DefaultManagedThreadFactory";
             } else if (resourceType.equals(ManagedExecutorService.class.getName())) {
-                return "DefaultManagedExecutorService";                
+                return "DefaultManagedExecutorService";
             } else if (resourceType.equals(ManagedScheduledExecutorService.class.getName())) {
                 return "DefaultManagedScheduledExecutorService";
             } else {
                 throw new IllegalArgumentException("Invalid resource type: " + resourceType);
-            }            
+            }
         }
-        
+
         public boolean processResource(AnnotatedApp annotatedApp, Resource annotation, Class cls, Method method, Field field) throws DeploymentException {
             String resourceName = getResourceName(annotation, method, field);
             String resourceType = getResourceType(annotation, method, field);
-                        
+
             if (resourceType.equals(ContextService.class.getName()) ||
                 resourceType.equals(ManagedThreadFactory.class.getName()) ||
                 resourceType.equals(ManagedExecutorService.class.getName()) ||
                 resourceType.equals(ManagedScheduledExecutorService.class.getName())) {
-                
+
                 ResourceEnvRefType resourceEnvRef = null;
-                
+
                 ResourceEnvRefType[] ResourceEnvRefs = annotatedApp.getResourceEnvRefArray();
                 for (ResourceEnvRefType resourceEnvRefType : ResourceEnvRefs) {
                     if (resourceEnvRefType.getResourceEnvRefName().getStringValue().trim().equals(resourceName)) {
@@ -257,40 +258,40 @@
                         break;
                     }
                 }
-                
+
                 if (resourceEnvRef == null) {
                     resourceEnvRef = annotatedApp.addNewResourceEnvRef();
-                    
+
                     // resource-env-ref-name
                     JndiNameType resourceEnvRefName = resourceEnvRef.addNewResourceEnvRefName();
                     resourceEnvRefName.setStringValue(resourceName);
                     resourceEnvRef.setResourceEnvRefName(resourceEnvRefName);
                 }
-                
+
                 // resource-env-ref-type
                 if (!resourceEnvRef.isSetResourceEnvRefType() && !resourceType.equals("")) {
                     FullyQualifiedClassType qualifiedClass = resourceEnvRef.addNewResourceEnvRefType();
                     qualifiedClass.setStringValue(resourceType);
                     resourceEnvRef.setResourceEnvRefType(qualifiedClass);
                 }
-                
+
                 // description
-                if ((resourceEnvRef.getDescriptionArray() == null || 
+                if ((resourceEnvRef.getDescriptionArray() == null ||
                      resourceEnvRef.getDescriptionArray().length == 0) &&
                      annotation.description().trim().length() > 0) {
                     DescriptionType description = resourceEnvRef.addNewDescription();
                     String descriptionAnnotation = annotation.description();
                     description.setStringValue(descriptionAnnotation);
-                    
+
                 }
-                
+
                 // mapped-name
                 if (!resourceEnvRef.isSetMappedName() && annotation.mappedName().trim().length() > 0) {
                     XsdStringType mappedName = resourceEnvRef.addNewMappedName();
                     mappedName.setStringValue(annotation.mappedName().trim());
                     resourceEnvRef.setMappedName(mappedName);
                 }
-                    
+
                 // injection target
                 if (method != null || field != null) {
                     InjectionTargetType[] targets = resourceEnvRef.getInjectionTargetArray();
@@ -298,24 +299,24 @@
                         configureInjectionTarget(resourceEnvRef.addNewInjectionTarget(), method, field);
                     }
                 }
-                    
+
                 // automatically map to default services
                 if (annotation.name().trim().length() == 0 && !refMap.containsKey(resourceName)) {
                     GerResourceEnvRefType gerResourceEnvRefType = GerResourceEnvRefType.Factory.newInstance();
                     gerResourceEnvRefType.setRefName(resourceName);
- 
+
                     GerPatternType patternType = gerResourceEnvRefType.addNewPattern();
-                    
+
                     patternType.setName(getDefaultServiceMapping(resourceType));
-                    
+
                     DEFAULT_MAPPINGS_KEY.get(sharedContext).put(resourceName, gerResourceEnvRefType);
                 }
-            }                     
-            
+            }
+
             return true;
         }
     }
-    
+
     public static final GBeanInfo GBEAN_INFO;
 
     static {
@@ -324,8 +325,8 @@
         infoBuilder.addAttribute("eeNamespaces", String[].class, true, true);
         infoBuilder.addAttribute("defaultEnvironment", Environment.class, true, true);
 
-        infoBuilder.setConstructor(new String[]{ "kernel", 
-                                                 "defaultEnvironment", 
+        infoBuilder.setConstructor(new String[]{ "kernel",
+                                                 "defaultEnvironment",
                                                  "eeNamespaces" });
 
         GBEAN_INFO = infoBuilder.getBeanInfo();

Modified: geronimo/server/trunk/plugins/concurrent/geronimo-concurrent-management/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/concurrent/geronimo-concurrent-management/pom.xml?rev=881866&r1=881865&r2=881866&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/concurrent/geronimo-concurrent-management/pom.xml (original)
+++ geronimo/server/trunk/plugins/concurrent/geronimo-concurrent-management/pom.xml Wed Nov 18 18:31:09 2009
@@ -7,9 +7,9 @@
     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
@@ -36,11 +36,15 @@
     <name>Geronimo Plugins, Concurrency Utilities :: Management API</name>
 
    <dependencies>
+       <dependency>
+           <groupId>org.apache.geronimo.specs</groupId>
+           <artifactId>geronimo-concurrent_1.0_spec</artifactId>
+       </dependency>
         <dependency>
             <groupId>org.apache.geronimo.framework</groupId>
             <artifactId>geronimo-management</artifactId>
             <version>${version}</version>
         </dependency>
    </dependencies>
-   
+
 </project>

Modified: geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/pom.xml?rev=881866&r1=881865&r2=881866&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/pom.xml (original)
+++ geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/pom.xml Wed Nov 18 18:31:09 2009
@@ -7,9 +7,9 @@
     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
@@ -36,6 +36,10 @@
     <name>Geronimo Plugins, Concurrency Utilities :: Geronimo Core</name>
 
    <dependencies>
+       <dependency>
+           <groupId>org.apache.geronimo.specs</groupId>
+           <artifactId>geronimo-concurrent_1.0_spec</artifactId>
+       </dependency>
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-concurrent-core</artifactId>
@@ -71,7 +75,7 @@
             <artifactId>geronimo-transaction</artifactId>
         </dependency>
    </dependencies>
-   
+
     <build>
         <sourceDirectory>${basedir}/target/sources</sourceDirectory>
 
@@ -131,9 +135,22 @@
                             </execution>
                         </executions>
                     </plugin>
+                    <plugin>
+                        <groupId>org.apache.felix</groupId>
+                        <artifactId>maven-bundle-plugin</artifactId>
+                        <configuration>
+                            <instructions>
+                                <Export-Package>
+                                    org.apache.geronimo.concurrent*,
+                                    org.apache.geronimo.concurrent.impl*
+                                </Export-Package>
+                                <Require-Bundle>org.apache.geronimo.specs.geronimo-concurrent_1.0_spec</Require-Bundle>
+                            </instructions>
+                        </configuration>
+                    </plugin>
                 </plugins>
             </build>
         </profile>
     </profiles>
-   
+
 </project>

Modified: geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/ContextHandlerUtils.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/ContextHandlerUtils.java?rev=881866&r1=881865&r2=881866&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/ContextHandlerUtils.java (original)
+++ geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/ContextHandlerUtils.java Wed Nov 18 18:31:09 2009
@@ -22,18 +22,19 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.concurrent.ManagedContextHandler;
+import org.osgi.framework.Bundle;
 
 public class ContextHandlerUtils {
-        
+
     private final static Log LOG = LogFactory.getLog(ContextHandlerUtils.class);
-    
-    public static List<ManagedContextHandler> loadHandlers(ClassLoader classLoader,
+
+    public static List<ManagedContextHandler> loadHandlers(Bundle bundle,
                                                            String[] handlerClasses) {
         List<ManagedContextHandler> handlers = new ArrayList<ManagedContextHandler>();
         if (handlerClasses != null) {
             for (String handlerClass : handlerClasses) {
                 try {
-                    handlers.add(loadHandler(classLoader, handlerClass.trim()));
+                    handlers.add(loadHandler(bundle, handlerClass.trim()));
                 } catch (Exception e) {
                     LOG.warn("Failed to load context handler class " + handlerClass, e);
                 }
@@ -41,15 +42,15 @@
         }
         return handlers;
     }
-    
-    public static ManagedContextHandler loadHandler(ClassLoader classLoader, 
+
+    public static ManagedContextHandler loadHandler(Bundle bundle,
                                                     String className)
         throws Exception {
-        Class clazz = classLoader.loadClass(className);
+        Class clazz = bundle.loadClass(className);
         if (!ManagedContextHandler.class.isAssignableFrom(clazz)) {
             throw new Exception("Class " + className + " is not a ManagedContextHandler class");
         }
         return (ManagedContextHandler) clazz.newInstance();
     }
-               
+
 }

Modified: geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/GBeanBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/GBeanBuilder.java?rev=881866&r1=881865&r2=881866&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/GBeanBuilder.java (original)
+++ geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/GBeanBuilder.java Wed Nov 18 18:31:09 2009
@@ -30,22 +30,24 @@
 import org.apache.geronimo.kernel.ObjectNameUtil;
 import org.apache.geronimo.kernel.management.State;
 
+import org.osgi.framework.Bundle;
+
 public class GBeanBuilder {
-    
+
     protected Kernel kernel;
-    protected ClassLoader classLoader;
+    protected Bundle bundle;
 
-    public GBeanBuilder(Kernel kernel, ClassLoader classLoader) {
+    public GBeanBuilder(Kernel kernel, Bundle bundle) {
         this.kernel = kernel;
-        this.classLoader = classLoader;        
+        this.bundle = bundle;
     }
-    
+
     /* in memory */
     protected void addGBeanKernel(AbstractName gbeanName, GBeanData threadData) throws KernelException {
-        kernel.loadGBean(threadData, this.classLoader);           
+        kernel.loadGBean(threadData, this.bundle.getBundleContext());
         kernel.startRecursiveGBean(gbeanName);
     }
-    
+
     /* in memory */
     protected void removeGBeanKernel(AbstractName gbeanName) {
         try {
@@ -57,9 +59,9 @@
             // Bean is no longer loaded
         }
     }
-    
+
     /**
-     * ObjectName must match this pattern: 
+     * ObjectName must match this pattern:
      * domain:j2eeType=&lt;j2eeType&gt;,name=MyName,J2EEServer=MyServer
      */
     public static void verifyObjectName(String objectNameStr, String j2eeType, String name) {
@@ -76,7 +78,7 @@
         }
         if (!keyPropertyList.containsKey(NameFactory.J2EE_NAME)) {
             throw new InvalidObjectNameException(
-                    name + " object must contain a name property", 
+                    name + " object must contain a name property",
                     objectName);
         }
         if (!keyPropertyList.containsKey(NameFactory.J2EE_SERVER)) {

Modified: geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/context/ContextServiceGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/context/ContextServiceGBean.java?rev=881866&r1=881865&r2=881866&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/context/ContextServiceGBean.java (original)
+++ geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/context/ContextServiceGBean.java Wed Nov 18 18:31:09 2009
@@ -27,53 +27,54 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.kernel.Kernel;
+import org.osgi.framework.Bundle;
 
 public class ContextServiceGBean implements ModuleAwareResourceSource {
 
     public static final GBeanInfo GBEAN_INFO;
-    
+
     private ManagedContextHandlerChain mainContextHandler;
     private BasicContextService contextService;
 
-    public ContextServiceGBean(Kernel kernel, 
-                               ClassLoader classLoader,
+    public ContextServiceGBean(Kernel kernel,
+                               Bundle bundle,
                                AbstractName name,
                                String[] contextHandlerClasses) {
-        List<ManagedContextHandler> handlers = 
-            ContextHandlerUtils.loadHandlers(classLoader, contextHandlerClasses);
+        List<ManagedContextHandler> handlers =
+            ContextHandlerUtils.loadHandlers(bundle, contextHandlerClasses);
         this.mainContextHandler = new ManagedContextHandlerChain(handlers);
     }
-    
+
     private synchronized BasicContextService getContextService() {
         if (this.contextService == null) {
-            this.contextService = new BasicContextService(this.mainContextHandler);            
+            this.contextService = new BasicContextService(this.mainContextHandler);
         }
         return this.contextService;
     }
-    
+
     public Object $getResource(AbstractName moduleID) {
         return new ContextServiceModuleFacade(getContextService(), moduleID);
     }
-    
+
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(ContextServiceGBean.class, "ContextService");
 
-        infoFactory.addAttribute("classLoader", ClassLoader.class, false, false);
+        infoFactory.addAttribute("bundle", ClassLoader.class, false, false);
         infoFactory.addAttribute("abstractName", AbstractName.class, false, false);
         infoFactory.addAttribute("kernel", Kernel.class, false, false);
-        
+
         infoFactory.addAttribute("contextHandlers", String[].class, true);
 
-        infoFactory.setConstructor(new String[] {"kernel", 
-                                                 "classLoader", 
+        infoFactory.setConstructor(new String[] {"kernel",
+                                                 "bundle",
                                                  "abstractName",
                                                  "contextHandlers"} );
-        
+
         GBEAN_INFO = infoFactory.getBeanInfo();
     }
 
     public static GBeanInfo getGBeanInfo() {
         return GBEAN_INFO;
     }
-         
+
 }

Modified: geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ComponentManagedExecutorServiceGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ComponentManagedExecutorServiceGBean.java?rev=881866&r1=881865&r2=881866&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ComponentManagedExecutorServiceGBean.java (original)
+++ geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ComponentManagedExecutorServiceGBean.java Wed Nov 18 18:31:09 2009
@@ -37,6 +37,8 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.management.ManagedConstants;
+import org.osgi.framework.Bundle;
+
 
 public class ComponentManagedExecutorServiceGBean implements GBeanLifecycle, ModuleAwareResourceSource {
 
@@ -48,10 +50,10 @@
     protected int maxPoolSize;
     protected long keepAliveTime;
     protected int queueCapacity;
-    protected ManagedThreadFactory threadFactory;    
+    protected ManagedThreadFactory threadFactory;
     protected ManagedContextHandlerChain contextHandler;
-   
-    public ComponentManagedExecutorServiceGBean(ClassLoader classLoader,
+
+    public ComponentManagedExecutorServiceGBean(Bundle bundle,
                                                 int minPoolSize,
                                                 int maxPoolSize,
                                                 long keepAliveTime,
@@ -63,8 +65,8 @@
         this.keepAliveTime = keepAliveTime;
         this.queueCapacity = queueCapacity;
         this.threadFactory = threadFactorySource.getManagedThreadFactory();
-        List<ManagedContextHandler> handlers = 
-            ContextHandlerUtils.loadHandlers(classLoader, contextHandlerClasses);
+        List<ManagedContextHandler> handlers =
+            ContextHandlerUtils.loadHandlers(bundle, contextHandlerClasses);
         this.contextHandler = new ManagedContextHandlerChain(handlers);
     }
 
@@ -74,25 +76,25 @@
             if (this.queueCapacity <= 0) {
                 queue = new LinkedBlockingQueue<Runnable>();
             } else {
-                queue = new ArrayBlockingQueue<Runnable>(this.queueCapacity); 
+                queue = new ArrayBlockingQueue<Runnable>(this.queueCapacity);
             }
             this.executor = new ComponentManagedExecutorService(this.minPoolSize,
                                                                 this.maxPoolSize,
                                                                 this.keepAliveTime,
                                                                 TimeUnit.MILLISECONDS,
-                                                                queue, 
+                                                                queue,
                                                                 this.threadFactory,
                                                                 this.contextHandler);
         }
-        return this.executor;        
+        return this.executor;
     }
-    
+
     protected synchronized void shutdownExecutor() {
         if (this.executor != null) {
             this.executor.shutdown();
         }
     }
-    
+
     public Object $getResource(AbstractName moduleID) {
         return new ManagedExecutorServiceFacade(getManagedExecutorService(), false);
     }
@@ -103,18 +105,18 @@
     public void doFail() {
         shutdownExecutor();
     }
-    
+
     public void doStop() throws Exception {
         doFail();
     }
 
     static {
-        GBeanInfoBuilder infoFactory = 
-            GBeanInfoBuilder.createStatic(ComponentManagedExecutorServiceGBean.class, 
+        GBeanInfoBuilder infoFactory =
+            GBeanInfoBuilder.createStatic(ComponentManagedExecutorServiceGBean.class,
                                           ManagedConstants.MANAGED_EXECUTOR_SERVICE);
 
-        infoFactory.addAttribute("classLoader", ClassLoader.class, false);
-        
+        infoFactory.addAttribute("bundle", Bundle.class, false);
+
         infoFactory.addAttribute("minPoolSize", int.class, true);
         infoFactory.addAttribute("maxPoolSize", int.class, true);
         infoFactory.addAttribute("keepAliveTime", long.class, true);
@@ -123,10 +125,10 @@
 
         infoFactory.addReference("threadFactory", GeronimoManagedThreadFactorySource.class);
 
-        infoFactory.setConstructor(new String[] { "classLoader",
-                                                  "minPoolSize", 
-                                                  "maxPoolSize", 
-                                                  "keepAliveTime", 
+        infoFactory.setConstructor(new String[] { "bundle",
+                                                  "minPoolSize",
+                                                  "maxPoolSize",
+                                                  "keepAliveTime",
                                                   "queueCapacity",
                                                   "threadFactory",
                                                   "contextHandlers" });

Modified: geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ComponentManagedScheduledExecutorServiceGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ComponentManagedScheduledExecutorServiceGBean.java?rev=881866&r1=881865&r2=881866&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ComponentManagedScheduledExecutorServiceGBean.java (original)
+++ geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ComponentManagedScheduledExecutorServiceGBean.java Wed Nov 18 18:31:09 2009
@@ -33,6 +33,8 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.management.ManagedConstants;
+import org.osgi.framework.Bundle;
+
 
 public class ComponentManagedScheduledExecutorServiceGBean implements GBeanLifecycle, ModuleAwareResourceSource {
 
@@ -41,35 +43,35 @@
     protected ManagedScheduledExecutorService executor;
 
     protected int corePoolSize;
-    protected ManagedThreadFactory threadFactory;    
+    protected ManagedThreadFactory threadFactory;
     protected ManagedContextHandlerChain contextHandler;
-   
-    public ComponentManagedScheduledExecutorServiceGBean(ClassLoader classLoader,
+
+    public ComponentManagedScheduledExecutorServiceGBean(Bundle bundle,
                                                          int corePoolSize,
                                                          GeronimoManagedThreadFactorySource threadFactorySource,
                                                          String[] contextHandlerClasses) {
         this.corePoolSize = corePoolSize;
         this.threadFactory = threadFactorySource.getManagedThreadFactory();
-        List<ManagedContextHandler> handlers = 
-            ContextHandlerUtils.loadHandlers(classLoader, contextHandlerClasses);
+        List<ManagedContextHandler> handlers =
+            ContextHandlerUtils.loadHandlers(bundle, contextHandlerClasses);
         this.contextHandler = new ManagedContextHandlerChain(handlers);
     }
 
     protected synchronized ManagedScheduledExecutorService getManagedScheduledExecutorService() {
         if (this.executor == null) {
-            this.executor = new ComponentManagedScheduledExecutorService(this.corePoolSize, 
+            this.executor = new ComponentManagedScheduledExecutorService(this.corePoolSize,
                                                                          this.threadFactory,
                                                                          this.contextHandler);
         }
-        return this.executor;        
+        return this.executor;
     }
-    
+
     protected synchronized void shutdownExecutor() {
         if (this.executor != null) {
             this.executor.shutdown();
         }
     }
-    
+
     public Object $getResource(AbstractName moduleID) {
         return new ManagedScheduledExecutorServiceFacade(getManagedScheduledExecutorService(), false);
     }
@@ -80,25 +82,25 @@
     public void doFail() {
         shutdownExecutor();
     }
-    
+
     public void doStop() throws Exception {
         doFail();
     }
 
     static {
-        GBeanInfoBuilder infoFactory = 
-            GBeanInfoBuilder.createStatic(ComponentManagedScheduledExecutorServiceGBean.class, 
+        GBeanInfoBuilder infoFactory =
+            GBeanInfoBuilder.createStatic(ComponentManagedScheduledExecutorServiceGBean.class,
                                           ManagedConstants.MANAGED_EXECUTOR_SERVICE);
 
-        infoFactory.addAttribute("classLoader", ClassLoader.class, false);
-        
+        infoFactory.addAttribute("bundle", Bundle.class, false);
+
         infoFactory.addAttribute("corePoolSize", int.class, true);
         infoFactory.addAttribute("contextHandlers", String[].class, true);
 
         infoFactory.addReference("threadFactory", GeronimoManagedThreadFactorySource.class);
 
-        infoFactory.setConstructor(new String[] { "classLoader",
-                                                  "corePoolSize", 
+        infoFactory.setConstructor(new String[] { "bundle",
+                                                  "corePoolSize",
                                                   "threadFactory",
                                                   "contextHandlers" });
 

Modified: geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedExecutorServiceGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedExecutorServiceGBean.java?rev=881866&r1=881865&r2=881866&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedExecutorServiceGBean.java (original)
+++ geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedExecutorServiceGBean.java Wed Nov 18 18:31:09 2009
@@ -33,38 +33,39 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.management.EventProvider;
 import org.apache.geronimo.management.ManagedConstants;
+import org.osgi.framework.Bundle;
 
 public class ServerManagedExecutorServiceGBean extends ComponentManagedExecutorServiceGBean implements EventProvider, org.apache.geronimo.management.ManagedExecutorService {
 
     public static final GBeanInfo GBEAN_INFO;
 
     private AbstractName name;
-    
+
     private ServerManagedThreadFactory threadFactory;
-    
-    public ServerManagedExecutorServiceGBean(Kernel kernel,                                              
-                                             AbstractName name, 
-                                             ClassLoader classLoader, 
+
+    public ServerManagedExecutorServiceGBean(Kernel kernel,
+                                             AbstractName name,
+                                             Bundle bundle,
                                              int minPoolSize,
                                              int maxPoolSize,
                                              long keepAliveTime,
                                              int queueCapacity,
                                              GeronimoManagedThreadFactorySource threadFactorySource,
                                              String[] contextHandlerClasses) {
-        super(classLoader, minPoolSize, maxPoolSize, keepAliveTime, queueCapacity, threadFactorySource, contextHandlerClasses);               
-        this.name = name;    
-        
+        super(bundle, minPoolSize, maxPoolSize, keepAliveTime, queueCapacity, threadFactorySource, contextHandlerClasses);
+        this.name = name;
+
         NotificationHelper notificationHelper = new NotificationHelper(kernel, name);
         this.threadFactory = new ServerManagedThreadFactory(threadFactorySource.getManagedThreadFactory(), notificationHelper);
     }
-          
+
     protected synchronized ManagedExecutorService getManagedExecutorService() {
         if (this.executor == null) {
             BlockingQueue<Runnable> queue = null;
             if (this.queueCapacity <= 0) {
                 queue = new LinkedBlockingQueue<Runnable>();
             } else {
-                queue = new ArrayBlockingQueue<Runnable>(this.queueCapacity); 
+                queue = new ArrayBlockingQueue<Runnable>(this.queueCapacity);
             }
             this.executor = new ServerManagedExecutorService(this.minPoolSize,
                                                              this.maxPoolSize,
@@ -74,22 +75,22 @@
                                                              this.threadFactory,
                                                              this.contextHandler);
         }
-        return this.executor;        
+        return this.executor;
     }
-        
+
     @Override
     public Object $getResource(AbstractName moduleID) {
         return new ManagedExecutorServiceModuleFacade(getManagedExecutorService(), moduleID);
     }
-       
+
     public AbstractName getName() {
         return this.name;
     }
-    
+
     public String getObjectName() {
         return this.name.getObjectName().getCanonicalName();
     }
-    
+
     public String[] getEventTypes() {
         return this.threadFactory.getEventTypes();
     }
@@ -101,7 +102,7 @@
     public String[] getThreads() {
         return this.threadFactory.getThreads();
     }
-    
+
     public boolean isEventProvider() {
         return true;
     }
@@ -113,19 +114,19 @@
     public boolean isStatisticsProvider() {
         return false;
     }
-    
+
     protected void verifyObjectName() {
-        GBeanBuilder.verifyObjectName(getObjectName(),  
+        GBeanBuilder.verifyObjectName(getObjectName(),
                                       ManagedConstants.MANAGED_EXECUTOR_SERVICE,
                                       ManagedConstants.MANAGED_EXECUTOR_SERVICE);
     }
-    
+
     static {
-        GBeanInfoBuilder infoFactory = 
-            GBeanInfoBuilder.createStatic(ServerManagedExecutorServiceGBean.class, 
+        GBeanInfoBuilder infoFactory =
+            GBeanInfoBuilder.createStatic(ServerManagedExecutorServiceGBean.class,
                                           ManagedConstants.MANAGED_EXECUTOR_SERVICE);
 
-        infoFactory.addAttribute("classLoader", ClassLoader.class, false);
+        infoFactory.addAttribute("bundle", Bundle.class, false);
         infoFactory.addAttribute("abstractName", AbstractName.class, false);
         infoFactory.addAttribute("kernel", Kernel.class, false);
 
@@ -134,14 +135,14 @@
         infoFactory.addAttribute("keepAliveTime", long.class, true);
         infoFactory.addAttribute("queueCapacity", int.class, true);
         infoFactory.addAttribute("contextHandlers", String[].class, true);
-        
+
         infoFactory.addReference("threadFactory", GeronimoManagedThreadFactorySource.class);
-        
+
         infoFactory.addInterface(org.apache.geronimo.management.ManagedExecutorService.class);
 
-        infoFactory.setConstructor(new String[] { "kernel",  
-                                                  "abstractName", 
-                                                  "classLoader",
+        infoFactory.setConstructor(new String[] { "kernel",
+                                                  "abstractName",
+                                                  "bundle",
                                                   "minPoolSize",
                                                   "maxPoolSize",
                                                   "keepAliveTime",
@@ -155,5 +156,5 @@
     public static GBeanInfo getGBeanInfo() {
         return GBEAN_INFO;
     }
-      
+
 }

Modified: geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedExecutorServiceWrapperGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedExecutorServiceWrapperGBean.java?rev=881866&r1=881865&r2=881866&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedExecutorServiceWrapperGBean.java (original)
+++ geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedExecutorServiceWrapperGBean.java Wed Nov 18 18:31:09 2009
@@ -28,68 +28,70 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.management.ManagedConstants;
 
+import org.osgi.framework.Bundle;
+
 /**
- * Deploys ServerManagedExecutorServiceGBean under the right JMX object name. 
+ * Deploys ServerManagedExecutorServiceGBean under the right JMX object name.
  */
-public class ServerManagedExecutorServiceWrapperGBean 
+public class ServerManagedExecutorServiceWrapperGBean
     extends GBeanBuilder
     implements GBeanLifecycle {
 
     private final static Log LOG = LogFactory.getLog(ServerManagedExecutorServiceWrapperGBean.class);
-    
+
     public static final GBeanInfo GBEAN_INFO;
 
     private AbstractName name;
-      
+
     private String[] contextHandlerClasses;
     private int minPoolSize;
     private int maxPoolSize;
     private long keepAliveTime;
     private int queueCapacity;
-    
+
     private AbstractName executorServiceName;
     private ServerManagedExecutorServiceGBean executorServiceGBean;
-        
-    public ServerManagedExecutorServiceWrapperGBean(Kernel kernel,                                              
-                                                    AbstractName name, 
-                                                    ClassLoader classLoader, 
+
+    public ServerManagedExecutorServiceWrapperGBean(Kernel kernel,
+                                                    AbstractName name,
+                                                    Bundle bundle,
                                                     int minPoolSize,
                                                     int maxPoolSize,
                                                     long keepAliveTime,
                                                     int queueCapacity,
                                                     GeronimoManagedThreadFactorySource threadFactorySource,
-                                                    String[] contextHandlerClasses) {   
-        super(kernel, classLoader);
+                                                    String[] contextHandlerClasses) {
+        super(kernel, bundle);
         this.name = name;
-                
+
         this.contextHandlerClasses = contextHandlerClasses;
         this.minPoolSize = minPoolSize;
         this.maxPoolSize = maxPoolSize;
         this.keepAliveTime = keepAliveTime;
-        this.queueCapacity = queueCapacity;        
+        this.queueCapacity = queueCapacity;
     }
-                    
-    public void doStart() throws Exception {   
+
+    public void doStart() throws Exception {
         String threadName =  (String)this.name.getName().get("name");
         this.executorServiceName = kernel.getNaming().createRootName(name.getArtifact(), threadName, ManagedConstants.MANAGED_EXECUTOR_SERVICE);
         GBeanData executorServiceData = new GBeanData(this.executorServiceName, ServerManagedExecutorServiceGBean.getGBeanInfo());
-        executorServiceData.setAttribute("contextHandlers", this.contextHandlerClasses);     
+        executorServiceData.setAttribute("contextHandlers", this.contextHandlerClasses);
         executorServiceData.setAttribute("minPoolSize", this.minPoolSize);
         executorServiceData.setAttribute("maxPoolSize", this.maxPoolSize);
         executorServiceData.setAttribute("keepAliveTime", this.keepAliveTime);
         executorServiceData.setAttribute("queueCapacity", this.queueCapacity);
-        
+
         GBeanData wrapperData = kernel.getGBeanData(this.name);
-        
-        executorServiceData.setReferencePatterns("threadFactory", 
+
+        executorServiceData.setReferencePatterns("threadFactory",
                                                  wrapperData.getReferencePatterns("threadFactory"));
-        
+
         addGBeanKernel(this.executorServiceName, executorServiceData);
 
         this.executorServiceGBean = (ServerManagedExecutorServiceGBean)kernel.getGBean(this.executorServiceName);
         this.executorServiceGBean.verifyObjectName();
     }
-                
+
     public void doFail() {
         try {
             doStop();
@@ -97,32 +99,32 @@
             // ignore
         }
     }
-    
+
     public void doStop() throws Exception {
         this.executorServiceGBean = null;
         if (this.executorServiceName != null) {
             removeGBeanKernel(this.executorServiceName);
         }
     }
-    
+
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(ServerManagedExecutorServiceWrapperGBean.class, ManagedConstants.MANAGED_THREAD_FACTORY + "Builder");
 
-        infoFactory.addAttribute("classLoader", ClassLoader.class, false, false);
+        infoFactory.addAttribute("bundle", Bundle.class, false, false);
         infoFactory.addAttribute("abstractName", AbstractName.class, false, false);
         infoFactory.addAttribute("kernel", Kernel.class, false, false);
-                
+
         infoFactory.addAttribute("minPoolSize", int.class, true);
         infoFactory.addAttribute("maxPoolSize", int.class, true);
         infoFactory.addAttribute("keepAliveTime", long.class, true);
         infoFactory.addAttribute("queueCapacity", int.class, true);
         infoFactory.addAttribute("contextHandlers", String[].class, true);
-        
+
         infoFactory.addReference("threadFactory", GeronimoManagedThreadFactorySource.class);
-        
-        infoFactory.setConstructor(new String[] { "kernel",  
-                                                  "abstractName", 
-                                                  "classLoader",
+
+        infoFactory.setConstructor(new String[] { "kernel",
+                                                  "abstractName",
+                                                  "bundle",
                                                   "minPoolSize",
                                                   "maxPoolSize",
                                                   "keepAliveTime",

Modified: geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedScheduledExecutorServiceGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedScheduledExecutorServiceGBean.java?rev=881866&r1=881865&r2=881866&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedScheduledExecutorServiceGBean.java (original)
+++ geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedScheduledExecutorServiceGBean.java Wed Nov 18 18:31:09 2009
@@ -28,50 +28,51 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.management.EventProvider;
 import org.apache.geronimo.management.ManagedConstants;
+import org.osgi.framework.Bundle;
 
 public class ServerManagedScheduledExecutorServiceGBean extends ComponentManagedScheduledExecutorServiceGBean implements EventProvider, org.apache.geronimo.management.ManagedExecutorService {
 
     public static final GBeanInfo GBEAN_INFO;
 
     private AbstractName name;
-    
+
     private ServerManagedThreadFactory threadFactory;
-    
-    public ServerManagedScheduledExecutorServiceGBean(Kernel kernel,                                              
-                                                      AbstractName name, 
-                                                      ClassLoader classLoader, 
+
+    public ServerManagedScheduledExecutorServiceGBean(Kernel kernel,
+                                                      AbstractName name,
+                                                      Bundle bundle,
                                                       int corePoolSize,
                                                       GeronimoManagedThreadFactorySource threadFactorySource,
                                                       String[] contextHandlerClasses) {
-        super(classLoader, corePoolSize, threadFactorySource, contextHandlerClasses);               
-        this.name = name;      
-        
+        super(bundle, corePoolSize, threadFactorySource, contextHandlerClasses);
+        this.name = name;
+
         NotificationHelper notificationHelper = new NotificationHelper(kernel, name);
         this.threadFactory = new ServerManagedThreadFactory(threadFactorySource.getManagedThreadFactory(), notificationHelper);
     }
-          
+
     protected synchronized ManagedScheduledExecutorService getManagedScheduledExecutorService() {
         if (this.executor == null) {
             this.executor = new ServerManagedScheduledExecutorService(this.corePoolSize,
                                                                       this.threadFactory,
                                                                       this.contextHandler);
         }
-        return this.executor;        
+        return this.executor;
     }
-        
+
     @Override
     public Object $getResource(AbstractName moduleID) {
         return new ManagedScheduledExecutorServiceModuleFacade(getManagedScheduledExecutorService(), moduleID);
     }
-       
+
     public AbstractName getName() {
         return this.name;
     }
-    
+
     public String getObjectName() {
         return this.name.getObjectName().getCanonicalName();
     }
-    
+
     public String[] getEventTypes() {
         return this.threadFactory.getEventTypes();
     }
@@ -83,7 +84,7 @@
     public String[] getThreads() {
         return this.threadFactory.getThreads();
     }
-    
+
     public boolean isEventProvider() {
         return true;
     }
@@ -95,32 +96,32 @@
     public boolean isStatisticsProvider() {
         return false;
     }
-    
+
     protected void verifyObjectName() {
-        GBeanBuilder.verifyObjectName(getObjectName(),  
+        GBeanBuilder.verifyObjectName(getObjectName(),
                                       ManagedConstants.MANAGED_EXECUTOR_SERVICE,
                                       ManagedConstants.MANAGED_EXECUTOR_SERVICE);
     }
-    
+
     static {
-        GBeanInfoBuilder infoFactory = 
-            GBeanInfoBuilder.createStatic(ServerManagedScheduledExecutorServiceGBean.class, 
+        GBeanInfoBuilder infoFactory =
+            GBeanInfoBuilder.createStatic(ServerManagedScheduledExecutorServiceGBean.class,
                                           ManagedConstants.MANAGED_EXECUTOR_SERVICE);
 
-        infoFactory.addAttribute("classLoader", ClassLoader.class, false);
+        infoFactory.addAttribute("bundle", Bundle.class, false);
         infoFactory.addAttribute("abstractName", AbstractName.class, false);
         infoFactory.addAttribute("kernel", Kernel.class, false);
 
         infoFactory.addAttribute("corePoolSize", int.class, true);
         infoFactory.addAttribute("contextHandlers", String[].class, true);
-        
+
         infoFactory.addReference("threadFactory", GeronimoManagedThreadFactorySource.class);
-        
+
         infoFactory.addInterface(org.apache.geronimo.management.ManagedExecutorService.class);
 
-        infoFactory.setConstructor(new String[] { "kernel",  
-                                                  "abstractName", 
-                                                  "classLoader",
+        infoFactory.setConstructor(new String[] { "kernel",
+                                                  "abstractName",
+                                                  "bundle",
                                                   "corePoolSize",
                                                   "threadFactory",
                                                   "contextHandlers" });
@@ -131,5 +132,5 @@
     public static GBeanInfo getGBeanInfo() {
         return GBEAN_INFO;
     }
-      
+
 }

Modified: geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedScheduledExecutorServiceWrapperGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedScheduledExecutorServiceWrapperGBean.java?rev=881866&r1=881865&r2=881866&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedScheduledExecutorServiceWrapperGBean.java (original)
+++ geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/executor/ServerManagedScheduledExecutorServiceWrapperGBean.java Wed Nov 18 18:31:09 2009
@@ -28,56 +28,58 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.management.ManagedConstants;
 
+import org.osgi.framework.Bundle;
+
 /**
- * Deploys ServerManagedScheduledExecutorServiceGBean under the right JMX object name. 
+ * Deploys ServerManagedScheduledExecutorServiceGBean under the right JMX object name.
  */
-public class ServerManagedScheduledExecutorServiceWrapperGBean 
+public class ServerManagedScheduledExecutorServiceWrapperGBean
     extends GBeanBuilder
     implements GBeanLifecycle {
 
     private final static Log LOG = LogFactory.getLog(ServerManagedScheduledExecutorServiceWrapperGBean.class);
-    
+
     public static final GBeanInfo GBEAN_INFO;
 
     private AbstractName name;
-      
+
     private int corePoolSize;
     private String[] contextHandlerClasses;
-    
+
     private AbstractName executorServiceName;
     private ServerManagedScheduledExecutorServiceGBean executorServiceGBean;
-        
-    public ServerManagedScheduledExecutorServiceWrapperGBean(Kernel kernel,                                              
-                                                             AbstractName name, 
-                                                             ClassLoader classLoader, 
+
+    public ServerManagedScheduledExecutorServiceWrapperGBean(Kernel kernel,
+                                                             AbstractName name,
+                                                             Bundle bundle,
                                                              int corePoolSize,
                                                              GeronimoManagedThreadFactorySource threadFactorySource,
-                                                             String[] contextHandlerClasses) {       
-        super(kernel, classLoader);
+                                                             String[] contextHandlerClasses) {
+        super(kernel, bundle);
         this.name = name;
-                
+
         this.contextHandlerClasses = contextHandlerClasses;
         this.corePoolSize = corePoolSize;
     }
-            
-    public void doStart() throws Exception {   
+
+    public void doStart() throws Exception {
         String threadName =  (String)this.name.getName().get("name");
         this.executorServiceName = kernel.getNaming().createRootName(name.getArtifact(), threadName, ManagedConstants.MANAGED_EXECUTOR_SERVICE);
         GBeanData executorServiceData = new GBeanData(this.executorServiceName, ServerManagedScheduledExecutorServiceGBean.getGBeanInfo());
-        executorServiceData.setAttribute("contextHandlers", this.contextHandlerClasses);     
+        executorServiceData.setAttribute("contextHandlers", this.contextHandlerClasses);
         executorServiceData.setAttribute("corePoolSize", this.corePoolSize);
-        
+
         GBeanData wrapperData = kernel.getGBeanData(this.name);
-        
-        executorServiceData.setReferencePatterns("threadFactory", 
+
+        executorServiceData.setReferencePatterns("threadFactory",
                                                  wrapperData.getReferencePatterns("threadFactory"));
-        
+
         addGBeanKernel(this.executorServiceName, executorServiceData);
 
         this.executorServiceGBean = (ServerManagedScheduledExecutorServiceGBean)kernel.getGBean(this.executorServiceName);
         this.executorServiceGBean.verifyObjectName();
     }
-                
+
     public void doFail() {
         try {
             doStop();
@@ -85,29 +87,29 @@
             // ignore
         }
     }
-    
+
     public void doStop() throws Exception {
         this.executorServiceGBean = null;
         if (this.executorServiceName != null) {
             removeGBeanKernel(this.executorServiceName);
         }
     }
-    
+
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(ServerManagedScheduledExecutorServiceWrapperGBean.class, ManagedConstants.MANAGED_THREAD_FACTORY + "Builder");
 
-        infoFactory.addAttribute("classLoader", ClassLoader.class, false, false);
+        infoFactory.addAttribute("bundle", Bundle.class, false, false);
         infoFactory.addAttribute("abstractName", AbstractName.class, false, false);
         infoFactory.addAttribute("kernel", Kernel.class, false, false);
-                
+
         infoFactory.addAttribute("corePoolSize", int.class, true);
         infoFactory.addAttribute("contextHandlers", String[].class, true);
-        
+
         infoFactory.addReference("threadFactory", GeronimoManagedThreadFactorySource.class);
-        
-        infoFactory.setConstructor(new String[] { "kernel",  
-                                                  "abstractName", 
-                                                  "classLoader",
+
+        infoFactory.setConstructor(new String[] { "kernel",
+                                                  "abstractName",
+                                                  "bundle",
                                                   "corePoolSize",
                                                   "threadFactory",
                                                   "contextHandlers" });

Modified: geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/thread/ManagedThreadFactoryGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/thread/ManagedThreadFactoryGBean.java?rev=881866&r1=881865&r2=881866&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/thread/ManagedThreadFactoryGBean.java (original)
+++ geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/thread/ManagedThreadFactoryGBean.java Wed Nov 18 18:31:09 2009
@@ -35,23 +35,24 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.management.EventProvider;
 import org.apache.geronimo.management.ManagedConstants;
+import org.osgi.framework.Bundle;
 
-public class ManagedThreadFactoryGBean 
+public class ManagedThreadFactoryGBean
     extends GBeanBuilder
-    implements GBeanLifecycle, 
+    implements GBeanLifecycle,
                GeronimoManagedThreadFactorySource,
-               ModuleAwareResourceSource, 
-               EventProvider, 
+               ModuleAwareResourceSource,
+               EventProvider,
                org.apache.geronimo.management.ManagedThreadFactory {
 
     private final static Log LOG = LogFactory.getLog(ManagedThreadFactoryGBean.class);
-    
+
     public static final GBeanInfo GBEAN_INFO;
 
     private AbstractName name;
-        
+
     private GeronimoManagedThreadFactory threadFactory;
-   
+
     private ManagedContextHandlerChain mainContextHandler;
 
     private String groupName;
@@ -62,109 +63,109 @@
     private long hungTaskMonitorFrequency;
 
     private NotificationHelper notificationHelper;
-        
-    public ManagedThreadFactoryGBean(Kernel kernel, 
-                                     ClassLoader classLoader, 
-                                     AbstractName name, 
+
+    public ManagedThreadFactoryGBean(Kernel kernel,
+                                     Bundle bundle,
+                                     AbstractName name,
                                      String[] contextHandlerClasses,
                                      String groupName,
                                      int threadPriority,
                                      boolean daemonThread,
                                      long hungTaskThreshold,
-                                     long hungTaskMonitorFrequency) {   
-        super(kernel, classLoader);
+                                     long hungTaskMonitorFrequency) {
+        super(kernel, bundle);
         this.name = name;
-                
+
         this.notificationHelper = new NotificationHelper(kernel, name);
-       
-        List<ManagedContextHandler> handlers = 
-            ContextHandlerUtils.loadHandlers(classLoader, contextHandlerClasses);
-        
+
+        List<ManagedContextHandler> handlers =
+            ContextHandlerUtils.loadHandlers(bundle, contextHandlerClasses);
+
         this.mainContextHandler = new ManagedContextHandlerChain(handlers);
-        
+
         this.groupName = groupName;
         this.daemonThread = daemonThread;
         this.threadPriority = getThreadPriority(threadPriority);
         this.hungTaskThreshold = hungTaskThreshold;
         this.hungTaskMonitorFrequency = getHungTaskMonitorFrequency(hungTaskMonitorFrequency);
     }
-    
+
     private static int getThreadPriority(int threadPriority) {
         return (threadPriority <= 0) ? Thread.NORM_PRIORITY : threadPriority;
     }
-    
+
     private static long getHungTaskMonitorFrequency(long hungTaskMonitorFrequency) {
         return (hungTaskMonitorFrequency <= 0) ? 1000 * 60 : hungTaskMonitorFrequency;
     }
-        
+
     private void sendNotification(ManagedThreadGBean threadGBean) {
         if (this.notificationHelper.isNotificationSupported()) {
             Properties userData = new Properties();
             userData.setProperty("managedthread", threadGBean.getObjectName());
-                        
+
             this.notificationHelper.sendNotification(ManagedConstants.NEW_THREAD_EVENT, userData);
         }
     }
-    
+
     protected void addThreadGBean(GeronimoManagedThread thread) {
         AbstractName aName = kernel.getNaming().createRootName(name.getArtifact(), thread.getName(), ManagedConstants.MANAGED_THREAD);
         GBeanData threadData = new GBeanData(aName, ManagedThreadGBean.getGBeanInfo());
-        
+
         try {
             // use either addGBeanKernel() or addGBeanConfiguration()
             addGBeanKernel(aName, threadData);
-                        
+
             ManagedThreadGBean threadGBean = (ManagedThreadGBean)kernel.getGBean(aName);
             threadGBean.verifyObjectName();
-            
+
             // let gbean know about the thread
             threadGBean.setManagedThread(thread);
             // let thread know about the gbean
             thread.setGbean(threadGBean);
-            
+
             // send JMX notification
             sendNotification(threadGBean);
-            
+
         } catch (Exception e) {
             LOG.warn("Failed to add thread gbean", e);
         }
     }
-   
+
     protected void removeThreadGBean(GeronimoManagedThread thread) {
         AbstractName gbeanName = thread.getGbean().getName();
-                
+
         removeGBeanKernel(gbeanName);
     }
-       
+
     public synchronized GeronimoManagedThreadFactory getManagedThreadFactory() {
-        if (this.threadFactory == null) {                       
+        if (this.threadFactory == null) {
             // create the factory
             this.threadFactory = new GeronimoManagedThreadFactory(this);
-            
+
             this.threadFactory.setThreadGroup(groupName);
             this.threadFactory.setDaemonThread(daemonThread);
             this.threadFactory.setThreadPriority(getThreadPriority(threadPriority));
             this.threadFactory.setHungTaskThreshold(hungTaskThreshold);
             this.threadFactory.setHungTaskMonitorFrequency(getHungTaskMonitorFrequency(hungTaskMonitorFrequency));
         }
-        
+
         return this.threadFactory;
     }
-    
-    public Object $getResource(AbstractName moduleID) {  
+
+    public Object $getResource(AbstractName moduleID) {
         GeronimoManagedThreadFactory threadFactory = getManagedThreadFactory();
         return new StandaloneManagedThreadFactory(threadFactory, this.mainContextHandler, moduleID);
     }
-    
-    public void doStart() throws Exception {          
+
+    public void doStart() throws Exception {
     }
-                
+
     public void doFail() {
         if (this.threadFactory != null) {
             this.threadFactory.shutdown();
         }
     }
-    
+
     public void doStop() throws Exception {
         doFail();
     }
@@ -184,27 +185,27 @@
             return new String [] {};
         }
     }
-    
+
     public int getPriority() {
         return this.threadPriority;
     }
-    
+
     public boolean getDaemon() {
         return this.daemonThread;
     }
-    
+
     public long getHungTaskThreshold() {
         return this.hungTaskThreshold;
     }
-    
+
     public long getHungTaskMonitorFrequency() {
         return this.hungTaskMonitorFrequency;
     }
-    
+
     public AbstractName getName() {
         return this.name;
     }
-         
+
     public String getObjectName() {
         return this.name.getObjectName().getCanonicalName();
     }
@@ -212,7 +213,7 @@
     public String[] getEventTypes() {
         return new String[] { ManagedConstants.NEW_THREAD_EVENT };
     }
-    
+
     public boolean isEventProvider() {
         return true;
     }
@@ -224,34 +225,34 @@
     public boolean isStatisticsProvider() {
         return false;
     }
-    
+
     protected void verifyObjectName() {
-        GBeanBuilder.verifyObjectName(getObjectName(),  
+        GBeanBuilder.verifyObjectName(getObjectName(),
                                       ManagedConstants.MANAGED_THREAD_FACTORY,
                                       ManagedConstants.MANAGED_THREAD_FACTORY);
     }
-    
+
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(ManagedThreadFactoryGBean.class, ManagedConstants.MANAGED_THREAD_FACTORY);
 
-        infoFactory.addAttribute("classLoader", ClassLoader.class, false, false);
+        infoFactory.addAttribute("bundle", Bundle.class, false, false);
         infoFactory.addAttribute("abstractName", AbstractName.class, false, false);
         infoFactory.addAttribute("kernel", Kernel.class, false, false);
-                
+
         infoFactory.addAttribute("contextHandlers", String[].class, true, false);
-        
+
         infoFactory.addAttribute("groupName", String.class, true);
         infoFactory.addAttribute("priority", int.class, true);
-        infoFactory.addAttribute("daemon", boolean.class, true);  
+        infoFactory.addAttribute("daemon", boolean.class, true);
         infoFactory.addAttribute("hungTaskThreshold", long.class, true);
         infoFactory.addAttribute("hungTaskMonitorFrequency", long.class, true);
 
         infoFactory.addInterface(GeronimoManagedThreadFactorySource.class);
         infoFactory.addInterface(org.apache.geronimo.management.ManagedThreadFactory.class);
 
-        infoFactory.setConstructor(new String[]{"kernel", 
-                                                "classLoader", 
-                                                "abstractName", 
+        infoFactory.setConstructor(new String[]{"kernel",
+                                                "bundle",
+                                                "abstractName",
                                                 "contextHandlers",
                                                 "groupName",
                                                 "priority",

Modified: geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/thread/ManagedThreadFactoryWrapperGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/thread/ManagedThreadFactoryWrapperGBean.java?rev=881866&r1=881865&r2=881866&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/thread/ManagedThreadFactoryWrapperGBean.java (original)
+++ geronimo/server/trunk/plugins/concurrent/geronimo-concurrent/src/main/java/org/apache/geronimo/concurrent/impl/thread/ManagedThreadFactoryWrapperGBean.java Wed Nov 18 18:31:09 2009
@@ -26,43 +26,44 @@
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.management.ManagedConstants;
+import org.osgi.framework.Bundle;
 
 /**
- * Deploys ManagedThreadFactoryGBean under the right JMX object name. 
+ * Deploys ManagedThreadFactoryGBean under the right JMX object name.
  */
-public class ManagedThreadFactoryWrapperGBean 
+public class ManagedThreadFactoryWrapperGBean
     extends GBeanBuilder
-    implements GBeanLifecycle, 
+    implements GBeanLifecycle,
                GeronimoManagedThreadFactorySource {
 
     private final static Log LOG = LogFactory.getLog(ManagedThreadFactoryWrapperGBean.class);
-    
+
     public static final GBeanInfo GBEAN_INFO;
 
     private AbstractName name;
-   
+
     private String groupName;
     private boolean daemonThread;
     private int threadPriority;
     private long hungTaskThreshold;
     private long hungTaskMonitorFrequency;
     private String[] contextHandlerClasses;
-    
+
     private AbstractName threadFactoryName;
     private ManagedThreadFactoryGBean threadFactoryGBean;
-        
-    public ManagedThreadFactoryWrapperGBean(Kernel kernel, 
-                                            ClassLoader classLoader, 
-                                            AbstractName name, 
+
+    public ManagedThreadFactoryWrapperGBean(Kernel kernel,
+                                            Bundle bundle,
+                                            AbstractName name,
                                             String[] contextHandlerClasses,
                                             String groupName,
                                             int threadPriority,
                                             boolean daemonThread,
                                             long hungTaskThreshold,
-                                            long hungTaskMonitorFrequency) {    
-        super(kernel, classLoader);
+                                            long hungTaskMonitorFrequency) {
+        super(kernel, bundle);
         this.name = name;
-                
+
         this.contextHandlerClasses = contextHandlerClasses;
         this.groupName = groupName;
         this.daemonThread = daemonThread;
@@ -70,12 +71,12 @@
         this.hungTaskThreshold = hungTaskThreshold;
         this.hungTaskMonitorFrequency = hungTaskMonitorFrequency;
     }
-            
+
     public GeronimoManagedThreadFactory getManagedThreadFactory() {
         return (this.threadFactoryGBean == null) ? null : this.threadFactoryGBean.getManagedThreadFactory();
     }
-        
-    public void doStart() throws Exception {   
+
+    public void doStart() throws Exception {
         String threadName =  (String)this.name.getName().get("name");
         this.threadFactoryName = kernel.getNaming().createRootName(name.getArtifact(), threadName, ManagedConstants.MANAGED_THREAD_FACTORY);
         GBeanData threadFactoryData = new GBeanData(this.threadFactoryName, ManagedThreadFactoryGBean.getGBeanInfo());
@@ -85,13 +86,13 @@
         threadFactoryData.setAttribute("daemon", this.daemonThread);
         threadFactoryData.setAttribute("hungTaskThreshold", this.hungTaskThreshold);
         threadFactoryData.setAttribute("hungTaskMonitorFrequency", this.hungTaskMonitorFrequency);
-        
+
         addGBeanKernel(this.threadFactoryName, threadFactoryData);
 
         this.threadFactoryGBean = (ManagedThreadFactoryGBean)kernel.getGBean(this.threadFactoryName);
         this.threadFactoryGBean.verifyObjectName();
     }
-                
+
     public void doFail() {
         try {
             doStop();
@@ -99,34 +100,34 @@
             // ignore
         }
     }
-    
+
     public void doStop() throws Exception {
         this.threadFactoryGBean = null;
         if (this.threadFactoryName != null) {
             removeGBeanKernel(this.threadFactoryName);
         }
     }
-    
+
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(ManagedThreadFactoryWrapperGBean.class, ManagedConstants.MANAGED_THREAD_FACTORY + "Builder");
 
-        infoFactory.addAttribute("classLoader", ClassLoader.class, false, false);
+        infoFactory.addAttribute("bundle", Bundle.class, false, false);
         infoFactory.addAttribute("abstractName", AbstractName.class, false, false);
         infoFactory.addAttribute("kernel", Kernel.class, false, false);
-                
+
         infoFactory.addAttribute("contextHandlers", String[].class, true, false);
-        
+
         infoFactory.addAttribute("groupName", String.class, true);
         infoFactory.addAttribute("priority", int.class, true);
-        infoFactory.addAttribute("daemon", boolean.class, true);  
+        infoFactory.addAttribute("daemon", boolean.class, true);
         infoFactory.addAttribute("hungTaskThreshold", long.class, true);
         infoFactory.addAttribute("hungTaskMonitorFrequency", long.class, true);
 
         infoFactory.addInterface(GeronimoManagedThreadFactorySource.class);
-        
-        infoFactory.setConstructor(new String[]{"kernel", 
-                                                "classLoader", 
-                                                "abstractName", 
+
+        infoFactory.setConstructor(new String[]{"kernel",
+                                                "bundle",
+                                                "abstractName",
                                                 "contextHandlers",
                                                 "groupName",
                                                 "priority",



Mime
View raw message