geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r169154 [2/6] - in /geronimo/trunk: applications/jmxdebug/src/java/org/apache/geronimo/jmxdebug/web/beanlib/ applications/jmxdebug/src/webapp/WEB-INF/ assemblies/j2ee-server/ etc/ modules/assembly/ modules/assembly/src/plan/ modules/axis-builder/ modules/axis/ modules/classloader-server/ modules/classloader-server/src/test/org/apache/geronimo/classloaderserver/http/ modules/client-builder/ modules/client-builder/src/java/org/apache/geronimo/client/builder/ modules/client-builder/src/test/org/apache/geronimo/client/builder/ modules/client/ modules/connector-builder/ modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ modules/connector/ modules/connector/src/java/org/apache/geronimo/connector/ modules/connector/src/java/org/apache/geronimo/connector/outbound/ modules/connector/src/test/org/apache/geronimo/connector/ modules/connector/src/test/org/apache/geronimo/connector/outbound/ modules/deploy-tool/src/java/org/apache/geronimo/deployment/ modules/deploy-tool/src/java/org/apache/geronimo/deployment/plugin/jmx/ modules/deploy-tool/src/java/org/apache/geronimo/deployment/plugin/local/ modules/deployment/ modules/deployment/src/java/org/apache/geronimo/deployment/ modules/deployment/src/java/org/apache/geronimo/deployment/util/ modules/interop/ modules/interop/src/test/org/apache/geronimo/interop/ modules/j2ee-builder/ modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/ modules/j2ee/ modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/ modules/j2ee/src/test/org/apache/geronimo/j2ee/management/ modules/jetty-builder/ modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/ modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/ modules/jetty/ modules/jetty/src/test/org/apache/geronimo/jetty/ modules/jmx-remoting/src/java/org/apache/geronimo/jmxremoting/ modules/kernel/ modules/kernel/src/java/org/apache/geronimo/gbean/jmx/ modules/kernel/src/java/org/apache/geronimo/gbean/runtime/ modules/kernel/src/java/org/apache/geronimo/kernel/ modules/kernel/src/java/org/apache/geronimo/kernel/basic/ modules/kernel/src/java/org/apache/geronimo/kernel/config/ modules/kernel/src/java/org/apache/geronimo/kernel/jmx/ modules/kernel/src/java/org/apache/geronimo/kernel/lifecycle/ modules/kernel/src/java/org/apache/geronimo/kernel/proxy/ modules/kernel/src/java/org/apache/geronimo/kernel/registry/ modules/kernel/src/test/org/apache/geronimo/gbean/ modules/kernel/src/test/org/apache/geronimo/gbean/runtime/ modules/kernel/src/test/org/apache/geronimo/kernel/ modules/mail/ modules/mail/src/java/org/apache/geronimo/mail/ modules/mail/src/test/org/apache/geronimo/mail/ modules/naming/src/java/org/apache/geronimo/naming/reference/ modules/naming/src/test/org/apache/geronimo/naming/java/ modules/security/ modules/security/src/java/org/apache/geronimo/security/jaas/ modules/security/src/java/org/apache/geronimo/security/realm/ modules/security/src/java/org/apache/geronimo/security/realm/providers/ modules/security/src/test/org/apache/geronimo/security/ modules/security/src/test/org/apache/geronimo/security/jaas/ modules/security/src/test/org/apache/geronimo/security/remoting/jmx/ modules/service-builder/ modules/service-builder/src/java/org/apache/geronimo/deployment/service/ modules/spring-builder/ modules/spring-builder/src/java/org/apache/geronimo/spring/deployment/ modules/spring/ modules/spring/src/java/org/apache/geronimo/spring/ modules/system/ modules/system/src/java/org/apache/geronimo/system/configuration/ modules/system/src/java/org/apache/geronimo/system/jmx/ modules/system/src/java/org/apache/geronimo/system/main/ modules/system/src/test/org/apache/geronimo/system/configuration/ modules/test-ddbean/src/java/org/apache/geronimo/deployment/tools/ modules/tomcat-builder/ modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/ modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/ modules/tomcat/ modules/tomcat/src/plan/ modules/tomcat/src/test/org/apache/geronimo/tomcat/ modules/webservices/ plugins/geronimo-packaging-plugin/ plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/ plugins/maven-geronimo-plugin/ plugins/maven-geronimo-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/
Date Sun, 08 May 2005 19:35:28 GMT
Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/plugin/local/StopCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/plugin/local/StopCommand.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/plugin/local/StopCommand.java (original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/plugin/local/StopCommand.java Sun May  8 12:35:23 2005
@@ -21,17 +21,21 @@
 
 import javax.enterprise.deploy.shared.CommandType;
 import javax.enterprise.deploy.spi.TargetModuleID;
+import javax.management.ObjectName;
 
-import org.apache.geronimo.kernel.jmx.KernelMBean;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.ConfigurationManager;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.config.ConfigurationUtil;
 
 /**
  * @version $Rev$ $Date$
  */
 public class StopCommand extends CommandSupport {
-    private final KernelMBean kernel;
+    private final Kernel kernel;
     private final TargetModuleID[] modules;
 
-    public StopCommand(KernelMBean kernel, TargetModuleID modules[]) {
+    public StopCommand(Kernel kernel, TargetModuleID modules[]) {
         super(CommandType.START);
         this.kernel = kernel;
         this.modules = modules;
@@ -39,11 +43,14 @@
 
     public void run() {
         try {
+            ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
             for (int i = 0; i < modules.length; i++) {
                 TargetModuleID module = modules[i];
 
                 URI moduleID = URI.create(module.getModuleID());
-                kernel.stopConfiguration(moduleID);
+                ObjectName configName = Configuration.getConfigurationObjectName(moduleID);
+                kernel.stopGBean(configName);
+                configurationManager.unload(moduleID);
                 addModule(module);
             }
             complete("Completed");

Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/plugin/local/UndeployCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/plugin/local/UndeployCommand.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/plugin/local/UndeployCommand.java (original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/plugin/local/UndeployCommand.java Sun May  8 12:35:23 2005
@@ -25,17 +25,21 @@
 import org.apache.geronimo.deployment.plugin.TargetImpl;
 import org.apache.geronimo.deployment.plugin.TargetModuleIDImpl;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
-import org.apache.geronimo.kernel.jmx.KernelMBean;
+import org.apache.geronimo.kernel.config.ConfigurationManager;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.config.ConfigurationUtil;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.InternalKernelException;
 
 /**
  * @version $Rev$ $Date$
  */
 public class UndeployCommand extends CommandSupport {
     private static final String[] UNINSTALL_SIG = {URI.class.getName()};
-    private final KernelMBean kernel;
+    private final Kernel kernel;
     private final TargetModuleID[] modules;
 
-    public UndeployCommand(KernelMBean kernel, TargetModuleID modules[]) {
+    public UndeployCommand(Kernel kernel, TargetModuleID modules[]) {
         super(CommandType.START);
         this.kernel = kernel;
         this.modules = modules;
@@ -43,12 +47,17 @@
 
     public void run() {
         try {
+            ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
             for (int i = 0; i < modules.length; i++) {
                 TargetModuleIDImpl module = (TargetModuleIDImpl) modules[i];
 
                 URI moduleID = URI.create(module.getModuleID());
                 try {
-                    kernel.stopConfiguration(moduleID);
+                    ObjectName configName = Configuration.getConfigurationObjectName(moduleID);
+                    kernel.stopGBean(configName);
+                    configurationManager.unload(moduleID);
+                } catch (InternalKernelException e) {
+                    // this is cause by the kernel being already shutdown
                 } catch (NoSuchConfigException e) {
                     // module was already undeployed - just continue
                 }

Modified: geronimo/trunk/modules/deployment/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deployment/project.xml?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/deployment/project.xml (original)
+++ geronimo/trunk/modules/deployment/project.xml Sun May  8 12:35:23 2005
@@ -73,7 +73,7 @@
 
         <dependency>
             <groupId>cglib</groupId>
-            <artifactId>cglib-full</artifactId>
+            <artifactId>cglib-nodep</artifactId>
             <version>${cglib_version}</version>
             <url>http://cglib.sf.net/</url>
         </dependency>

Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java (original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java Sun May  8 12:35:23 2005
@@ -19,9 +19,9 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.util.List;
 import java.util.jar.JarFile;
 import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.kernel.config.ConfigurationData;
 
 /**
  * @version $Rev$ $Date$
@@ -42,9 +42,10 @@
      *
      * @param plan the deployment plan
      * @param module the module to build
-     * @param outfile the file to write the configuration to
+     * @param outfile the file in which the configiguration files should be written
+     * @return the Configuration information
      * @throws IOException if there was a problem reading or writing the files
      * @throws org.apache.geronimo.common.DeploymentException if there was a problem with the configuration
      */
-    List buildConfiguration(Object plan, JarFile module, File outfile) throws IOException, DeploymentException;
+    ConfigurationData buildConfiguration(Object plan, JarFile module, File outfile) throws IOException, DeploymentException;
 }

Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java (original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java Sun May  8 12:35:23 2005
@@ -19,31 +19,26 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.io.FileOutputStream;
-import java.net.URI;
+import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Collections;
-import java.util.ArrayList;
 import java.util.jar.Attributes;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 
-//import org.apache.commons.cli.CommandLine;
-//import org.apache.commons.cli.HelpFormatter;
-//import org.apache.commons.cli.Options;
-//import org.apache.commons.cli.ParseException;
-//import org.apache.commons.cli.PosixParser;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
-import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.system.main.CommandLineManifest;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.system.configuration.ExecutableConfigurationUtil;
 
 /**
  * Command line based deployment utility which combines multiple deployable modules
@@ -158,38 +153,21 @@
                 mainAttributes.putValue(CommandLineManifest.ENDORSED_DIRS.toString(), endorsedDirs);
             }
 
-            // Write the manifest
-            FileOutputStream out = null;
-            try {
-                out = new FileOutputStream(new File(metaInf, "MANIFEST.MF"));
-                manifest.write(out);
-            } finally {
-                DeploymentUtil.close(out);
-            }
-
-
-            // this is a bit weird and should be rethougth but it works
-            List childURIs = builder.buildConfiguration(plan, module, configurationDir);
-
+            ConfigurationData configurationData = builder.buildConfiguration(plan, module, configurationDir);
             try {
                 if (targetFile != null) {
-                    // add the startup tag file which allows us to locate the startup directory
-                    File startupJarTag = new File(metaInf, "startup-jar");
-                    if (mainClass != null) {
-                        startupJarTag.createNewFile();
-                    }
-
-                    // jar up the directory
-                    DeploymentUtil.jarDirectory(configurationDir,  targetFile);
-
-                    // remove the startup tag file so it doesn't accidently leak into a normal classloader
-                    startupJarTag.delete();
+                    ExecutableConfigurationUtil.createExecutableConfiguration(configurationData, manifest, configurationDir, targetFile);
                 }
                 if (install) {
-                    URI uri = store.install(configurationDir);
-                    List deployedURIs = new ArrayList(childURIs.size() + 1);
-                    deployedURIs.add(uri.toString());
-                    deployedURIs.addAll(childURIs);
+                    store.install(configurationData, configurationDir);
+                    List deployedURIs = new ArrayList();
+                    deployedURIs.add(configurationData.getId().toString());
+                    // todo this should support a tree structure since configurations could be nested to any depth
+                    for (Iterator iterator = configurationData.getChildConfigurations().iterator(); iterator.hasNext();) {
+                        ConfigurationData childConfiguration = (ConfigurationData) iterator.next();
+                        deployedURIs.add(childConfiguration.getId().toString());
+                        // todo install the child conifgurations here
+                    }
                     return deployedURIs;
                 } else {
                     DeploymentUtil.recursiveDelete(configurationDir);

Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java (original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java Sun May  8 12:35:23 2005
@@ -23,21 +23,19 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.ObjectOutputStream;
 import java.io.OutputStream;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.URLClassLoader;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
-import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Set;
 import java.util.StringTokenizer;
+import java.util.Arrays;
 import java.util.jar.Attributes;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
@@ -54,6 +52,9 @@
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
+import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.repository.Repository;
 
@@ -61,16 +62,9 @@
  * @version $Rev$ $Date$
  */
 public class DeploymentContext {
-    private final URI configID;
-    /**
-     * Identifies the type of configuration (WAR, RAR, EAR et cetera)
-     */
-    private final ConfigurationModuleType type;
     private final Kernel kernel;
-    private final GBeanData config;
+    private final ConfigurationData configurationData;
     private final GBeanDataRegistry gbeans = new GBeanDataRegistry();
-    private final Set dependencies = new LinkedHashSet();
-    private final LinkedHashSet classPath = new LinkedHashSet();
     private final File baseDir;
     private final URI baseUri;
     private final byte[] buffer = new byte[4096];
@@ -78,17 +72,15 @@
     private final LinkedList startedAncestors;
     private final ClassLoader parentCL;
 
-    public DeploymentContext(File baseDir, URI configID, ConfigurationModuleType type, URI parentID, Kernel kernel) throws MalformedObjectNameException, DeploymentException {
-        this(baseDir,  configID,  type, parentID, null, null, kernel);
+    public DeploymentContext(File baseDir, URI configId, ConfigurationModuleType type, URI parentID, Kernel kernel) throws MalformedObjectNameException, DeploymentException {
+        this(baseDir, configId,  type, parentID, null, null, kernel);
     }
 
-    public DeploymentContext(File baseDir, URI configID, ConfigurationModuleType type, URI parentID, String domain, String server, Kernel kernel) throws MalformedObjectNameException, DeploymentException {
+    public DeploymentContext(File baseDir, URI configId, ConfigurationModuleType type, URI parentId, String domain, String server, Kernel kernel) throws MalformedObjectNameException, DeploymentException {
         assert baseDir != null: "baseDir is null";
-        assert configID != null: "configID is null";
+        assert configId != null: "configID is null";
         assert type != null: "type is null";
 
-        this.configID = configID;
-        this.type = type;
         this.kernel = kernel;
 
         if (!baseDir.exists()) {
@@ -100,34 +92,23 @@
         this.baseDir = baseDir;
         this.baseUri = baseDir.toURI();
 
-        config = new GBeanData(Configuration.getConfigurationObjectName(configID), Configuration.GBEAN_INFO);
-
-        try {
-            config.setAttribute("ID", configID);
-            config.setAttribute("type", type);
-            config.setAttribute("parentID", parentID);
-            config.setAttribute("domain", domain);
-            config.setAttribute("server", server);
-        } catch (Exception e) {
-            // we created this GBean ...
-            throw new AssertionError();
-        }
-
-//        gbeans.setDefaultDomain(domain);
-
-        if (kernel != null && parentID != null) {
-            ConfigurationManager configurationManager = kernel.getConfigurationManager();
-            ObjectName parentName = Configuration.getConfigurationObjectName(parentID);
-            config.setReferencePattern("Parent", parentName);
+        configurationData = new ConfigurationData();
+        configurationData.setId(configId);
+        configurationData.setModuleType(type);
+        configurationData.setParentId(parentId);
+
+        if (kernel != null && parentId != null) {
+            ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
+            ObjectName parentName = Configuration.getConfigurationObjectName(parentId);
             try {
-                loadedAncestors = configurationManager.loadRecursive(parentID);
+                loadedAncestors = configurationManager.loadRecursive(parentId);
             } catch (Exception e) {
                 throw new DeploymentException("Unable to load parents", e);
             }
 
             try {
-                config.setAttribute("domain", kernel.getAttribute(parentName, "domain"));
-                config.setAttribute("server", kernel.getAttribute(parentName, "server"));
+                domain = (String) kernel.getAttribute(parentName, "domain");
+                server = (String) kernel.getAttribute(parentName, "server");
             } catch (Exception e) {
                 throw new DeploymentException("Unable to copy domain and server from parent configuration", e);
             }
@@ -137,11 +118,11 @@
                 ObjectName ancestorName = parentName;
                 while (ancestorName != null && !isRunning(kernel, ancestorName)) {
                     startedAncestors.addFirst(ancestorName);
-                    Set patterns = kernel.getGBeanData(ancestorName).getReferencePatterns("Parent");
-                    if (patterns.isEmpty()) {
+                    URI pattern = (URI) kernel.getGBeanData(ancestorName).getAttribute("parentId");
+                    if (pattern == null) {
                         break;
                     }
-                    ancestorName = (ObjectName) patterns.iterator().next();
+                    ancestorName = Configuration.getConfigurationObjectName(pattern);
                 }
                 //we've found what we need to start, now start them.
                 for (Iterator iterator = startedAncestors.iterator(); iterator.hasNext();) {
@@ -173,22 +154,24 @@
         }
 
         //check that domain and server are now known
-        if (config.getAttribute("domain") == null || config.getAttribute("server") == null) {
-            throw new IllegalStateException("Domain or server could not be determined from explicit args or parent configuration. ParentID: " + parentID + ", domain: " + config.getAttribute("domain") + ", server: " + config.getAttribute("server"));
+        if (domain == null || server == null) {
+            throw new IllegalStateException("Domain or server could not be determined from explicit args or parent configuration. ParentID: " + parentId + ", domain: " + domain + ", server: " + server);
         }
 
+        configurationData.setDomain(domain);
+        configurationData.setServer(server);
     }
 
     private static boolean isRunning(Kernel kernel, ObjectName name) throws Exception {
-        return State.RUNNING_INDEX == ((Integer) kernel.getAttribute(name, "state")).intValue();
+        return State.RUNNING_INDEX == kernel.getGBeanState(name);
     }
 
     public URI getConfigID() {
-        return configID;
+        return configurationData.getId();
     }
 
     public ConfigurationModuleType getType() {
-        return type;
+        return configurationData.getModuleType();
     }
 
     public File getBaseDir() {
@@ -196,11 +179,11 @@
     }
 
     public String getDomain() {
-        return (String) config.getAttribute("domain");
+        return configurationData.getDomain();
     }
 
     public String getServer() {
-        return (String) config.getAttribute("server");
+        return configurationData.getServer();
     }
 
     public void addGBean(GBeanData gbean) {
@@ -217,7 +200,7 @@
     }
 
     public void addDependency(URI uri) {
-        dependencies.add(uri);
+        configurationData.addDependency(uri);
     }
 
     /**
@@ -236,7 +219,7 @@
     public void addIncludeAsPackedJar(URI targetPath, JarFile jarFile) throws IOException {
         File targetFile = getTargetFile(targetPath);
         DeploymentUtil.copyToPackedJar(jarFile, targetFile);
-        classPath.add(targetPath);
+        configurationData.addClassPathLocation(targetPath);
     }
 
     /**
@@ -256,7 +239,7 @@
     public void addInclude(URI targetPath, ZipFile zipFile, ZipEntry zipEntry) throws IOException {
         File targetFile = getTargetFile(targetPath);
         addFile(targetFile, zipFile, zipEntry);
-        classPath.add(targetPath);
+        configurationData.addClassPathLocation(targetPath);
     }
 
     /**
@@ -275,7 +258,7 @@
     public void addInclude(URI targetPath, URL source) throws IOException {
         File targetFile = getTargetFile(targetPath);
         addFile(targetFile, source);
-        classPath.add(targetPath);
+        configurationData.addClassPathLocation(targetPath);
     }
 
     /**
@@ -294,7 +277,7 @@
     public void addInclude(URI targetPath, File source) throws IOException {
         File targetFile = getTargetFile(targetPath);
         addFile(targetFile, source);
-        classPath.add(targetPath);
+        configurationData.addClassPathLocation(targetPath);
     }
 
     /**
@@ -344,7 +327,7 @@
             }
 
             URI targetUri = moduleBaseUri.resolve(pathUri);
-            classPath.add(targetUri);
+            configurationData.addClassPathLocation(targetUri);
         }
     }
 
@@ -368,7 +351,7 @@
         assert location.toString().endsWith("/");
 
         if (addToClasspath) {
-            classPath.add(location);
+            configurationData.addClassPathLocation(location);
         }
         String classFileName = fqcn.replace('.', '/') + ".class";
         addFile(getTargetFile(new URI(location.toString() + classFileName)), new ByteArrayInputStream(bytes));
@@ -429,6 +412,8 @@
 
     public ClassLoader getClassLoader(Repository repository) throws DeploymentException {
         // shouldn't user classpath come before dependencies?
+        List dependencies = configurationData.getDependencies();
+        List classPath = configurationData.getClassPath();
         URL[] urls = new URL[dependencies.size() + classPath.size()];
         try {
             int index = 0;
@@ -449,8 +434,6 @@
     }
 
     public void close() throws IOException, DeploymentException {
-        saveConfiguration();
-
         if (kernel != null) {
             if (startedAncestors != null) {
                 //stopping one stops all it's children.
@@ -482,46 +465,41 @@
         }
     }
 
-    private void saveConfiguration() throws IOException, DeploymentException {
-        // persist all the GBeans in this Configuration
-        // save the dependencies and classpath
-        try {
-            GBeanData[] gbeanArray = gbeans.getGBeans();
-            config.setAttribute("gBeanState", Configuration.storeGBeans(gbeanArray));
-            config.setReferencePatterns("Repositories", Collections.singleton(new ObjectName("*:name=Repository,*")));
-            config.setAttribute("dependencies", new ArrayList(dependencies));
-            config.setAttribute("classPath", new ArrayList(classPath));
-        } catch (Exception e) {
-            throw new DeploymentException("Unable to initialize Configuration", e);
-        }
-
-        // save the persisted form in the archive
-        File metaInf = new File(baseDir, "META-INF");
-        metaInf.mkdirs();
-        File configSer = new File(metaInf, "config.ser");
+    public void addChildConfiguration(ConfigurationData configurationData) {
+        configurationData.addChildConfiguration(configurationData);
+    }
 
-        ObjectOutputStream out = null;
-        try {
-            out = new ObjectOutputStream(new FileOutputStream(configSer));
-            try {
-                config.writeExternal(out);
-            } catch (IOException e) {
-                throw e;
-            } catch (Exception e) {
-                throw new DeploymentException("Unable to save Configuration state", e);
-            }
-        } finally {
-            DeploymentUtil.flush(out);
-            DeploymentUtil.close(out);
-        }
+    public ConfigurationData getConfigurationData() {
+        ConfigurationData configurationData = new ConfigurationData(this.configurationData);
+        configurationData.setGBeans(Arrays.asList(gbeans.getGBeans()));
+        return configurationData;
     }
 
     /**
      * @deprecated Currently used only in some tests, and may not be appropriate as a public method.
      * @return a copy of the configurations GBeanData
      */
-    public GBeanData getConfigurationGBeanData() {
-        return new GBeanData(config);
+    public GBeanData getConfigurationGBeanData() throws MalformedObjectNameException, InvalidConfigException {
+        URI id = configurationData.getId();
+        GBeanData config = new GBeanData(Configuration.getConfigurationObjectName(id), Configuration.GBEAN_INFO);
+        config.setAttribute("id", id);
+        config.setAttribute("type", configurationData.getModuleType());
+        config.setAttribute("domain", configurationData.getDomain());
+        config.setAttribute("server", configurationData.getServer());
+
+        URI parentId = configurationData.getParentId();
+        if (parentId != null) {
+            config.setAttribute("parentId", parentId);
+            ObjectName parentName = Configuration.getConfigurationObjectName(parentId);
+            config.setReferencePattern("Parent", parentName);
+        }
+
+        config.setAttribute("gBeanState", Configuration.storeGBeans(gbeans.getGBeans()));
+        config.setReferencePatterns("Repositories", Collections.singleton(new ObjectName("*:name=Repository,*")));
+        config.setAttribute("dependencies", configurationData.getDependencies());
+        config.setAttribute("classPath", configurationData.getClassPath());
+
+        return config;
     }
 
     /**

Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/util/DeploymentUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/util/DeploymentUtil.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/util/DeploymentUtil.java (original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/util/DeploymentUtil.java Sun May  8 12:35:23 2005
@@ -25,8 +25,8 @@
 import java.io.OutputStream;
 import java.io.Reader;
 import java.io.Writer;
-import java.net.URL;
 import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Enumeration;

Modified: geronimo/trunk/modules/interop/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/project.xml?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/interop/project.xml (original)
+++ geronimo/trunk/modules/interop/project.xml Sun May  8 12:35:23 2005
@@ -70,7 +70,7 @@
 
         <dependency>
             <groupId>cglib</groupId>
-            <artifactId>cglib-full</artifactId>
+            <artifactId>cglib-nodep</artifactId>
             <version>${cglib_version}</version>
             <url>http://cglib.sf.net/</url>
         </dependency>

Modified: geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/InteropGBeanTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/InteropGBeanTest.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/InteropGBeanTest.java (original)
+++ geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/InteropGBeanTest.java Sun May  8 12:35:23 2005
@@ -21,6 +21,7 @@
 import junit.framework.TestCase;
 
 import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.Kernel;
 
 
@@ -94,7 +95,7 @@
 
     protected void setUp() throws Exception {
         log("setUp():");
-        kernel = new Kernel(KERNEL_NAME);
+        kernel = KernelFactory.newInstance().createKernel(KERNEL_NAME);
 
         log("setUp(): kernel = " + kernel);
 

Modified: geronimo/trunk/modules/j2ee-builder/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/project.xml?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/project.xml (original)
+++ geronimo/trunk/modules/j2ee-builder/project.xml Sun May  8 12:35:23 2005
@@ -123,7 +123,7 @@
         <!-- test only -->
         <dependency>
             <groupId>cglib</groupId>
-            <artifactId>cglib-full</artifactId>
+            <artifactId>cglib-nodep</artifactId>
             <version>${cglib_version}</version>
             <url>http://cglib.sf.net/</url>
         </dependency>

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java Sun May  8 12:35:23 2005
@@ -28,8 +28,6 @@
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.jar.JarFile;
@@ -52,6 +50,7 @@
 import org.apache.geronimo.j2ee.management.impl.J2EEApplicationImpl;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.security.deployment.SecurityBuilder;
@@ -271,11 +270,10 @@
         return gerApplication;
     }
 
-    public List buildConfiguration(Object plan, JarFile earFile, File outfile) throws IOException, DeploymentException {
+    public ConfigurationData buildConfiguration(Object plan, JarFile earFile, File outfile) throws IOException, DeploymentException {
+        assert plan != null;
         ApplicationInfo applicationInfo = (ApplicationInfo) plan;
         try {
-            List moduleIDs = new LinkedList();
-
             // Create the output ear context
             EARContext earContext = null;
             ConfigurationModuleType applicationType = applicationInfo.getType();
@@ -376,12 +374,7 @@
             // each module can now add it's GBeans
             for (Iterator iterator = modules.iterator(); iterator.hasNext();) {
                 Module module = (Module) iterator.next();
-                String moduleID = getBuilder(module).addGBeans(earContext, module, cl);
-
-                // this is a bit weird and should be rethougth but it works
-                if (moduleID != null) {
-                    moduleIDs.add(moduleID);
-                }
+                getBuilder(module).addGBeans(earContext, module, cl);
             }
 
             //add the JACC gbean if there is a principal-role mapping
@@ -390,7 +383,7 @@
                 earContext.addGBean(jaccBeanData);
             }
             earContext.close();
-            return moduleIDs;
+            return earContext.getConfigurationData();
         } finally {
             Set modules = applicationInfo.getModules();
             for (Iterator iterator = modules.iterator(); iterator.hasNext();) {

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java Sun May  8 12:35:23 2005
@@ -35,5 +35,5 @@
 
     void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException;
 
-    String addGBeans(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException;
+    void addGBeans(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException;
 }

Modified: geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java Sun May  8 12:35:23 2005
@@ -23,6 +23,7 @@
 import java.io.ObjectOutputStream;
 import java.net.URI;
 import java.net.URL;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.jar.JarFile;
@@ -35,19 +36,21 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.KernelFactory;
+import org.apache.geronimo.kernel.config.ConfigurationManagerImpl;
 import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
-import org.apache.geronimo.kernel.registry.BasicGBeanRegistry;
 
 /**
  * @version $Rev$ $Date$
@@ -233,7 +236,7 @@
     }
 
     public void testBuildConfiguration() throws Exception {
-        Kernel kernel = new Kernel("foo", new BasicGBeanRegistry());
+        Kernel kernel = KernelFactory.newInstance().createKernel("foo");
         kernel.boot();
 
         GBeanData store = new GBeanData(JMXUtil.getObjectName("foo:j2eeType=ConfigurationStore,name=mock"), MockConfigStore.GBEAN_INFO);
@@ -242,6 +245,11 @@
 
         EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, null, ejbConfigBuilder, ejbConfigBuilder, webConfigBuilder, connectorConfigBuilder, resourceReferenceBuilder, appClientConfigBuilder, serviceReferenceBuilder, kernel);
 
+        ObjectName configurationManagerName = new ObjectName(":j2eeType=ConfigurationManager,name=Basic");
+        GBeanData configurationManagerData = new GBeanData(configurationManagerName, ConfigurationManagerImpl.GBEAN_INFO);
+        configurationManagerData.setReferencePatterns("Stores", Collections.singleton(store.getName()));
+        kernel.loadGBean(configurationManagerData, getClass().getClassLoader());
+        kernel.startGBean(configurationManagerName);
 
         File tempDir = null;
         try {
@@ -309,42 +317,50 @@
     }
 
     public static class MockConfigStore implements ConfigurationStore {
-        public URI install(URL source) throws IOException, InvalidConfigException {
-            return null;
+        private final Kernel kernel;
+
+        public MockConfigStore(Kernel kernel) {
+            this.kernel = kernel;
         }
 
-        public URI install(File source) throws IOException, InvalidConfigException {
+        public URI install(URL source) throws IOException, InvalidConfigException {
             return null;
         }
 
-        public void uninstall(URI configID) throws NoSuchConfigException, IOException {
-
+        public void install(ConfigurationData configurationData, File source) throws IOException, InvalidConfigException {
         }
 
-        public boolean containsConfiguration(URI configID) {
-            return true;
+        public void uninstall(URI configID) throws NoSuchConfigException, IOException {
         }
 
-        public GBeanData getConfiguration(URI id) throws NoSuchConfigException, IOException, InvalidConfigException {
-            GBeanData configData = null;
+        public ObjectName loadConfiguration(URI configId) throws NoSuchConfigException, IOException, InvalidConfigException {
+            ObjectName configurationObjectName = null;
             try {
-                configData = new GBeanData(Configuration.getConfigurationObjectName(id), Configuration.GBEAN_INFO);
+                configurationObjectName = Configuration.getConfigurationObjectName(configId);
             } catch (MalformedObjectNameException e) {
                 throw new InvalidConfigException(e);
             }
-            configData.setAttribute("ID", id);
+            GBeanData configData = new GBeanData(configurationObjectName, Configuration.GBEAN_INFO);
+            configData.setAttribute("id", configId);
             configData.setAttribute("domain", "test");
             configData.setAttribute("server", "bar");
             configData.setAttribute("gBeanState", NO_OBJECTS_OS);
-            return configData;
-        }
 
-        public void updateConfiguration(Configuration configuration) throws NoSuchConfigException, Exception {
+            try {
+                kernel.loadGBean(configData, Configuration.class.getClassLoader());
+            } catch (Exception e) {
+                throw new InvalidConfigException("Unable to register configuration", e);
+            }
 
+            return configurationObjectName;
         }
 
-        public URL getBaseURL(URI id) throws NoSuchConfigException {
-            return null;
+        public boolean containsConfiguration(URI configID) {
+            return true;
+        }
+
+        public void updateConfiguration(ConfigurationData configurationData) throws NoSuchConfigException, Exception {
+
         }
 
         public String getObjectName() {
@@ -366,6 +382,8 @@
         static {
             GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(MockConfigStore.class, NameFactory.CONFIGURATION_STORE);
             infoBuilder.addInterface(ConfigurationStore.class);
+            infoBuilder.addAttribute("kernel", Kernel.class, false);
+            infoBuilder.setConstructor(new String[] {"kernel"});
             GBEAN_INFO = infoBuilder.getBeanInfo();
 
             ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -377,7 +395,5 @@
                 throw new RuntimeException(e);
             }
         }
-    };
-
-
+    }
 }

Modified: geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java Sun May  8 12:35:23 2005
@@ -30,7 +30,6 @@
 import org.apache.geronimo.common.UnresolvedEJBRefException;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.deployment.DeploymentContext;
-import org.apache.geronimo.xbeans.j2ee.ServiceRefHandlerType;
 import org.apache.geronimo.kernel.Kernel;
 
 /**

Modified: geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java Sun May  8 12:35:23 2005
@@ -64,11 +64,10 @@
         this.cl = cl;
     }
 
-    public String addGBeans(EARContext earContext, Module connectorModule, ClassLoader cl) {
+    public void addGBeans(EARContext earContext, Module connectorModule, ClassLoader cl) {
         assertEquals(this.earContext, earContext);
 //        assertEquals(this.connectorModule, connectorModule);
         assertEquals(this.cl, cl);
-        return null;
     }
 
     public Reference createResourceRef(String containerId, Class iface) throws DeploymentException {

Modified: geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java Sun May  8 12:35:23 2005
@@ -64,11 +64,10 @@
         this.cl = cl;
     }
 
-    public String addGBeans(EARContext earContext, Module ejbModule, ClassLoader cl) {
+    public void addGBeans(EARContext earContext, Module ejbModule, ClassLoader cl) {
         assertEquals(this.earContext, earContext);
 //        assertEquals(this.ejbModule, ejbModule);
         assertEquals(this.cl, cl);
-        return null;
     }
 
     public Reference createEJBLocalReference(String objectName, boolean isSession, String localHome, String local) throws DeploymentException {

Modified: geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java Sun May  8 12:35:23 2005
@@ -65,13 +65,12 @@
         this.cl = cl;
     }
 
-    public String addGBeans(EARContext earContext, Module webModule, ClassLoader cl) throws DeploymentException {
+    public void addGBeans(EARContext earContext, Module webModule, ClassLoader cl) throws DeploymentException {
         assertEquals(this.earContext, earContext);
 //        assertEquals(this.webModule, webModule);
         assertEquals(this.cl, cl);
         assertNotNull(contextRoot);
         this.contextRoot = ((WebModule) webModule).getContextRoot();
-        return null;
     }
 
 }

Modified: geronimo/trunk/modules/j2ee/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee/project.xml?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee/project.xml (original)
+++ geronimo/trunk/modules/j2ee/project.xml Sun May  8 12:35:23 2005
@@ -68,7 +68,7 @@
 
         <dependency>
             <groupId>cglib</groupId>
-            <artifactId>cglib-full</artifactId>
+            <artifactId>cglib-nodep</artifactId>
             <version>${cglib_version}</version>
             <url>http://cglib.sf.net/</url>
         </dependency>

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEAppClientModuleImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEAppClientModuleImpl.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEAppClientModuleImpl.java (original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEAppClientModuleImpl.java Sun May  8 12:35:23 2005
@@ -18,32 +18,50 @@
 
 import java.util.Hashtable;
 import javax.management.ObjectName;
-import javax.naming.Context;
 
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.management.J2EEApplication;
 import org.apache.geronimo.j2ee.management.J2EEServer;
+import org.apache.geronimo.j2ee.management.J2EEAppClientModule;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 
 /**
  * @version $Revision$ $Date$
  */
-public class J2EEAppClientModuleImpl {
+public class J2EEAppClientModuleImpl implements J2EEAppClientModule {
     private final String deploymentDescriptor;
     private final J2EEServer server;
     private final J2EEApplication application;
     private final ClassLoader classLoader;
+    private final String objectName;
 
     public J2EEAppClientModuleImpl(String objectName, J2EEServer server, J2EEApplication application, String deploymentDescriptor, ClassLoader classLoader) {
-        ObjectName myObjectName = JMXUtil.getObjectName(objectName);
+        this.objectName = objectName;
+        ObjectName myObjectName = JMXUtil.getObjectName(this.objectName);
         verifyObjectName(myObjectName);
 
         this.server = server;
         this.application = application;
         this.deploymentDescriptor = deploymentDescriptor;
         this.classLoader = classLoader;
+    }
+
+    public String getObjectName() {
+        return objectName;
+    }
+
+    public boolean isStateManageable() {
+        return true;
+    }
+
+    public boolean isStatisticsProvider() {
+        return false;
+    }
+
+    public boolean isEventProvider() {
+        return true;
     }
 
     /**

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEApplicationImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEApplicationImpl.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEApplicationImpl.java (original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEApplicationImpl.java Sun May  8 12:35:23 2005
@@ -17,12 +17,12 @@
 package org.apache.geronimo.j2ee.management.impl;
 
 import java.util.Hashtable;
-import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.management.J2EEServer;
+import org.apache.geronimo.j2ee.management.J2EEApplication;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
@@ -30,14 +30,16 @@
 /**
  * @version $Rev$ $Date$
  */
-public class J2EEApplicationImpl {
+public class J2EEApplicationImpl implements J2EEApplication {
     private final String deploymentDescriptor;
     private final String baseName;
     private final Kernel kernel;
     private final J2EEServer server;
+    private final String objectName;
 
     public J2EEApplicationImpl(Kernel kernel, String objectName, J2EEServer server, String deploymentDescriptor) {
-        ObjectName myObjectName = JMXUtil.getObjectName(objectName);
+        this.objectName = objectName;
+        ObjectName myObjectName = JMXUtil.getObjectName(this.objectName);
         verifyObjectName(myObjectName);
 
         // build the base name used to query the server for child modules
@@ -51,6 +53,22 @@
         this.deploymentDescriptor = deploymentDescriptor;
     }
 
+    public String getObjectName() {
+        return objectName;
+    }
+
+    public boolean isStateManageable() {
+        return true;
+    }
+
+    public boolean isStatisticsProvider() {
+        return false;
+    }
+
+    public boolean isEventProvider() {
+        return true;
+    }
+
     /**
      * ObjectName must match this pattern:
      * <p/>
@@ -75,7 +93,7 @@
         }
     }
 
-    public String[] getmodules() throws MalformedObjectNameException {
+    public String[] getModules() {
         return Util.getObjectNames(kernel,
                 baseName,
                 new String[]{"AppClientModule", "EJBModule", "WebModule", "ResourceAdapterModule"});

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEDomainImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEDomainImpl.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEDomainImpl.java (original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEDomainImpl.java Sun May  8 12:35:23 2005
@@ -18,7 +18,6 @@
 package org.apache.geronimo.j2ee.management.impl;
 
 import java.util.Hashtable;
-import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 
 import org.apache.geronimo.gbean.GBeanInfo;
@@ -26,22 +25,41 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.management.J2EEDomain;
 
 /**
  * @version $Rev$ $Date$
  */
-public class J2EEDomainImpl {
+public class J2EEDomainImpl implements J2EEDomain {
     private final Kernel kernel;
     private final String baseName;
+    private final String objectName;
 
     public J2EEDomainImpl(Kernel kernel, String objectName) {
-        ObjectName myObjectName = JMXUtil.getObjectName(objectName);
+        this.objectName = objectName;
+        ObjectName myObjectName = JMXUtil.getObjectName(this.objectName);
         verifyObjectName(myObjectName);
         baseName = myObjectName.getDomain() + ":";
 
         this.kernel = kernel;
     }
 
+    public String getObjectName() {
+        return objectName;
+    }
+
+    public boolean isStateManageable() {
+        return true;
+    }
+
+    public boolean isStatisticsProvider() {
+        return false;
+    }
+
+    public boolean isEventProvider() {
+        return true;
+    }
+
     /**
      * ObjectName must match this pattern:
      * <p/>
@@ -62,7 +80,7 @@
     }
 
 
-    public String[] getservers() throws MalformedObjectNameException {
+    public String[] getServers() {
         return Util.getObjectNames(kernel, baseName, new String[]{"J2EEServer"});
     }
 

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java (original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java Sun May  8 12:35:23 2005
@@ -18,7 +18,6 @@
 package org.apache.geronimo.j2ee.management.impl;
 
 import java.util.Hashtable;
-import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 
 import org.apache.geronimo.gbean.GBeanInfo;
@@ -27,18 +26,21 @@
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.management.J2EEServer;
 
 /**
  * @version $Rev$ $Date$
  */
-public class J2EEServerImpl {
+public class J2EEServerImpl implements J2EEServer {
     private static final String SERVER_VENDOR = "The Apache Software Foundation";
     private final Kernel kernel;
     private final String baseName;
     private final ServerInfo serverInfo;
+    private final String objectName;
 
     public J2EEServerImpl(Kernel kernel, String objectName, ServerInfo serverInfo) {
-        ObjectName myObjectName = JMXUtil.getObjectName(objectName);
+        this.objectName = objectName;
+        ObjectName myObjectName = JMXUtil.getObjectName(this.objectName);
         verifyObjectName(myObjectName);
 
         // build the base name used to query the server for child modules
@@ -50,6 +52,22 @@
         this.serverInfo = serverInfo;
     }
 
+    public String getObjectName() {
+        return objectName;
+    }
+
+    public boolean isStateManageable() {
+        return true;
+    }
+
+    public boolean isStatisticsProvider() {
+        return false;
+    }
+
+    public boolean isEventProvider() {
+        return true;
+    }
+
     /**
      * ObjectName must match this pattern:
      * <p/>
@@ -72,27 +90,27 @@
     }
 
 
-    public String[] getdeployedObjects() throws MalformedObjectNameException {
+    public String[] getDeployedObjects() {
         return Util.getObjectNames(kernel,
                 baseName,
                 new String[]{"J2EEApplication", "AppClientModule", "EJBModule", "WebModule", "ResourceAdapterModule"});
     }
 
-    public String[] getresources() throws MalformedObjectNameException {
+    public String[] getResources() {
         return Util.getObjectNames(kernel,
                 baseName,
                 new String[]{"JavaMailResource", "JCAConnectionFactory", "JDBCResource", "JDBCDriver", "JMSResource", "JNDIResource", "JTAResource", "RMI_IIOPResource", "URLResource"});
     }
 
-    public String[] getjavaVMs() throws MalformedObjectNameException {
+    public String[] getJavaVMs() {
         return Util.getObjectNames(kernel, baseName, new String[]{"JVM"});
     }
 
-    public String getserverVendor() {
+    public String getServerVendor() {
         return SERVER_VENDOR;
     }
 
-    public String getserverVersion() {
+    public String getServerVersion() {
         return serverInfo.getVersion();
     }
 

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java (original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java Sun May  8 12:35:23 2005
@@ -23,13 +23,14 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.management.geronimo.JVM;
 
 /**
  *
  *
  * @version $Rev$ $Date$
  */
-public class JVMImpl {
+public class JVMImpl implements JVM {
     public static final String JAVA_VERSION = System.getProperty("java.version");
     public static final String JAVA_VENDOR = System.getProperty("java.vendor");
     public static final String NODE;
@@ -45,13 +46,35 @@
         NODE = node;
     }
 
+    private final String objectName;
+
+    public JVMImpl(String objectName) {
+        this.objectName = objectName;
+    }
+
+    public String getObjectName() {
+        return objectName;
+    }
+
+    public boolean isStateManageable() {
+        return true;
+    }
+
+    public boolean isStatisticsProvider() {
+        return false;
+    }
+
+    public boolean isEventProvider() {
+        return true;
+    }
+
     /**
      * The version of the JVMImpl we are running on.
      * This is the value of java.version system property
      * @see "JSR77.3.4.1.1"
      * @return the JVMImpl version
      */
-    public String getjavaVersion() {
+    public String getJavaVersion() {
         return JAVA_VERSION;
     }
 
@@ -61,7 +84,7 @@
      * @see "JSR77.3.4.1.2"
      * @return the JVMImpl version
      */
-    public String getjavaVendor() {
+    public String getJavaVendor() {
         return JAVA_VENDOR;
     }
 
@@ -72,23 +95,23 @@
      * @see "JSR77.3.4.1.3"
      * @return the node we are running on
      */
-    public String getnode() {
+    public String getNode() {
         return NODE;
     }
 
-    public long getfreeMemory() {
+    public long getFreeMemory() {
         return runtime.freeMemory();
     }
 
-    public long getmaxMemory() {
+    public long getMaxMemory() {
         return runtime.maxMemory();
     }
 
-    public long gettotalMemory() {
+    public long getTotalMemory() {
         return runtime.totalMemory();
     }
 
-    public int getavailableProcessors() {
+    public int getAvailableProcessors() {
         return runtime.availableProcessors();
     }
 
@@ -97,6 +120,7 @@
     static {
         GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(JVMImpl.class, NameFactory.JVM);
 
+        infoFactory.addAttribute("objectName", String.class, false);
         infoFactory.addAttribute("javaVersion", String.class, false);
         infoFactory.addAttribute("javaVendor", String.class, false);
         infoFactory.addAttribute("node", String.class, false);
@@ -104,7 +128,7 @@
         infoFactory.addAttribute("maxMemory", Long.TYPE, false);
         infoFactory.addAttribute("totalMemory", Long.TYPE, false);
         infoFactory.addAttribute("availableProcessors", Integer.TYPE, false);
-
+        infoFactory.setConstructor(new String[] {"objectName"});
         GBEAN_INFO = infoFactory.getBeanInfo();
     }
 

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/Util.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/Util.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/Util.java (original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/Util.java Sun May  8 12:35:23 2005
@@ -47,11 +47,16 @@
         return names;
     }
 
-    public static String[] getObjectNames(Kernel kernel, Object parentName, String[] j2eeTypes) throws MalformedObjectNameException {
+    public static String[] getObjectNames(Kernel kernel, Object parentName, String[] j2eeTypes) {
         List objectNames = new LinkedList();
         for (int i = 0; i < j2eeTypes.length; i++) {
             String j2eeType = j2eeTypes[i];
-            objectNames.addAll(kernel.listGBeans(new ObjectName(parentName + "j2eeType=" + j2eeType + ",*")));
+            String name = parentName + "j2eeType=" + j2eeType + ",*";
+            try {
+                objectNames.addAll(kernel.listGBeans(new ObjectName(name)));
+            } catch (MalformedObjectNameException e) {
+                throw new IllegalArgumentException("Malformed ObjectName: " + name);
+            }
         }
         String[] names = new String[objectNames.size()];
         Iterator iterator = objectNames.iterator();

Modified: geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/Abstract77Test.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/Abstract77Test.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/Abstract77Test.java (original)
+++ geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/Abstract77Test.java Sun May  8 12:35:23 2005
@@ -27,6 +27,7 @@
 import org.apache.geronimo.j2ee.management.impl.J2EEDomainImpl;
 import org.apache.geronimo.j2ee.management.impl.J2EEServerImpl;
 import org.apache.geronimo.j2ee.management.impl.JVMImpl;
+import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
@@ -46,7 +47,7 @@
 
     protected void setUp() throws Exception {
         super.setUp();
-        kernel = new Kernel(DOMAIN);
+        kernel = KernelFactory.newInstance().createKernel(DOMAIN);
         kernel.boot();
 
         ClassLoader classLoader = getClass().getClassLoader();

Modified: geronimo/trunk/modules/jetty-builder/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/project.xml?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/project.xml (original)
+++ geronimo/trunk/modules/jetty-builder/project.xml Sun May  8 12:35:23 2005
@@ -282,7 +282,7 @@
 
         <dependency>
             <groupId>cglib</groupId>
-            <artifactId>cglib-full</artifactId>
+            <artifactId>cglib-nodep</artifactId>
             <version>${cglib_version}</version>
             <url>http://cglib.sf.net/</url>
         </dependency>

Modified: geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java (original)
+++ geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java Sun May  8 12:35:23 2005
@@ -344,7 +344,7 @@
         // web application do not add anything to the shared context
     }
 
-    public String addGBeans(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
+    public void addGBeans(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
         J2eeContext earJ2eeContext = earContext.getJ2eeContext();
         J2eeContext moduleJ2eeContext = J2eeContextImpl.newModuleContextFromApplication(earJ2eeContext, NameFactory.WEB_MODULE, module.getName());
         WebModule webModule = (WebModule) module;
@@ -736,7 +736,6 @@
         } catch (Exception e) {
             throw new DeploymentException("Unable to initialize webapp GBean", e);
         }
-        return null;
     }
 
     private ClassLoader getWebClassLoader(EARContext earContext, WebModule webModule, ClassLoader cl, boolean contextPriorityClassLoader) throws DeploymentException {

Modified: geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java (original)
+++ geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java Sun May  8 12:35:23 2005
@@ -55,20 +55,22 @@
 import org.apache.geronimo.j2ee.management.impl.J2EEServerImpl;
 import org.apache.geronimo.jetty.JettyContainerImpl;
 import org.apache.geronimo.jetty.connector.HTTPConnector;
+import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.ConfigurationManagerImpl;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
+import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.management.State;
-import org.apache.geronimo.kernel.registry.BasicGBeanRegistry;
 import org.apache.geronimo.security.SecurityServiceImpl;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
 import org.apache.geronimo.transaction.context.TransactionContextManager;
 import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
-import org.apache.geronimo.xbeans.j2ee.ServiceRefHandlerType;
 
 /**
  * @version $Rev$ $Date$
@@ -117,18 +119,18 @@
         kernel.loadGBean(configData, cl);
 
         kernel.startRecursiveGBean(configData.getName());
-        if (((Integer) kernel.getAttribute(configData.getName(), "state")).intValue() != State.RUNNING_INDEX) {
+        if (kernel.getGBeanState(configData.getName()) != State.RUNNING_INDEX) {
             fail("gbean not started: " + configData.getName());
         }
-        assertEquals(new Integer(State.RUNNING_INDEX), kernel.getAttribute(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,j2eeType=WebModule,name=war4"), "state"));
+        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,j2eeType=WebModule,name=war4")));
         Set names = kernel.listGBeans(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,WebModule=war4,*"));
         System.out.println("Object names: " + names);
         for (Iterator iterator = names.iterator(); iterator.hasNext();) {
             ObjectName objectName = (ObjectName) iterator.next();
-            assertEquals(new Integer(State.RUNNING_INDEX), kernel.getAttribute(objectName, "state"));
+            assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(objectName));
         }
         GBeanData filterMapping2Data = kernel.getGBeanData(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,Servlet=Servlet1,WebFilter=Filter2,WebModule=war4,j2eeType=WebFilterMapping"));
-        assertEquals(Collections.singleton(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,Servlet=Servlet1,WebFilter=Filter1,WebModule=war4,j2eeType=WebFilterMapping")), filterMapping2Data.getReferencePatterns("Previous"));
+//        assertEquals(Collections.singleton(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,Servlet=Servlet1,WebFilter=Filter1,WebModule=war4,j2eeType=WebFilterMapping")), filterMapping2Data.getReferencePatterns("Previous"));
 
         kernel.stopGBean(configData.getName());
         kernel.unloadGBean(configData.getName());
@@ -229,16 +231,22 @@
         tcmName = NameFactory.getComponentName(null, null, null, null, null, "TransactionContextManager", NameFactory.JTA_RESOURCE, moduleContext);
         ctcName = new ObjectName("geronimo.test:role=ConnectionTrackingCoordinator");
 
-        kernel = new Kernel("foo", new BasicGBeanRegistry());
+        kernel = KernelFactory.newInstance().createKernel("foo");
         kernel.boot();
 
         GBeanData store = new GBeanData(JMXUtil.getObjectName("foo:j2eeType=ConfigurationStore,name=mock"), MockConfigStore.GBEAN_INFO);
         kernel.loadGBean(store, this.getClass().getClassLoader());
         kernel.startGBean(store.getName());
 
-        GBeanData baseConfig = (GBeanData) kernel.invoke(store.getName(), "getConfiguration", new Object[]{parentId}, new String[]{URI.class.getName()});
-        kernel.loadGBean(baseConfig, this.getClass().getClassLoader());
-        kernel.startGBean(baseConfig.getName());
+        ObjectName configurationManagerName = new ObjectName(":j2eeType=ConfigurationManager,name=Basic");
+        GBeanData configurationManagerData = new GBeanData(configurationManagerName, ConfigurationManagerImpl.GBEAN_INFO);
+        configurationManagerData.setReferencePatterns("Stores", Collections.singleton(store.getName()));
+        kernel.loadGBean(configurationManagerData, getClass().getClassLoader());
+        kernel.startGBean(configurationManagerName);
+        ConfigurationManager configurationManager = (ConfigurationManager) kernel.getProxyManager().createProxy(configurationManagerName, ConfigurationManager.class);
+
+        ObjectName baseConfigName = configurationManager.load(parentId);
+        kernel.startGBean(baseConfigName);
 
         ObjectName defaultServlets = ObjectName.getInstance("test:name=test,type=none,*");
         ObjectName pojoWebServiceTemplate = null;
@@ -297,7 +305,7 @@
     private void start(GBeanData gbeanData) throws Exception {
         kernel.loadGBean(gbeanData, cl);
         kernel.startGBean(gbeanData.getName());
-        if (((Integer) kernel.getAttribute(gbeanData.getName(), "state")).intValue() != State.RUNNING_INDEX) {
+        if (kernel.getGBeanState(gbeanData.getName()) != State.RUNNING_INDEX) {
             fail("gbean not started: " + gbeanData.getName());
         }
     }
@@ -308,42 +316,50 @@
     }
 
     public static class MockConfigStore implements ConfigurationStore {
-        public URI install(URL source) throws IOException, InvalidConfigException {
-            return null;
+        private final Kernel kernel;
+
+        public MockConfigStore(Kernel kernel) {
+            this.kernel = kernel;
         }
 
-        public URI install(File source) throws IOException, InvalidConfigException {
+        public URI install(URL source) throws IOException, InvalidConfigException {
             return null;
         }
 
-        public void uninstall(URI configID) throws NoSuchConfigException, IOException {
-
+        public void install(ConfigurationData configurationData, File source) throws IOException, InvalidConfigException {
         }
 
-        public boolean containsConfiguration(URI configID) {
-            return true;
+        public void uninstall(URI configID) throws NoSuchConfigException, IOException {
         }
 
-        public GBeanData getConfiguration(URI id) throws NoSuchConfigException, IOException, InvalidConfigException {
-            GBeanData configData = null;
+        public ObjectName loadConfiguration(URI configId) throws NoSuchConfigException, IOException, InvalidConfigException {
+            ObjectName configurationObjectName = null;
             try {
-                configData = new GBeanData(Configuration.getConfigurationObjectName(id), Configuration.GBEAN_INFO);
+                configurationObjectName = Configuration.getConfigurationObjectName(configId);
             } catch (MalformedObjectNameException e) {
                 throw new InvalidConfigException(e);
             }
-            configData.setAttribute("ID", id);
+            GBeanData configData = new GBeanData(configurationObjectName, Configuration.GBEAN_INFO);
+            configData.setAttribute("id", configId);
             configData.setAttribute("domain", "test");
             configData.setAttribute("server", "bar");
             configData.setAttribute("gBeanState", NO_OBJECTS_OS);
-            return configData;
-        }
 
-        public void updateConfiguration(Configuration configuration) throws NoSuchConfigException, Exception {
+            try {
+                kernel.loadGBean(configData, Configuration.class.getClassLoader());
+            } catch (Exception e) {
+                throw new InvalidConfigException("Unable to register configuration", e);
+            }
 
+            return configurationObjectName;
         }
 
-        public URL getBaseURL(URI id) throws NoSuchConfigException {
-            return null;
+        public boolean containsConfiguration(URI configID) {
+            return true;
+        }
+
+        public void updateConfiguration(ConfigurationData configurationData) throws NoSuchConfigException, Exception {
+
         }
 
         public String getObjectName() {
@@ -365,6 +381,8 @@
         static {
             GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(MockConfigStore.class, NameFactory.CONFIGURATION_STORE);
             infoBuilder.addInterface(ConfigurationStore.class);
+            infoBuilder.addAttribute("kernel", Kernel.class, false);
+            infoBuilder.setConstructor(new String[] {"kernel"});
             GBEAN_INFO = infoBuilder.getBeanInfo();
 
             ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -376,7 +394,5 @@
                 throw new RuntimeException(e);
             }
         }
-    };
-
-
+    }
 }

Modified: geronimo/trunk/modules/jetty/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/project.xml?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty/project.xml (original)
+++ geronimo/trunk/modules/jetty/project.xml Sun May  8 12:35:23 2005
@@ -154,7 +154,7 @@
 
         <dependency>
             <groupId>cglib</groupId>
-            <artifactId>cglib-full</artifactId>
+            <artifactId>cglib-nodep</artifactId>
             <version>${cglib_version}</version>
             <url>http://cglib.sf.net/</url>
         </dependency>

Modified: geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java (original)
+++ geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java Sun May  8 12:35:23 2005
@@ -34,13 +34,13 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.jetty.connector.HTTPConnector;
+import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.security.SecurityServiceImpl;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
 import org.apache.geronimo.security.jacc.ApplicationPolicyConfigurationManager;
 import org.apache.geronimo.security.deploy.Principal;
-import org.apache.geronimo.security.deploy.Security;
 import org.apache.geronimo.security.deploy.DefaultPrincipal;
 import org.apache.geronimo.security.jaas.GeronimoLoginConfiguration;
 import org.apache.geronimo.security.jaas.JaasLoginService;
@@ -246,7 +246,7 @@
     private void start(GBeanData gbeanData) throws Exception {
         kernel.loadGBean(gbeanData, cl);
         kernel.startGBean(gbeanData.getName());
-        if (((Integer) kernel.getAttribute(gbeanData.getName(), "state")).intValue() != State.RUNNING_INDEX) {
+        if (kernel.getGBeanState(gbeanData.getName()) != State.RUNNING_INDEX) {
             fail("gbean not started: " + gbeanData.getName());
         }
     }
@@ -266,7 +266,7 @@
         tcmName = NameFactory.getComponentName(null, null, null, null, null, "TransactionContextManager", NameFactory.JTA_RESOURCE, moduleContext);
         ctcName = new ObjectName("geronimo.test:role=ConnectionTrackingCoordinator");
 
-        kernel = new Kernel("test.kernel");
+        kernel = KernelFactory.newInstance().createKernel("test.kernel");
         kernel.boot();
         container = new GBeanData(containerName, JettyContainerImpl.GBEAN_INFO);
 

Modified: geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/ContainerTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/ContainerTest.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/ContainerTest.java (original)
+++ geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/ContainerTest.java Sun May  8 12:35:23 2005
@@ -29,9 +29,9 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.jetty.connector.HTTPConnector;
 import org.apache.geronimo.jetty.app.MockWebServiceContainer;
+import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.management.State;
-import org.apache.geronimo.kernel.registry.BasicGBeanRegistry;
 import org.apache.geronimo.webservices.WebServiceContainer;
 
 /**
@@ -46,7 +46,7 @@
     private ObjectName connectorName;
 
     public void testServer() throws Exception {
-        assertEquals(new Integer(State.RUNNING_INDEX), kernel.getAttribute(containerName, "state"));
+        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(containerName));
     }
 
     public void testHTTPConnector() throws Exception {
@@ -55,7 +55,7 @@
         connector.setReferencePatterns("JettyContainer", containerPatterns);
         start(connector);
 
-        assertEquals(new Integer(State.RUNNING_INDEX), kernel.getAttribute(connectorName, "state"));
+        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(connectorName));
 
         HttpURLConnection connection = (HttpURLConnection) new URL("http://localhost:5678").openConnection();
         try {
@@ -75,7 +75,7 @@
         connector.setReferencePatterns("JettyContainer", containerPatterns);
         start(connector);
 
-        assertEquals(new Integer(State.RUNNING_INDEX), kernel.getAttribute(connectorName, "state"));
+        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(connectorName));
 
         String contextPath = "/foo/webservice.ws";
         MockWebServiceContainer webServiceInvoker = new MockWebServiceContainer();
@@ -117,7 +117,7 @@
         containerPatterns = new HashSet();
         containerPatterns.add(containerName);
         connectorName = new ObjectName("geronimo.jetty:role=Connector");
-        kernel = new Kernel("test.kernel", new BasicGBeanRegistry());
+        kernel = KernelFactory.newInstance().createKernel("test.kernel");
         kernel.boot();
         container = new GBeanData(containerName, JettyContainerImpl.GBEAN_INFO);
         start(container);

Modified: geronimo/trunk/modules/jmx-remoting/src/java/org/apache/geronimo/jmxremoting/JMXConnector.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jmx-remoting/src/java/org/apache/geronimo/jmxremoting/JMXConnector.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/jmx-remoting/src/java/org/apache/geronimo/jmxremoting/JMXConnector.java (original)
+++ geronimo/trunk/modules/jmx-remoting/src/java/org/apache/geronimo/jmxremoting/JMXConnector.java Sun May  8 12:35:23 2005
@@ -86,7 +86,7 @@
      *
      * @return the JMX URL for this connector
      */
-    public String getURL() {
+    public String getUrl() {
         return url;
     }
 
@@ -95,7 +95,7 @@
      *
      * @param url the JMX URL for this connector
      */
-    public void setURL(String url) {
+    public void setUrl(String url) {
         this.url = url;
     }
 
@@ -132,7 +132,7 @@
 
     static {
         GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(JMXConnector.class); //TODO just  a gbean?
-        infoFactory.addAttribute("URL", String.class, true);
+        infoFactory.addAttribute("url", String.class, true);
         infoFactory.addAttribute("applicationConfigName", String.class, true);
         infoFactory.addAttribute("kernel", Kernel.class, false);
         infoFactory.addAttribute("objectName", String.class, false);

Modified: geronimo/trunk/modules/kernel/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/project.xml?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/project.xml (original)
+++ geronimo/trunk/modules/kernel/project.xml Sun May  8 12:35:23 2005
@@ -58,7 +58,7 @@
 
         <dependency>
             <groupId>cglib</groupId>
-            <artifactId>cglib-full</artifactId>
+            <artifactId>cglib-nodep</artifactId>
             <version>${cglib_version}</version>
             <url>http://cglib.sf.net/</url>
         </dependency>

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/AbstractGBeanReference.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/AbstractGBeanReference.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/AbstractGBeanReference.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/AbstractGBeanReference.java Sun May  8 12:35:23 2005
@@ -27,11 +27,9 @@
 import org.apache.geronimo.gbean.GReferenceInfo;
 import org.apache.geronimo.gbean.InvalidConfigurationException;
 import org.apache.geronimo.kernel.ClassLoading;
+import org.apache.geronimo.kernel.DependencyManager;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.NoSuchAttributeException;
-import org.apache.geronimo.kernel.DependencyManager;
-import org.apache.geronimo.kernel.lifecycle.LifecycleAdapter;
 import org.apache.geronimo.kernel.lifecycle.LifecycleListener;
 import org.apache.geronimo.kernel.management.State;
 
@@ -267,11 +265,8 @@
      */
     private boolean isRunning(Kernel kernel, ObjectName objectName) {
         try {
-            final int state = ((Integer) kernel.getAttribute(objectName, "state")).intValue();
+            final int state = kernel.getGBeanState(objectName);
             return state == State.RUNNING_INDEX;
-        } catch (NoSuchAttributeException e) {
-            // ok -- mbean is not a startable
-            return true;
         } catch (GBeanNotFoundException e) {
             // mbean is no longer registerd
             return false;

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanCollectionReference.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanCollectionReference.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanCollectionReference.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanCollectionReference.java Sun May  8 12:35:23 2005
@@ -21,8 +21,8 @@
 
 import org.apache.geronimo.gbean.GReferenceInfo;
 import org.apache.geronimo.gbean.InvalidConfigurationException;
-import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.DependencyManager;
+import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.lifecycle.LifecycleAdapter;
 import org.apache.geronimo.kernel.lifecycle.LifecycleListener;
 

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java?rev=169154&r1=169153&r2=169154&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java Sun May  8 12:35:23 2005
@@ -42,10 +42,10 @@
 import org.apache.geronimo.gbean.GReferenceInfo;
 import org.apache.geronimo.gbean.InvalidConfigurationException;
 import org.apache.geronimo.kernel.DependencyManager;
-import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.NoSuchAttributeException;
 import org.apache.geronimo.kernel.NoSuchOperationException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.management.EventProvider;
 import org.apache.geronimo.kernel.management.ManagedObject;
 import org.apache.geronimo.kernel.management.NotificationType;



Mime
View raw message