geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r902162 - in /geronimo/server/trunk: framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/ framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/ framework/modules/geronimo-kernel/ ...
Date Fri, 22 Jan 2010 16:41:58 GMT
Author: gawor
Date: Fri Jan 22 16:41:57 2010
New Revision: 902162

URL: http://svn.apache.org/viewvc?rev=902162&view=rev
Log:
add DelegatingBundle that can delegate calls to multiple Bundles and remove classSource support

Added:
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/DelegatingBundle.java   (with props)
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/DelegatingBundleContext.java   (with props)
Modified:
    geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
    geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/   (props changed)
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanData.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/KernelConfigurationManager.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SerializedConfigurationMarshaler.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockConfigurationManager.java
    geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java
    geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/test/java/org/apache/geronimo/jasper/deployment/BasicTest.java
    geronimo/server/trunk/plugins/jasper/jasper-deployer/src/main/plan/plan.xml
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilderTest.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/PlanParsingTest.java
    geronimo/server/trunk/plugins/jetty8/jetty8-deployer/src/main/plan/plan.xml

Modified: geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java?rev=902162&r1=902161&r2=902162&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java Fri Jan 22 16:41:57 2010
@@ -116,21 +116,21 @@
                         "Specify =\"true\" for more lenient processing such as ignoring missing jars and references that are not spec compliant.");
     }
 
-    private final File baseDir;
-    private final File inPlaceConfigurationDir;
-    private final ResourceContext resourceContext;
-    private final Map<String, ConfigurationData> childConfigurationDatas = new LinkedHashMap<String, ConfigurationData>();
-    private final ConfigurationManager configurationManager;
-    private final Naming naming;
-    private final List<ConfigurationData> additionalDeployment = new ArrayList<ConfigurationData>();
+    protected final File baseDir;
+    protected final File inPlaceConfigurationDir;
+    protected final ResourceContext resourceContext;
+    protected final Map<String, ConfigurationData> childConfigurationDatas = new LinkedHashMap<String, ConfigurationData>();
+    protected final ConfigurationManager configurationManager;
+    protected final Naming naming;
+    protected final List<ConfigurationData> additionalDeployment = new ArrayList<ConfigurationData>();
     protected final AbstractName moduleName;
-    private final LinkedHashSet<String> classPath = new LinkedHashSet<String>();
-    private final ConfigurationModuleType moduleType;
-    private final Environment environment;
+    protected final LinkedHashSet<String> classPath = new LinkedHashSet<String>();
+    protected final ConfigurationModuleType moduleType;
+    protected final Environment environment;
     //This provides services such as loading more bundles, it is NOT for the configuration we are constructing here.
     //It should be a disposable nested framework so as to not pollute the main framework with stuff we load as deployment parents.
     private final BundleContext bundleContext;
-    private Configuration configuration;
+    protected Configuration configuration;
     //TODO OSGI set this
     private boolean boot;
     private Bundle tempBundle;
@@ -829,15 +829,13 @@
     public static LinkedHashSet<String> getImports(List<GBeanData> gbeans) {
         LinkedHashSet<String> imports = new LinkedHashSet<String>();
         for (GBeanData data: gbeans) {
-            if (data.getClassSource() == null) {
-                GBeanInfo info = data.getGBeanInfo();
-                addImport(imports, info.getClassName());
-                for (GAttributeInfo attInfo: info.getAttributes()) {
-                    addImport(imports, attInfo.getType());
-                }
-                for (GReferenceInfo refInfo: info.getReferences()) {
-                    addImport(imports, refInfo.getReferenceType());
-                }
+            GBeanInfo info = data.getGBeanInfo();
+            addImport(imports, info.getClassName());
+            for (GAttributeInfo attInfo: info.getAttributes()) {
+                addImport(imports, attInfo.getType());
+            }
+            for (GReferenceInfo refInfo: info.getReferences()) {
+                addImport(imports, refInfo.getReferenceType());
             }
         }
         return imports;

Modified: geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java?rev=902162&r1=902161&r2=902162&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java Fri Jan 22 16:41:57 2010
@@ -350,7 +350,8 @@
                                 new LinkedHashSet<Artifact>()),
                         new ArrayList<Configuration>(),
                         null,
-                        null);
+                        null,
+                        this);
             } catch (Exception e) {
                 throw new RuntimeException(e);
             }

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Jan 22 16:41:57 2010
@@ -0,0 +1,2 @@
+/geronimo/server/branches/2.2/framework/modules/geronimo-kernel:826768,832538,885058
+/geronimo/server/trunk/framework/modules/geronimo-kernel:749113,749116-807432,809079-825588

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanData.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanData.java?rev=902162&r1=902161&r2=902162&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanData.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanData.java Fri Jan 22 16:41:57 2010
@@ -28,7 +28,6 @@
 import java.util.Set;
 
 import org.apache.geronimo.gbean.annotation.EncryptionSetting;
-import org.apache.geronimo.kernel.repository.Artifact;
 
 /**
  * @version $Rev$ $Date$
@@ -38,8 +37,7 @@
 
     private Externalizable backwardExternalizables[] = new Externalizable[]{
             new V0Externalizable(),
-            new V1Externalizable(),
-            new V2Externalizable()
+            new V1Externalizable()
     };
 
     private GBeanInfo gbeanInfo;
@@ -47,7 +45,6 @@
     private final Map<String, Object> attributes;
     private final Map<String, ReferencePatterns> references;
     private final Set<ReferencePatterns> dependencies;
-    private Artifact classSource;
     private AbstractName abstractName;
     private int priority;
 
@@ -65,10 +62,6 @@
         GBeanInfo gbeanInfo = infoFactory.getGBeanInfo(gbeanClass);
         setGBeanInfo(gbeanInfo);
     }
-    public GBeanData(Class gbeanClass, Artifact classSource) {
-        this(gbeanClass);
-        this.classSource = classSource;
-    }
 
     public GBeanData(GBeanInfo gbeanInfo) {
         this();
@@ -86,15 +79,11 @@
     public GBeanData(AbstractName abstractName, Class gbeanClass) {
         this();
         this.abstractName = abstractName;
+
         GBeanInfo gbeanInfo = infoFactory.getGBeanInfo(gbeanClass);
         setGBeanInfo(gbeanInfo);
     }
     
-    public GBeanData(AbstractName abstractName, Class gbeanClass, Artifact classSource) {
-        this(abstractName, gbeanClass);
-        this.classSource = classSource;
-    }
-
     public GBeanData(GBeanData gbeanData) {
         setGBeanInfo(gbeanData.gbeanInfo);
         infoFactory = gbeanData.infoFactory;
@@ -102,7 +91,6 @@
         references = new HashMap<String, ReferencePatterns>(gbeanData.references);
         dependencies = new HashSet<ReferencePatterns>(gbeanData.dependencies);
         abstractName = gbeanData.abstractName;
-        classSource = gbeanData.classSource;
     }
 
     public AbstractName getAbstractName() {
@@ -134,14 +122,6 @@
         }
     }
 
-    public Artifact getClassSource() {
-        return classSource;
-    }
-
-    public void setClassSource(Artifact classSource) {
-        this.classSource = classSource;
-    }
-
     public Map<String, Object> getAttributes() {
         return new HashMap<String, Object>(attributes);
     }
@@ -189,7 +169,7 @@
         setReferencePatterns(name, new ReferencePatterns(abstractName));
     }
 
-    public void setReferencePatterns(String name, Set<? extends Object> patterns) {
+    public void setReferencePatterns(String name, Set patterns) {
         setReferencePatterns(name, new ReferencePatterns(patterns));
     }
 
@@ -250,8 +230,6 @@
         // write the gbean info
         out.writeObject(gbeanInfo);
 
-        out.writeObject(classSource);
-
         // write the abstract name
         out.writeObject(abstractName);
 
@@ -332,7 +310,6 @@
         public final void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
             // read the gbean info
             readGBeanInfo(in);
-            readClassSource(in);
 
             // read the abstract name
             try {
@@ -390,9 +367,6 @@
         protected void readGBeanInfo(ObjectInput in) throws IOException, ClassNotFoundException {
         }
 
-        protected void readClassSource(ObjectInput in) throws ClassNotFoundException, IOException {
-        }
-
         protected void readPriority(ObjectInput in) throws IOException, ClassNotFoundException {
             priority = GBeanInfo.PRIORITY_NORMAL;
         }
@@ -414,13 +388,6 @@
         }
 
     }
-    
-    private class V2Externalizable extends V1Externalizable {
-
-        protected void readClassSource(ObjectInput in) throws ClassNotFoundException, IOException {
-            classSource = (Artifact) in.readObject();
-        }
-    }
 
 }
 

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java?rev=902162&r1=902161&r2=902162&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java Fri Jan 22 16:41:57 2010
@@ -31,8 +31,6 @@
 
 import javax.management.ObjectName;
 
-import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.geronimo.gbean.AbstractName;
@@ -232,21 +230,8 @@
         this.classLoader = new BundleClassLoader(bundleContext.getBundle());
 
         GBeanInfo gbeanInfo = gbeanData.getGBeanInfo();
-        Bundle bundle;
-        if (gbeanData.getClassSource() == null) {
-            bundle = bundleContext.getBundle();
-        } else {
-            try {
-                Configuration configuration = (Configuration) kernel.getGBean(Configuration.getConfigurationAbstractName(gbeanData.getClassSource()));
-                bundle = configuration.getBundle();
-            } catch (GBeanNotFoundException e) {
-                throw new InvalidConfigurationException("Class loading configuration not found: " + gbeanData.getClassSource(), e);
-            } catch (InvalidConfigException e) {
-                throw new InvalidConfigurationException("Class loading configuration not identified: " + gbeanData.getClassSource(), e);
-            }
-        }
         try {
-            type = bundle.loadClass(gbeanInfo.getClassName());
+            type = bundleContext.getBundle().loadClass(gbeanInfo.getClassName());
         } catch (ClassNotFoundException e) {
             throw new InvalidConfigurationException("Could not load GBeanInfo class from classloader: " + bundleContext +
                     " className=" + gbeanInfo.getClassName(), e);
@@ -255,12 +240,12 @@
         name = gbeanInfo.getName();
 
         // interfaces
-        interfaces = gbeanInfo.getInterfaces().toArray(new String[gbeanInfo.getInterfaces().size()]);
+        interfaces = (String[]) gbeanInfo.getInterfaces().toArray(new String[0]);
 
         // attributes
         attributes = buildAttributes(gbeanInfo);
         for (int i = 0; i < attributes.length; i++) {
-            attributeIndex.put(attributes[i].getName(), i);
+            attributeIndex.put(attributes[i].getName(), new Integer(i));
         }
 
         // references
@@ -270,7 +255,7 @@
 
         references = referencesSet.toArray(new GBeanReference[referencesSet.size()]);
         for (int i = 0; i < references.length; i++) {
-            referenceIndex.put(references[i].getName(), i);
+            referenceIndex.put(references[i].getName(), new Integer(i));
         }
 
         //dependencies

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java?rev=902162&r1=902161&r2=902162&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java Fri Jan 22 16:41:57 2010
@@ -38,11 +38,19 @@
 import org.apache.geronimo.gbean.ReferencePatterns;
 import org.apache.geronimo.gbean.annotation.GBean;
 import org.apache.geronimo.gbean.annotation.ParamAttribute;
+import org.apache.geronimo.gbean.annotation.ParamSpecial;
+import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.KernelRegistry;
 import org.apache.geronimo.kernel.Naming;
+import org.apache.geronimo.kernel.osgi.DelegatingBundle;
+import org.apache.geronimo.kernel.osgi.MultiBundleClassLoader;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.repository.MissingDependencyException;
+import org.apache.geronimo.kernel.repository.Repository;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.osgi.framework.Bundle;
@@ -164,6 +172,8 @@
      * Manageable Attribute Store containing overrides to this configuration.
      */
     private ManageableAttributeStore attributeStore = null;
+    
+    private Bundle bundle;
 
     /**
      * Creates a configuration.
@@ -177,28 +187,36 @@
      * @throws InvalidConfigException if this configuration turns out to have a problem.
      */
     public Configuration(
-//            @ParamAttribute(name = "classLoaderHolder") ClassLoaderHolder classLoaderHolder,
             @ParamAttribute(name = "configurationData") ConfigurationData configurationData,
             @ParamAttribute(name = "dependencyNode") DependencyNode dependencyNode,
             @ParamAttribute(name = "allServiceParents") List<Configuration> allServiceParents,
             @ParamAttribute(name = "attributeStore") ManageableAttributeStore attributeStore,
-            @ParamAttribute(name = "configurationResolver") ConfigurationResolver configurationResolver) throws InvalidConfigException {
-//        if (classLoaderHolder == null) throw new NullPointerException("classLoaders are null");
-        if (configurationData == null) throw new NullPointerException("configurationData is null");
+            @ParamAttribute(name = "configurationResolver") ConfigurationResolver configurationResolver,
+            @ParamAttribute(name = "configurationManager") ConfigurationManager configurationManager) throws InvalidConfigException {
+        if (configurationData == null) {
+            throw new NullPointerException("configurationData is null");
+        }
 
-//        this.classLoaderHolder = classLoaderHolder;
         this.configurationData = configurationData;
         this.naming = configurationData.getNaming();
         this.attributeStore = attributeStore;
         this.dependencyNode = dependencyNode;
         this.allServiceParents = allServiceParents;
         this.configurationResolver = configurationResolver;
-        abstractName = getConfigurationAbstractName(dependencyNode.getId());
-
+        this.abstractName = getConfigurationAbstractName(dependencyNode.getId());
+        this.bundle = configurationData.getBundleContext().getBundle();
+        
+        if (configurationData.isUseEnvironment() && configurationManager != null) {
+            try {
+                List<Bundle> bundles = getParentBundles(configurationData, configurationResolver, configurationManager);            
+                this.bundle = new DelegatingBundle(bundles);
+            } catch (Exception e) {
+                log.debug("Failed to identify bundle parents for " + configurationData.getId(), e);
+            }
+        }
+        
         try {
-
             // Deserialize the GBeans in the configurationData
-            Bundle bundle = configurationData.getBundleContext().getBundle();
             Collection<GBeanData> gbeans = configurationData.getGBeans(bundle);
             if (attributeStore != null) {
                 gbeans = attributeStore.applyOverrides(dependencyNode.getId(), gbeans, bundle);
@@ -219,6 +237,50 @@
         }
     }
 
+    private List<Bundle> getParentBundles(ConfigurationData configurationData,
+                                          ConfigurationResolver configurationResolver,
+                                          ConfigurationManager configurationManager) 
+                                          throws MissingDependencyException, InvalidConfigException {
+        List<Bundle> bundles = new ArrayList<Bundle>();
+        bundles.add(configurationData.getBundleContext().getBundle());
+      
+        LinkedHashSet<Artifact> parents = configurationManager.resolveParentIds(configurationData);
+        for (Artifact parent : parents) {
+            String location = getBundleLocation(configurationResolver, parent);
+            Bundle bundle = getBundleByLocation(configurationData.getBundleContext(), location);
+            if (bundle != null) {
+                System.out.println("Found " + parent + " " + bundle);
+                bundles.add(bundle);
+            }
+        }
+        
+        return bundles;
+    }
+
+    private static String getBundleLocation(ConfigurationResolver configurationResolver, Artifact configurationId) {
+        if (System.getProperty("geronimo.build.car") == null) {
+            return "mvn:" + configurationId.getGroupId() + "/" + configurationId.getArtifactId() + "/" + configurationId.getVersion() + ("jar".equals(configurationId.getType())?  "": "/" + configurationId.getType());
+        }
+        if (configurationResolver == null) {
+            throw new NullPointerException("ConfigurationResolver is null");
+        }
+        try {
+            File file = configurationResolver.resolve(configurationId);
+            return "reference:file://" + file.getAbsolutePath();
+        } catch (MissingDependencyException e) {
+            return null;
+        }
+    }
+    
+    private static Bundle getBundleByLocation(BundleContext bundleContext, String location) {
+        for (Bundle bundle: bundleContext.getBundles()) {
+            if (location.equals(bundle.getLocation())) {
+               return bundle;
+            }
+        }
+        return null;
+    }
+    
     /**
      * Add a contained configuration, such as for a war inside an ear
      * @param child contained configuration
@@ -341,11 +403,11 @@
      * @return the bundle for this configuration
      */
     public Bundle getBundle() {
-        return configurationData.getBundleContext().getBundle();
+        return bundle;
     }
 
     public BundleContext getBundleContext() {
-        return configurationData.getBundleContext();
+        return bundle.getBundleContext();
     }
 
     /**

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java?rev=902162&r1=902161&r2=902162&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java Fri Jan 22 16:41:57 2010
@@ -106,6 +106,8 @@
     private transient ConfigurationDataTransformer configurationDataTransformer;
 
     private transient BundleContext bundleContext;
+    
+    private transient boolean useEnvironment;
 
     public ConfigurationData(Artifact configId, Naming naming, GBeanState gbeanState) {
         this(new Environment(configId), naming, gbeanState);
@@ -303,5 +305,13 @@
     public void setConfigurationDataTransformer(ConfigurationDataTransformer configurationDataTransformer) {
         this.configurationDataTransformer = configurationDataTransformer;
     }
+    
+    public boolean isUseEnvironment() {
+        return useEnvironment;
+    }
+
+    public void setUseEnvironment(boolean useEnvironment) {
+        this.useEnvironment = useEnvironment;
+    }
 
 }

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/KernelConfigurationManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/KernelConfigurationManager.java?rev=902162&r1=902161&r2=902162&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/KernelConfigurationManager.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/KernelConfigurationManager.java Fri Jan 22 16:41:57 2010
@@ -162,6 +162,7 @@
 //        } catch (NoSuchConfigException e) {
 //            throw new InvalidConfigException(e);
         }
+        gbeanData.setAttribute("configurationManager", this);
         //TODO is this dangerous?  should really add dependency on attribute store name
         gbeanData.setAttribute("attributeStore", attributeStore);
 

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SerializedConfigurationMarshaler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SerializedConfigurationMarshaler.java?rev=902162&r1=902161&r2=902162&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SerializedConfigurationMarshaler.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SerializedConfigurationMarshaler.java Fri Jan 22 16:41:57 2010
@@ -16,6 +16,8 @@
  */
 package org.apache.geronimo.kernel.config;
 
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
 import java.io.OutputStream;
 import java.io.IOException;
 import java.io.ObjectOutputStream;
@@ -35,6 +37,9 @@
     };
 
     public ConfigurationData readConfigurationData(InputStream in) throws IOException, ClassNotFoundException {
+        if (!(in instanceof BufferedInputStream)) {
+            in = new BufferedInputStream(in);
+        }
         PushbackInputStream pushbackInputStream = new PushbackInputStream(in, 2);
         byte[] streamHeader = new byte[2];
         if (pushbackInputStream.read(streamHeader) != 2) throw new AssertionError("Cound not read stream header");
@@ -61,6 +66,9 @@
     }
 
     public void writeConfigurationData(ConfigurationData configurationData, OutputStream out) throws IOException {
+        if (!(out instanceof BufferedOutputStream)) {
+            out = new BufferedOutputStream(out);
+        }
         ObjectOutputStream oout = new ObjectOutputStream(out);
         try {
             oout.writeObject(configurationData);

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java?rev=902162&r1=902161&r2=902162&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java Fri Jan 22 16:41:57 2010
@@ -424,7 +424,7 @@
 
         List<Configuration> allServiceParents = buildAllServiceParents(null, dependencyNode);
 
-        Configuration configuration = new Configuration(configurationData, dependencyNode, allServiceParents, null, configurationResolver);
+        Configuration configuration = new Configuration(configurationData, dependencyNode, allServiceParents, null, configurationResolver, this);
         configuration.doStart();
         //TODO why???
         resolvedParentIds.add(configuration.getId());

Added: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/DelegatingBundle.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/DelegatingBundle.java?rev=902162&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/DelegatingBundle.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/DelegatingBundle.java Fri Jan 22 16:41:57 2010
@@ -0,0 +1,195 @@
+/*
+ * 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.geronimo.kernel.osgi;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Map;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.Version;
+
+/**
+ * Bundle that delegates ClassLoader operations to a collection of {@link Bundle} objects. 
+ * 
+ * @version $Rev$ $Date$
+ */
+public class DelegatingBundle implements Bundle {
+
+    private Collection<Bundle> bundles;
+    private Bundle bundle;
+    private BundleContext bundleContext;
+
+    public DelegatingBundle(Collection<Bundle> bundles) {
+        this.bundles = bundles;
+        if (bundles.isEmpty()) {
+            throw new IllegalArgumentException("At least one bundle is required");
+        }
+        // assume first Bundle is the main bundle
+        this.bundle = bundles.iterator().next();
+        this.bundleContext = new DelegatingBundleContext(this, bundle.getBundleContext());
+    }
+       
+    public Class<?> loadClass(String name) throws ClassNotFoundException {
+        for (Bundle bundle : bundles) {
+            try {
+                return bundle.loadClass(name);
+            } catch (ClassNotFoundException ex) {
+                // ignore
+            }
+        }
+        throw new ClassNotFoundException(name);
+    }
+
+    public URL getResource(String name) {
+        URL resource = null;
+        for (Bundle bundle : bundles) {
+            resource = bundle.getResource(name);
+            if (resource != null) {
+                return resource;
+            }
+        }
+        return null;
+    }
+
+    public Enumeration<URL> getResources(String name) throws IOException {
+        ArrayList<URL> allResources = new ArrayList<URL>();
+        for (Bundle bundle : bundles) {
+            Enumeration<URL> e = (Enumeration<URL>) bundle.getResources(name);
+            addToList(allResources, e);
+        }
+        return Collections.enumeration(allResources); 
+    }    
+    
+    private static void addToList(List<URL> list, Enumeration<URL> enumeration) {
+        if (enumeration != null) {
+            while (enumeration.hasMoreElements()) {
+                list.add(enumeration.nextElement());
+            }
+        }
+    }
+
+    public BundleContext getBundleContext() {
+        return bundleContext;
+    }
+    
+    public Enumeration findEntries(String arg0, String arg1, boolean arg2) {
+        return bundle.findEntries(arg0, arg1, arg2);
+    }
+
+    public long getBundleId() {
+        return bundle.getBundleId();
+    }
+
+    public URL getEntry(String arg0) {
+        return bundle.getEntry(arg0);
+    }
+
+    public Enumeration getEntryPaths(String arg0) {
+        return bundle.getEntryPaths(arg0);
+    }
+
+    public Dictionary getHeaders() {
+        return bundle.getHeaders();
+    }
+
+    public Dictionary getHeaders(String arg0) {
+        return bundle.getHeaders(arg0);
+    }
+
+    public long getLastModified() {
+        return bundle.getLastModified();
+    }
+
+    public String getLocation() {
+        return bundle.getLocation();
+    }
+
+    public ServiceReference[] getRegisteredServices() {
+        return bundle.getRegisteredServices();
+    }
+
+    public ServiceReference[] getServicesInUse() {
+        return bundle.getServicesInUse();
+    }
+
+    public Map getSignerCertificates(int arg0) {
+        return bundle.getSignerCertificates(arg0);
+    }
+
+    public int getState() {
+        return bundle.getState();
+    }
+
+    public String getSymbolicName() {
+        return bundle.getSymbolicName();
+    }
+
+    public Version getVersion() {
+        return bundle.getVersion();
+    }
+
+    public boolean hasPermission(Object arg0) {
+        return bundle.hasPermission(arg0);
+    }
+
+    public void start() throws BundleException {
+        bundle.start();
+    }
+
+    public void start(int arg0) throws BundleException {
+        bundle.start(arg0);
+    }
+
+    public void stop() throws BundleException {
+        bundle.stop();
+    }
+
+    public void stop(int arg0) throws BundleException {
+        bundle.stop(arg0);
+    }
+
+    public void uninstall() throws BundleException {
+        bundle.uninstall();
+    }
+
+    public void update() throws BundleException {
+        bundle.update();
+    }
+
+    public void update(InputStream arg0) throws BundleException {
+        bundle.update(arg0);
+    }
+
+    public String toString() {
+        return "[MultiBundle] " + bundles;
+    }
+           
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/DelegatingBundle.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/DelegatingBundle.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/DelegatingBundle.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/DelegatingBundleContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/DelegatingBundleContext.java?rev=902162&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/DelegatingBundleContext.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/DelegatingBundleContext.java Fri Jan 22 16:41:57 2010
@@ -0,0 +1,142 @@
+/*
+ * 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.geronimo.kernel.osgi;
+
+import java.io.File;
+import java.io.InputStream;
+import java.util.Dictionary;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.BundleListener;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkListener;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * Bundle that delegates ClassLoader operations to a collection of {@link Bundle} objects. 
+ * 
+ * @version $Rev$ $Date$
+ */
+public class DelegatingBundleContext implements BundleContext {
+
+    private DelegatingBundle bundle;
+    private BundleContext bundleContext;
+    
+    public DelegatingBundleContext(DelegatingBundle bundle, BundleContext bundleContext) {
+        this.bundle = bundle;
+        this.bundleContext = bundleContext;
+    }
+    
+    public Bundle getBundle() {
+        return bundle;
+    }
+        
+    public void addBundleListener(BundleListener arg0) {
+        bundleContext.addBundleListener(arg0);
+    }
+
+    public void addFrameworkListener(FrameworkListener arg0) {
+        bundleContext.addFrameworkListener(arg0);
+    }
+
+    public void addServiceListener(ServiceListener arg0, String arg1) throws InvalidSyntaxException {
+        bundleContext.addServiceListener(arg0, arg1);
+    }
+
+    public void addServiceListener(ServiceListener arg0) {
+        bundleContext.addServiceListener(arg0);
+    }
+
+    public Filter createFilter(String arg0) throws InvalidSyntaxException {
+        return bundleContext.createFilter(arg0);
+    }
+
+    public ServiceReference[] getAllServiceReferences(String arg0, String arg1)
+            throws InvalidSyntaxException {
+        return bundleContext.getAllServiceReferences(arg0, arg1);
+    }
+
+    public Bundle getBundle(long arg0) {
+        return bundleContext.getBundle(arg0);
+    }
+
+    public Bundle[] getBundles() {
+        return bundleContext.getBundles();
+    }
+
+    public File getDataFile(String arg0) {
+        return bundleContext.getDataFile(arg0);
+    }
+
+    public String getProperty(String arg0) {
+        return bundleContext.getProperty(arg0);
+    }
+
+    public Object getService(ServiceReference arg0) {
+        return bundleContext.getService(arg0);
+    }
+
+    public ServiceReference getServiceReference(String arg0) {
+        return bundleContext.getServiceReference(arg0);
+    }
+
+    public ServiceReference[] getServiceReferences(String arg0, String arg1)
+            throws InvalidSyntaxException {
+        return bundleContext.getServiceReferences(arg0, arg1);
+    }
+
+    public Bundle installBundle(String arg0, InputStream arg1) throws BundleException {
+        return bundleContext.installBundle(arg0, arg1);
+    }
+
+    public Bundle installBundle(String arg0) throws BundleException {
+        return bundleContext.installBundle(arg0);
+    }
+
+    public ServiceRegistration registerService(String arg0, Object arg1, Dictionary arg2) {
+        return bundleContext.registerService(arg0, arg1, arg2);
+    }
+
+    public ServiceRegistration registerService(String[] arg0, Object arg1, Dictionary arg2) {
+        return bundleContext.registerService(arg0, arg1, arg2);
+    }
+
+    public void removeBundleListener(BundleListener arg0) {
+        bundleContext.removeBundleListener(arg0);
+    }
+
+    public void removeFrameworkListener(FrameworkListener arg0) {
+        bundleContext.removeFrameworkListener(arg0);
+    }
+
+    public void removeServiceListener(ServiceListener arg0) {
+        bundleContext.removeServiceListener(arg0);
+    }
+
+    public boolean ungetService(ServiceReference arg0) {
+        return bundleContext.ungetService(arg0);
+    }
+    
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/DelegatingBundleContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/DelegatingBundleContext.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/DelegatingBundleContext.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockConfigurationManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockConfigurationManager.java?rev=902162&r1=902161&r2=902162&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockConfigurationManager.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockConfigurationManager.java Fri Jan 22 16:41:57 2010
@@ -122,7 +122,7 @@
     public LifecycleResults loadConfiguration(ConfigurationData configurationData, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
         try {
             Artifact configId = configurationData.getEnvironment().getConfigId();
-            Configuration configuration = new Configuration(configurationData, new DependencyNode(configId, null, null), null, null, null);
+            Configuration configuration = new Configuration(configurationData, new DependencyNode(configId, null, null), null, null, null, this);
             configurations.put(configId, configuration);
         } catch (InvalidConfigException e) {
 

Modified: geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java?rev=902162&r1=902161&r2=902162&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java (original)
+++ geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java Fri Jan 22 16:41:57 2010
@@ -102,13 +102,10 @@
 
     private final Environment defaultEnvironment;
     private final NamingBuilder namingBuilders;
-    private final Artifact jasperArtifact;
 
     public JspModuleBuilderExtension(@ParamAttribute(name = "defaultEnvironment") Environment defaultEnvironment,
-                                     @ParamAttribute(name = "jasperArtifact") Artifact jasperArtifact,
                                      @ParamReference(name = "NamingBuilders", namingType = NameFactory.MODULE_BUILDER) NamingBuilder namingBuilders) {
         this.defaultEnvironment = defaultEnvironment;
-        this.jasperArtifact = jasperArtifact;
         this.namingBuilders = namingBuilders;
     }
 
@@ -171,7 +168,7 @@
         GBeanInfo webAppGBeanInfo = webAppData.getGBeanInfo();
         if (webAppGBeanInfo.getReference("ContextCustomizer") != null) {
             AbstractName jspLifecycleName = moduleContext.getNaming().createChildName(moduleName, "jspLifecycleProvider", GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
-            GBeanData gbeanData = new GBeanData(jspLifecycleName, JasperServletContextCustomizer.class, jasperArtifact);
+            GBeanData gbeanData = new GBeanData(jspLifecycleName, JasperServletContextCustomizer.class);
             gbeanData.setAttribute("holder", holder);
 
             try {

Modified: geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/test/java/org/apache/geronimo/jasper/deployment/BasicTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/test/java/org/apache/geronimo/jasper/deployment/BasicTest.java?rev=902162&r1=902161&r2=902162&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/test/java/org/apache/geronimo/jasper/deployment/BasicTest.java (original)
+++ geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/test/java/org/apache/geronimo/jasper/deployment/BasicTest.java Fri Jan 22 16:41:57 2010
@@ -31,7 +31,7 @@
 public class BasicTest extends TestCase {
     
     public void testMyFacesModuleBuilderExtension() throws Exception {
-        JspModuleBuilderExtension instance = new JspModuleBuilderExtension(null, null, new NamingBuilderCollection(Collections.EMPTY_SET));
+        JspModuleBuilderExtension instance = new JspModuleBuilderExtension(null, new NamingBuilderCollection(Collections.EMPTY_SET));
     }
 
 }

Modified: geronimo/server/trunk/plugins/jasper/jasper-deployer/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jasper/jasper-deployer/src/main/plan/plan.xml?rev=902162&r1=902161&r2=902162&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jasper/jasper-deployer/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/jasper/jasper-deployer/src/main/plan/plan.xml Fri Jan 22 16:41:57 2010
@@ -21,7 +21,6 @@
 <module xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
 
     <gbean name="JspModuleBuilderExtension" class="org.apache.geronimo.jasper.deployment.JspModuleBuilderExtension">
-        <attribute name="jasperArtifact">org.apache.geronimo.configs/jasper/${version}/car</attribute>
         <reference name="NamingBuilders">
             <name>NamingBuilders</name>
         </reference>

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java?rev=902162&r1=902161&r2=902162&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java Fri Jan 22 16:41:57 2010
@@ -161,8 +161,6 @@
     }
 
     private final Environment defaultEnvironment;
-    //plugin wose bundle can load jetty classes and gbean wrappers.
-    private final Artifact jettyArtifact;
     private final AbstractNameQuery jettyContainerObjectName;
     private final JspServletHolderWrapper jspServlet;
     private final Collection defaultServlets;
@@ -180,7 +178,6 @@
     private static final String JETTY_NAMESPACE = JettyWebAppDocument.type.getDocumentElementName().getNamespaceURI();
 
     public JettyModuleBuilder(@ParamAttribute(name="defaultEnvironment")Environment defaultEnvironment,
-                              @ParamAttribute(name="jettyArtifact")Artifact jettyArtifact,
                               @ParamAttribute(name="defaultSessionTimeoutSeconds")Integer defaultSessionTimeoutSeconds,
                               @ParamAttribute(name="defaultWelcomeFiles")List<String> defaultWelcomeFiles,
                               @ParamAttribute(name="jettyContainerObjectName")AbstractNameQuery jettyContainerName,
@@ -200,7 +197,6 @@
                               @ParamSpecial(type = SpecialAttributeType.kernel)Kernel kernel) throws GBeanNotFoundException {
         super(kernel, serviceBuilders, namingBuilders, resourceEnvironmentSetter, webServiceBuilder, moduleBuilderExtensions);
         this.defaultEnvironment = defaultEnvironment;
-        this.jettyArtifact = jettyArtifact;
         this.defaultSessionTimeoutSeconds = (defaultSessionTimeoutSeconds == null) ? 30 * 60 : defaultSessionTimeoutSeconds;
         this.jettyContainerObjectName = jettyContainerName;
         this.jspServlet = jspServlet;
@@ -237,7 +233,7 @@
         AbstractName templateName = kernel.getAbstractNameFor(template);
         return new GBeanData(kernel.getGBeanData(templateName));
     }
-
+      
     protected Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, boolean standAlone, String contextRoot, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
         assert moduleFile != null : "moduleFile is null";
         assert targetPath != null : "targetPath is null";
@@ -283,8 +279,6 @@
 
         EnvironmentType environmentType = jettyWebApp.getEnvironment();
         Environment environment = EnvironmentBuilder.buildEnvironment(environmentType, defaultEnvironment);
-        //make sure jetty is started.
-        environment.addDependency(new Dependency(jettyArtifact, ImportType.SERVICES));
 
         Boolean distributable = webApp.getDistributableArray().length == 1 ? TRUE : FALSE;
         if (TRUE == distributable) {
@@ -392,7 +386,7 @@
 
         WebAppType webApp = (WebAppType) webModule.getSpecDD();
         JettyWebAppType jettyWebApp = (JettyWebAppType) webModule.getVendorDD();
-        GBeanData webModuleData = new GBeanData(moduleName, WebAppContextWrapper.class, jettyArtifact);
+        GBeanData webModuleData = new GBeanData(moduleName, WebAppContextWrapper.class);
 
         configureBasicWebModuleAttributes(webApp, jettyWebApp, moduleContext, earContext, webModule, webModuleData);
 
@@ -578,7 +572,7 @@
 //        AbstractName name = moduleContext.getNaming().createChildName(moduleContext.getModuleName(),
 //                "DefaultWebApplicationHandlerFactory",
 //                NameFactory.GERONIMO_SERVICE);
-//        GBeanData beanData = new GBeanData(name, DefaultWebApplicationHandlerFactory.class, jettyArtifact);
+//        GBeanData beanData = new GBeanData(name, DefaultWebApplicationHandlerFactory.class);
 //        webModuleData.setReferencePattern(WebAppContextWrapper.GBEAN_REF_WEB_APPLICATION_HANDLER_FACTORY, name);
 //        moduleContext.addGBean(beanData);
     }
@@ -614,7 +608,6 @@
 
     private GBeanData configureDefaultServlet(Object defaultServlet, EARContext earContext, AbstractName moduleName, Set knownServletMappings) throws GBeanNotFoundException, GBeanAlreadyExistsException {
         GBeanData servletGBeanData = getGBeanData(kernel, defaultServlet);
-        servletGBeanData.setClassSource(jettyArtifact);
         AbstractName defaultServletObjectName = earContext.getNaming().createChildName(moduleName, (String) servletGBeanData.getAttribute("servletName"), NameFactory.SERVLET);
         servletGBeanData.setAbstractName(defaultServletObjectName);
         servletGBeanData.setReferencePattern("JettyServletRegistration", moduleName);
@@ -629,7 +622,7 @@
         for (FilterType filterType : filterArray) {
             String filterName = filterType.getFilterName().getStringValue().trim();
             AbstractName filterAbstractName = earContext.getNaming().createChildName(moduleName, filterName, NameFactory.WEB_FILTER);
-            GBeanData filterData = new GBeanData(filterAbstractName, FilterHolderWrapper.class, jettyArtifact);
+            GBeanData filterData = new GBeanData(filterAbstractName, FilterHolderWrapper.class);
             filterData.setAttribute("filterName", filterName);
             filterData.setAttribute("filterClass", filterType.getFilterClass().getStringValue().trim());
             Map<String, String> initParams = new HashMap<String, String>();
@@ -647,7 +640,7 @@
         FilterMappingType[] filterMappingArray = webApp.getFilterMappingArray();
         for (FilterMappingType filterMappingType : filterMappingArray) {
             String filterName = filterMappingType.getFilterName().getStringValue().trim();
-            GBeanData filterMappingData = new GBeanData(JettyFilterMapping.class, jettyArtifact);
+            GBeanData filterMappingData = new GBeanData(JettyFilterMapping.class);
             if (previous != null) {
                 filterMappingData.addDependency(previous);
             }
@@ -708,7 +701,6 @@
     private AbstractName addDefaultFiltersGBeans(EARContext earContext, EARContext moduleContext, AbstractName moduleName, AbstractName previous) throws GBeanNotFoundException, GBeanAlreadyExistsException {
         for (Object defaultFilter : defaultFilters) {
             GBeanData filterGBeanData = getGBeanData(kernel, defaultFilter);
-            filterGBeanData.setClassSource(jettyArtifact);
             String filterName = (String) filterGBeanData.getAttribute("filterName");
             AbstractName defaultFilterAbstractName = earContext.getNaming().createChildName(moduleName, filterName, NameFactory.WEB_FILTER);
             filterGBeanData.setAbstractName(defaultFilterAbstractName);
@@ -716,7 +708,7 @@
             moduleContext.addGBean(filterGBeanData);
             //add a mapping to /*
 
-            GBeanData filterMappingGBeanData = new GBeanData(JettyFilterMapping.class, jettyArtifact);
+            GBeanData filterMappingGBeanData = new GBeanData(JettyFilterMapping.class);
             if (previous != null) {
                 filterMappingGBeanData.addDependency(previous);
             }
@@ -790,7 +782,7 @@
 
 
             if (authType != null) {
-                GBeanData securityFactoryData = new GBeanData(factoryName, AuthConfigProviderHandlerFactory.class, jettyArtifact);
+                GBeanData securityFactoryData = new GBeanData(factoryName, AuthConfigProviderHandlerFactory.class);
                 securityFactoryData.setAttribute("messageLayer", "HttpServlet");
                 String contextPath = (String)webModuleData.getAttribute("contextPath");
                 securityFactoryData.setAttribute("appContext", "server " + contextPath);
@@ -800,7 +792,7 @@
                 //otherwise rely on pre-configured jaspi
             } else {
                 LoginConfigType loginConfig = loginConfigArray.length == 1? loginConfigArray[0]: null;
-                GBeanData securityFactoryData = new GBeanData(factoryName, JettySecurityHandlerFactory.class, jettyArtifact);
+                GBeanData securityFactoryData = new GBeanData(factoryName, JettySecurityHandlerFactory.class);
                 configureConfigurationFactory(jettyWebApp, loginConfig, securityFactoryData);
                 BuiltInAuthMethod auth = BuiltInAuthMethod.NONE;
                 if (loginConfig != null) {
@@ -989,7 +981,7 @@
         if (hosts.length > 0 || virtualHosts.length > 0) {
             //use name same as module
             AbstractName hostName = earContext.getNaming().createChildName(webModuleData.getAbstractName(), "Host", "Host");
-            GBeanData hostData = new GBeanData(hostName, Host.class, jettyArtifact);
+            GBeanData hostData = new GBeanData(hostName, Host.class);
             hostData.setAttribute("hosts", hosts);
             hostData.setAttribute("virtualHosts", virtualHosts);
             earContext.addGBean(hostData);
@@ -1076,7 +1068,7 @@
                 throw new DeploymentException("Could not load javax.servlet.Servlet in bundle " + webBundle, e);
             }
             if (baseServletClass.isAssignableFrom(servletClass)) {
-                servletData = new GBeanData(servletAbstractName, ServletHolderWrapper.class, jettyArtifact);
+                servletData = new GBeanData(servletAbstractName, ServletHolderWrapper.class);
                 servletData.setAttribute("servletClass", servletClassName);
             } else {
                 servletData = new GBeanData(pojoWebServiceTemplate);
@@ -1100,7 +1092,7 @@
                 }
             }
         } else if (servletType.isSetJspFile()) {
-            servletData = new GBeanData(servletAbstractName, ServletHolderWrapper.class, jettyArtifact);
+            servletData = new GBeanData(servletAbstractName, ServletHolderWrapper.class);
             servletData.setAttribute("jspFile", servletType.getJspFile().getStringValue().trim());
             servletData.setAttribute("servletClass", jspServlet.getServletClassName());
             initParams.put("development", "false");

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilderTest.java?rev=902162&r1=902161&r2=902162&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilderTest.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilderTest.java Fri Jan 22 16:41:57 2010
@@ -286,7 +286,6 @@
         Collection<ModuleBuilderExtension> moduleBuilderExtensions = new ArrayList<ModuleBuilderExtension>();
         GeronimoSecurityBuilderImpl securityBuilder = new GeronimoSecurityBuilderImpl(null, null, null);
         builder = new JettyModuleBuilder(defaultEnvironment,
-                Artifact.create("org.apache.geronimo.configs/jetty8/3.0-SNAPSHOT/car"),
                 new Integer(1800),
                 Collections.EMPTY_LIST,
                 new AbstractNameQuery(containerName),

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/PlanParsingTest.java?rev=902162&r1=902161&r2=902162&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/PlanParsingTest.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/PlanParsingTest.java Fri Jan 22 16:41:57 2010
@@ -77,7 +77,6 @@
         super.setUp();
         GeronimoSecurityBuilderImpl securityBuilder = new GeronimoSecurityBuilderImpl(null, null, null);
         builder = new JettyModuleBuilder(defaultEnvironment,
-                Artifact.create("org.apache.geronimo.configs/jetty8/3.0-SNAPSHOT/car"),
                 new Integer(1800),
                 null,
                 jettyContainerObjectName,

Modified: geronimo/server/trunk/plugins/jetty8/jetty8-deployer/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/jetty8-deployer/src/main/plan/plan.xml?rev=902162&r1=902161&r2=902162&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/jetty8-deployer/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/jetty8/jetty8-deployer/src/main/plan/plan.xml Fri Jan 22 16:41:57 2010
@@ -127,7 +127,6 @@
         <reference name="ResourceEnvironmentSetter">
             <name>ResourceRefBuilder</name>
         </reference>
-        <attribute name="jettyArtifact">${pom.groupId}/jetty8/${version}/car</attribute>
     </gbean>
 
     <gbean name="StaticContent" class="org.apache.geronimo.jetty8.DefaultServletHolderWrapper">



Mime
View raw message