geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r418888 [3/7] - in /geronimo/branches/pluggable-jacc: ./ applications/console/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/ configs/ configs/activemq/ configs/client-deployer/src/plan/ configs/client/ configs/...
Date Tue, 04 Jul 2006 00:50:47 GMT
Added: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StartServerMojo.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StartServerMojo.java?rev=418888&view=auto
==============================================================================
--- geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StartServerMojo.java (added)
+++ geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StartServerMojo.java Mon Jul  3 17:50:41 2006
@@ -0,0 +1,190 @@
+/**
+ *
+ * Copyright 2004-2006 The Apache Software Foundation
+ *
+ *  Licensed 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.plugins.deployment;
+
+import java.io.File;
+import java.io.ObjectInputStream;
+import java.io.PrintStream;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import javax.management.ObjectName;
+
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.KernelFactory;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.config.ConfigurationManager;
+import org.apache.geronimo.kernel.config.ConfigurationUtil;
+import org.apache.geronimo.kernel.config.ManageableAttributeStore;
+import org.apache.geronimo.kernel.log.GeronimoLogging;
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * This starts a geronimo server in vm.  It might not have ever been used.
+ *
+ * @goal startServer
+ * 
+ * @version $Rev:$ $Date:$
+ *  
+ */
+public class StartServerMojo extends AbstractModuleMojo {
+
+    static {
+        // This MUST be done before the first log is acquired
+        GeronimoLogging.initialize(GeronimoLogging.INFO);
+    }
+
+    /**
+     * @parameter
+     */
+    private String geronimoHome;
+
+    /**
+     * @parameter
+     */
+    private String kernelName;
+
+    /**
+     * @parameter
+     */
+    private String domainName;
+
+    /**
+     * @parameter
+     */
+    private String[] configs;
+
+    private PrintStream logStream = System.out;
+
+    private PrintStream resultStream;
+
+    private final String goalName = "Start Server";
+
+    public void execute() throws MojoExecutionException {
+        resultStream = getResultsStream();
+        logStream = getLogStream(goalName);
+
+        try {
+            startServer();
+        }
+        catch (Exception e) {
+            logResults(resultStream, goalName, "fail");
+            handleError(e, logStream);
+            return;
+        }
+        logResults(resultStream, goalName, "success");
+    }
+
+    /**
+     * @throws MojoExecutionException
+     */
+    private void startServer() throws Exception {
+        System.setProperty("org.apache.geronimo.base.dir", this.geronimoHome);
+        List configList = new ArrayList();
+        if (this.configs != null && this.configs.length > 0) {
+            for (int i=0; i < this.configs.length; i++) {
+                try {
+                    configList.add(new URI(this.configs[i]));
+                }
+                catch (Exception e) {
+                    throw e;
+                }
+            }
+        }
+        File root = new File(this.geronimoHome);
+        if (!root.exists())
+            throw new Exception(root.getAbsolutePath() + " does not exist");
+
+        URL systemURL = null;
+        URL configURL = null;
+        try {
+            systemURL = new File(root, "bin/server.jar").toURL();
+            configURL = new URL("jar:" + systemURL.toString() + "!/META-INF/config.ser");
+        }
+        catch (Exception e) {
+            throw e;
+        }
+        GBeanData configuration = new GBeanData();
+        ObjectInputStream ois = null;
+        try {
+            ois = new ObjectInputStream(configURL.openStream());
+            configuration.readExternal(ois);
+        }
+        catch (Exception e) {
+            throw e;
+        }
+        finally {
+            try {
+                ois.close();
+            }
+            catch (Exception e1) {
+                throw e1;
+            }
+        }
+        URI configurationId = (URI) configuration.getAttribute("id");
+        ObjectName configName = null;
+        try {
+            configName = Configuration.getConfigurationObjectName(configurationId);
+        }
+        catch (Exception e) {
+            throw e;
+        }
+        configuration.setName(configName);
+        configuration.setAttribute("baseURL", systemURL);
+
+        // build a basic kernel without a configuration-store, our configuration
+        // store is
+        Kernel kernel = KernelFactory.newInstance().createKernel(this.kernelName);
+        try {
+            kernel.boot();
+            kernel.loadGBean(configuration, this.getClass().getClassLoader());
+            kernel.startGBean(configName);
+            kernel.invoke(configName, "loadGBeans", new Object[] { null}, new String[] { ManageableAttributeStore.class.getName()});
+            kernel.invoke(configName, "startRecursiveGBeans");
+        }
+        catch (Exception e) {
+            throw e;
+        }
+
+        // load the rest of the configuration listed on the command line
+        ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
+        try {
+            for (Iterator i = configList.iterator(); i.hasNext();) {
+                URI configID = (URI) i.next();
+                List list = configurationManager.loadRecursive(configID);
+                for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+                    URI name = (URI) iterator.next();
+                    configurationManager.loadGBeans(name);
+                    configurationManager.start(name);
+                    logStream.println("started gbean: " + name);
+                }
+            }
+        }
+        catch (Exception e) {
+            throw e;
+        }
+        finally {
+            ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
+        }
+    }
+}

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StartServerMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StartServerMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StartServerMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopModuleMojo.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopModuleMojo.java?rev=418888&view=auto
==============================================================================
--- geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopModuleMojo.java (added)
+++ geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopModuleMojo.java Mon Jul  3 17:50:41 2006
@@ -0,0 +1,81 @@
+/**
+ *
+ * Copyright 2004-2006 The Apache Software Foundation
+ *
+ *  Licensed 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.plugins.deployment;
+
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.deploy.spi.Target;
+import javax.enterprise.deploy.spi.TargetModuleID;
+import javax.enterprise.deploy.spi.status.ProgressObject;
+
+import org.apache.geronimo.deployment.plugin.jmx.RemoteDeploymentManager;
+import org.apache.geronimo.plugins.util.DeploymentClient;
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * 
+ * @goal stop
+ * 
+ * @version $Rev:$ $Date:$
+ *  
+ */
+public class StopModuleMojo extends AbstractModuleMojo {
+
+    private PrintStream logStream = System.out;
+
+    private PrintStream resultStream;
+
+    private final String goalName = "Stop Module";
+
+    public void execute() throws MojoExecutionException {
+        resultStream = getResultsStream();
+        logStream = getLogStream(goalName);
+        RemoteDeploymentManager manager;
+        try {
+            manager = (RemoteDeploymentManager) getDeploymentManager();
+            manager.setLogConfiguration(true, true);
+
+            Target[] targets = manager.getTargets();
+            TargetModuleID moduleIds[] = manager.getRunningModules(null, targets);
+            List toStop = new ArrayList(moduleIds.length);
+            for (int i = 0; i < moduleIds.length; i++) {
+                TargetModuleID moduleId = moduleIds[i];
+                if (this.id.equals(moduleId.getModuleID())) {
+                    toStop.add(moduleId);
+                }
+            }
+            if (toStop.size() == 0) {
+                logResults(resultStream, goalName, "fail");
+                handleError(new Exception("Module is not deployed: " + this.id), logStream);
+                return;
+            }
+            moduleIds = (TargetModuleID[]) toStop.toArray(new TargetModuleID[toStop.size()]);
+            ProgressObject progress = manager.stop(moduleIds);            
+            DeploymentClient.waitFor(progress);            
+        }
+        catch (Exception e) {
+            logResults(resultStream, goalName, "fail");
+            handleError(e, logStream);
+            return;
+        }
+        logResults(resultStream, goalName, "success");
+    }
+
+}

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopModuleMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopModuleMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopModuleMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopRemoteServerMojo.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopRemoteServerMojo.java?rev=418888&view=auto
==============================================================================
--- geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopRemoteServerMojo.java (added)
+++ geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopRemoteServerMojo.java Mon Jul  3 17:50:41 2006
@@ -0,0 +1,102 @@
+/**
+ *
+ * Copyright 2004-2006 The Apache Software Foundation
+ *
+ *  Licensed 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.plugins.deployment;
+
+import java.io.PrintStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.management.MBeanServerConnection;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.jmx.KernelDelegate;
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * @goal stopRemoteServer
+ *
+ * @version $Rev:$ $Date:$
+ */
+public class StopRemoteServerMojo extends AbstractModuleMojo {
+
+    
+    private MBeanServerConnection mbServerConnection;
+    private Kernel kernel;
+
+    private PrintStream logStream = System.out;
+    
+    private PrintStream resultStream;
+    
+    private final String goalName = "Stop Remote Server";
+
+    public void execute() throws MojoExecutionException {        
+        resultStream = getResultsStream();        
+        logStream = getLogStream(goalName);
+        
+        try {
+            stopRemoteServer();
+        }
+        catch (Exception e) {
+            logResults(resultStream, goalName, "fail");
+            handleError(e, logStream);
+            return;
+        }
+        logResults(resultStream, goalName, "success"); 
+    }
+
+    /**
+     * 
+     */
+    private void stopRemoteServer() throws Exception {
+        String uri = getUri();        
+        if (!uri.startsWith("jmx")) {            
+                throw new Exception("Bad JMX URI ("+uri+")");            
+        }
+
+        Map environment = new HashMap();
+        String[] credentials = new String[]{getUsername(), getPassword()};
+        environment.put(JMXConnector.CREDENTIALS, credentials);
+
+        JMXServiceURL address = null;
+        JMXConnector jmxConnector;
+        try {
+            address = new JMXServiceURL("service:" + uri);
+        }
+        catch (Exception e) {
+            throw e;            
+        }
+        ClassLoader oldcl = Thread.currentThread().getContextClassLoader();
+        try {
+            Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
+            jmxConnector = JMXConnectorFactory.connect(address, environment);
+            mbServerConnection = jmxConnector.getMBeanServerConnection();
+            kernel = new KernelDelegate(mbServerConnection);
+            kernel.shutdown();
+        }
+        catch (Exception e) {
+            throw e;            
+        } 
+        finally {
+            Thread.currentThread().setContextClassLoader(oldcl);
+        }
+    }
+
+}

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopRemoteServerMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopRemoteServerMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopRemoteServerMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopServerMojo.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopServerMojo.java?rev=418888&view=auto
==============================================================================
--- geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopServerMojo.java (added)
+++ geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopServerMojo.java Mon Jul  3 17:50:41 2006
@@ -0,0 +1,41 @@
+/**
+ *
+ * Copyright 2004-2006 The Apache Software Foundation
+ *
+ *  Licensed 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.plugins.deployment;
+
+import org.apache.geronimo.kernel.KernelRegistry;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * In vm server stop.  May not have been tested.
+
+ * @goal stopServer
+ *
+ * @version $Rev:$ $Date:$
+ *
+ * */
+public class StopServerMojo extends AbstractMojo {
+
+    private String kernelName;
+
+    public void execute() throws MojoExecutionException {
+        Kernel kernel = KernelRegistry.getKernel(this.kernelName);
+        kernel.shutdown();
+    }
+}

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopServerMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopServerMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/StopServerMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/UndeployModuleMojo.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/UndeployModuleMojo.java?rev=418888&view=auto
==============================================================================
--- geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/UndeployModuleMojo.java (added)
+++ geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/UndeployModuleMojo.java Mon Jul  3 17:50:41 2006
@@ -0,0 +1,81 @@
+/**
+ *
+ * Copyright 2004-2006 The Apache Software Foundation
+ *
+ *  Licensed 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.plugins.deployment;
+
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.Target;
+import javax.enterprise.deploy.spi.TargetModuleID;
+import javax.enterprise.deploy.spi.status.ProgressObject;
+
+import org.apache.geronimo.plugins.util.DeploymentClient;
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * 
+ * @goal undeploy
+ *
+ * @version $Rev:$ $Date:$
+ *  
+ */
+public class UndeployModuleMojo extends AbstractModuleMojo {
+
+    private PrintStream logStream = System.out;
+
+    private PrintStream resultStream;
+
+    private final String goalName = "Undeploy Module";
+
+    public void execute() throws MojoExecutionException {
+        resultStream = getResultsStream();
+        logStream = getLogStream(goalName);
+
+        DeploymentManager manager;
+        try {
+            manager = getDeploymentManager();
+
+            Target[] targets = manager.getTargets();
+            TargetModuleID moduleIds[] = manager.getNonRunningModules(null, targets);
+            List toUndeploy = new ArrayList(moduleIds.length);
+            for (int i = 0; i < moduleIds.length; i++) {
+                TargetModuleID moduleId = moduleIds[i];
+                if (this.id.equals(moduleId.getModuleID())) {
+                    toUndeploy.add(moduleId);
+                }
+            }
+            if (toUndeploy.size() == 0) {   
+                logResults(resultStream, goalName, "fail");
+                handleError(new Exception("Module is running or not deployed: " + this.id), logStream);
+                return;
+            }
+            moduleIds = (TargetModuleID[]) toUndeploy.toArray(new TargetModuleID[toUndeploy.size()]);
+            ProgressObject progress = manager.undeploy(moduleIds);
+            DeploymentClient.waitFor(progress);
+        }
+        catch (Exception e) {
+            logResults(resultStream, goalName, "fail");
+            handleError(e, logStream);
+            return;
+        }
+        logResults(resultStream, goalName, "success");
+    }
+
+}

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/UndeployModuleMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/UndeployModuleMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/deployment/UndeployModuleMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/util/DeploymentClient.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/util/DeploymentClient.java?rev=418888&view=auto
==============================================================================
--- geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/util/DeploymentClient.java (added)
+++ geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/util/DeploymentClient.java Mon Jul  3 17:50:41 2006
@@ -0,0 +1,104 @@
+/**
+ *
+ * Copyright 2004-2006 The Apache Software Foundation
+ *
+ *  Licensed 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.plugins.util;
+
+import java.io.IOException;
+import java.net.JarURLConnection;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.StringTokenizer;
+import java.util.jar.Attributes;
+import javax.enterprise.deploy.shared.factories.DeploymentFactoryManager;
+import javax.enterprise.deploy.spi.factories.DeploymentFactory;
+import javax.enterprise.deploy.spi.status.ProgressObject;
+import javax.enterprise.deploy.spi.status.ProgressListener;
+import javax.enterprise.deploy.spi.status.ProgressEvent;
+import javax.enterprise.deploy.spi.status.DeploymentStatus;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class DeploymentClient {
+    private static final DeploymentFactoryManager FACTORY_MANAGER = DeploymentFactoryManager.getInstance();
+
+    private URL provider;
+
+    public URL getProvider() {
+        return provider;
+    }
+
+    public void setProvider(URL provider) {
+        this.provider = provider;
+    }
+
+    public void doIt() throws IOException {
+        registerProvider(provider, null);
+    }
+
+    public static void registerProvider(URL provider, ClassLoader parent) throws IOException {
+        if (parent == null) {
+            parent = Thread.currentThread().getContextClassLoader();
+        }
+        if (parent == null) {
+            parent = DeploymentClient.class.getClassLoader();
+        }
+
+        // read manifest entry from provider
+        URL url = new URL("jar:" + provider.toString() + "!/");
+        JarURLConnection jarConnection = (JarURLConnection) url.openConnection();
+        Attributes attrs = jarConnection.getMainAttributes();
+        String factoryNames = attrs.getValue("J2EE-DeploymentFactory-Implementation-Class");
+        if (factoryNames == null) {
+            throw new IOException("No DeploymentFactory found in jar");
+        }
+
+        // register listed DeploymentFactories
+        ClassLoader cl = new URLClassLoader(new URL[]{provider}, parent);
+        for (StringTokenizer tokenizer = new StringTokenizer(factoryNames); tokenizer.hasMoreTokens();) {
+            String className = tokenizer.nextToken();
+            try {
+                DeploymentFactory factory = (DeploymentFactory) cl.loadClass(className).newInstance();
+                FACTORY_MANAGER.registerDeploymentFactory(factory);
+            } catch (Exception e) {
+                throw (IOException) new IOException("Unable to instantiate DeploymentFactory: " + className).initCause(e);
+            }
+        }
+    }
+
+    public static void waitFor(final ProgressObject progress) throws InterruptedException {
+        ProgressListener listener = new ProgressListener() {
+            public void handleProgressEvent(ProgressEvent event) {
+                DeploymentStatus status = event.getDeploymentStatus();
+                if (status.getMessage() != null) {
+                    System.out.println(status.getMessage());
+                }
+                if (!status.isRunning()) {
+                    synchronized (progress) {
+                        progress.notify();
+                    }
+                }
+            }
+        };
+        progress.addProgressListener(listener);
+        synchronized (progress) {
+            while (progress.getDeploymentStatus().isRunning()) {
+                progress.wait();
+            }
+        }
+    }
+}

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/util/DeploymentClient.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/util/DeploymentClient.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/util/DeploymentClient.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/util/ServerBehavior.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/util/ServerBehavior.java?rev=418888&view=auto
==============================================================================
--- geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/util/ServerBehavior.java (added)
+++ geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/util/ServerBehavior.java Mon Jul  3 17:50:41 2006
@@ -0,0 +1,184 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.plugins.util;
+
+import java.io.PrintStream;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+
+import org.apache.geronimo.gbean.GBeanQuery;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.InternalKernelException;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.NoSuchAttributeException;
+import org.apache.geronimo.kernel.config.PersistentConfigurationList;
+import org.apache.geronimo.kernel.jmx.KernelDelegate;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+
+public class ServerBehavior {
+
+    private int maxTries = 100;
+
+    private int retryIntervalMilliseconds = 1000;
+
+    private String uri = "jmx:rmi://localhost/jndi/rmi:/JMXConnector";
+
+    private String username = "system";
+
+    private String password = "manager";
+
+    private PrintStream logStream = System.out;
+
+    protected final String lineSep = "===========================================";
+
+    /**
+     * @param id
+     *            specify null for default
+     * @param maxTries
+     *            specify -1 for default. default-value=40
+     * @param retryIntervalMilliseconds
+     *            specify -1 for default. default-value=1000
+     */
+    public ServerBehavior(String uri, int maxTries, int retryIntervalMilliseconds) {
+        if (uri != null)
+            this.uri = uri;
+        if (maxTries > -1)
+            this.maxTries = maxTries;
+        if (retryIntervalMilliseconds > -1)
+            this.retryIntervalMilliseconds = retryIntervalMilliseconds;
+    }
+
+    /**
+     *  
+     */
+    public ServerBehavior(String uri) {
+        this(uri, -1, -1);
+    }
+
+    /**
+     *  
+     */
+    public ServerBehavior() {
+        this(null, -1, -1);
+    }
+
+    public boolean isFullyStarted() {
+        Kernel kernel = null;
+
+        if (!uri.startsWith("jmx")) {
+            logStream.println("Bad JMX URI (" + uri + ")");
+            logStream.println(lineSep);
+            return false;
+        }
+
+        // Get the kernel first
+        Map environment = new HashMap();
+        String[] credentials = new String[] { username, password };
+        environment.put(JMXConnector.CREDENTIALS, credentials);
+        ClassLoader oldcl = Thread.currentThread().getContextClassLoader();
+        try {
+            JMXServiceURL address = new JMXServiceURL("service:" + uri);
+            Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
+            for (int tries = maxTries; true; tries--) {
+                try {
+                    JMXConnector jmxConnector = JMXConnectorFactory.connect(address, environment);
+                    MBeanServerConnection mbServerConnection = jmxConnector.getMBeanServerConnection();
+                    kernel = new KernelDelegate(mbServerConnection);
+                    break;
+                }
+                catch (Exception e) {
+                    if (tries == 0) {
+                        e.printStackTrace(logStream);
+                        logStream.println("Could not connect");
+                        logStream.println(lineSep);
+                        return false;
+                    }
+                    Thread.sleep(retryIntervalMilliseconds);
+                }
+            }
+        }
+        catch (Exception e1) {
+            e1.printStackTrace(logStream);
+            logStream.println(lineSep);
+            return false;
+        }
+        finally {
+            Thread.currentThread().setContextClassLoader(oldcl);
+        }
+
+        // Now check to see if all configurations have started
+        Set configLists = kernel.listGBeans(new GBeanQuery(null, PersistentConfigurationList.class.getName()));
+        ObjectName on = null;
+        if (!configLists.isEmpty())
+            on = (ObjectName) configLists.toArray()[0];
+
+        for (int tries = maxTries; tries > 0; tries--) {
+            try {
+                Thread.sleep(retryIntervalMilliseconds);
+                Boolean b = (Boolean) kernel.getAttribute(on, "kernelFullyStarted");
+                //System.out.println("attempt.. " + (maxTries - tries));
+                if (b.booleanValue())
+                    return true;
+            }
+            catch (InternalKernelException e) {
+                //hasn't been loaded yet, keep trying
+            }
+            catch (GBeanNotFoundException e) {
+                //hasn't been loaded yet, keep trying
+            }
+            catch (InterruptedException e) {
+                e.printStackTrace(logStream);
+                logStream.println(lineSep);
+                return false;
+            }
+            catch (NoSuchAttributeException e) {
+                e.printStackTrace(logStream);
+                logStream.println(lineSep);
+                return false;
+            }
+            catch (Exception e) {
+                e.printStackTrace(logStream);
+                logStream.println(lineSep);
+                return false;
+            }
+        }
+        return false;
+    }  
+    
+
+    /**
+     * @param logStream
+     */
+    public void setLogStream(PrintStream logStream) {
+        if (logStream != null)
+            this.logStream = logStream;
+    }
+    
+    public void destroy() {
+        logStream.close();
+    }
+}

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/util/ServerBehavior.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/util/ServerBehavior.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-deployment-plugin/src/main/java/org/apache/geronimo/plugins/util/ServerBehavior.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/ConfigCopier.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/m2-plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/ConfigCopier.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/m2-plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/ConfigCopier.java (original)
+++ geronimo/branches/pluggable-jacc/m2-plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/ConfigCopier.java Mon Jul  3 17:50:41 2006
@@ -34,7 +34,7 @@
 /**
  * Copies all the configurations out of source config store into target config store.
  *
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class ConfigCopier {
 

Modified: geronimo/branches/pluggable-jacc/m2-plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PlanProcessorMojo.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/m2-plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PlanProcessorMojo.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/m2-plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PlanProcessorMojo.java (original)
+++ geronimo/branches/pluggable-jacc/m2-plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PlanProcessorMojo.java Mon Jul  3 17:50:41 2006
@@ -185,6 +185,7 @@
     void mergeEnvironment(XmlCursor xmlCursor, org.apache.geronimo.kernel.repository.Artifact configId, LinkedHashSet dependencies) {
         xmlCursor.toFirstContentToken();
         xmlCursor.toFirstChild();
+        xmlCursor.insertComment("Processed by geronimo m2 packaging plugin");
         QName childName = xmlCursor.getName();
         Environment oldEnvironment;
         if (childName != null && childName.getLocalPart().equals(ENVIRONMENT_LOCAL_NAME)) {

Modified: geronimo/branches/pluggable-jacc/m2-plugins/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/m2-plugins/pom.xml?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/m2-plugins/pom.xml (original)
+++ geronimo/branches/pluggable-jacc/m2-plugins/pom.xml Mon Jul  3 17:50:41 2006
@@ -41,6 +41,8 @@
             </activation>
             <modules>
                 <module>geronimo-packaging-plugin</module>
+                <module>geronimo-deployment-plugin</module>
+                <module>geronimo-assembly-plugin</module>
             </modules>
         </profile>
 

Modified: geronimo/branches/pluggable-jacc/modules/activemq-gbean-management/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/activemq-gbean-management/pom.xml?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/activemq-gbean-management/pom.xml (original)
+++ geronimo/branches/pluggable-jacc/modules/activemq-gbean-management/pom.xml Mon Jul  3 17:50:41 2006
@@ -53,4 +53,10 @@
         </dependency>
 
     </dependencies>
+    <build>
+        <defaultGoal>install</defaultGoal>
+        <sourceDirectory>src/main/java</sourceDirectory>
+        <testSourceDirectory>src/test/java</testSourceDirectory>
+    </build>
+    
 </project>

Modified: geronimo/branches/pluggable-jacc/modules/activemq-gbean/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/activemq-gbean/pom.xml?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/activemq-gbean/pom.xml (original)
+++ geronimo/branches/pluggable-jacc/modules/activemq-gbean/pom.xml Mon Jul  3 17:50:41 2006
@@ -18,9 +18,9 @@
 <!-- $Rev: 411333 $ $Date: 2006-06-02 18:35:57 -0500 (Fri, 02 Jun 2006) $ -->
 
 <project
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xmlns="http://maven.apache.org/POM/4.0.0">
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xmlns="http://maven.apache.org/POM/4.0.0">
 
     <modelVersion>4.0.0</modelVersion>
 
@@ -42,7 +42,7 @@
             <artifactId>activemq-core</artifactId>
             <version>4.0-SNAPSHOT</version>
         </dependency>
-        
+
         <dependency>
             <groupId>incubator-activemq</groupId>
             <artifactId>activeio-core</artifactId>
@@ -81,5 +81,9 @@
         </dependency>
 
     </dependencies>
-
+    <build>
+        <defaultGoal>install</defaultGoal>
+        <sourceDirectory>src/main/java</sourceDirectory>
+        <testSourceDirectory>src/test/java</testSourceDirectory>
+    </build>
 </project>

Modified: geronimo/branches/pluggable-jacc/modules/activemq-gbean/src/test/java/org/apache/activemq/gbean/ConnectorTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/activemq-gbean/src/test/java/org/apache/activemq/gbean/ConnectorTest.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/activemq-gbean/src/test/java/org/apache/activemq/gbean/ConnectorTest.java (original)
+++ geronimo/branches/pluggable-jacc/modules/activemq-gbean/src/test/java/org/apache/activemq/gbean/ConnectorTest.java Mon Jul  3 17:50:41 2006
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.gbean;
 
-import org.apache.activemq.gbean.TransportConnectorGBeanImpl;
-
 import junit.framework.TestCase;
 
 /**

Modified: geronimo/branches/pluggable-jacc/modules/axis-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/axis-builder/pom.xml?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/axis-builder/pom.xml (original)
+++ geronimo/branches/pluggable-jacc/modules/axis-builder/pom.xml Mon Jul  3 17:50:41 2006
@@ -58,7 +58,6 @@
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>xmlbeans-maven-plugin</artifactId>
-                <version>${xmlbeansMavenPluginVersion}</version>
                 <executions>
                     <execution>
                         <goals>

Modified: geronimo/branches/pluggable-jacc/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java (original)
+++ geronimo/branches/pluggable-jacc/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java Mon Jul  3 17:50:41 2006
@@ -33,7 +33,6 @@
 import javax.wsdl.Definition;
 import javax.wsdl.Operation;
 import javax.wsdl.Port;
-import javax.wsdl.extensions.soap.SOAPAddress;
 import javax.xml.namespace.QName;
 import javax.xml.rpc.handler.HandlerInfo;
 import javax.xml.rpc.holders.BigDecimalHolder;
@@ -60,7 +59,6 @@
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.kernel.ClassLoading;
-import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.xbeans.j2ee.ExceptionMappingType;
 import org.apache.geronimo.xbeans.j2ee.JavaWsdlMappingDocument;
 import org.apache.geronimo.xbeans.j2ee.JavaWsdlMappingType;
@@ -75,6 +73,7 @@
 import org.apache.geronimo.xbeans.j2ee.WebservicesDocument;
 import org.apache.geronimo.xbeans.j2ee.WebservicesType;
 import org.apache.geronimo.xbeans.j2ee.XsdQNameType;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.xmlbeans.XmlException;
 
 /**
@@ -374,7 +373,7 @@
     public static Map parseWebServiceDescriptor(URL wsDDUrl, JarFile moduleFile, boolean isEJB, Map servletLocations) throws DeploymentException {
         try {
             WebservicesDocument webservicesDocument = WebservicesDocument.Factory.parse(wsDDUrl);
-            SchemaConversionUtils.validateDD(webservicesDocument);
+            XmlBeansUtil.validateDD(webservicesDocument);
             WebservicesType webservicesType = webservicesDocument.getWebservices();
             return parseWebServiceDescriptor(webservicesType, moduleFile, isEJB, servletLocations);
         } catch (XmlException e) {

Modified: geronimo/branches/pluggable-jacc/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ParsingTest.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ParsingTest.java (original)
+++ geronimo/branches/pluggable-jacc/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ParsingTest.java Mon Jul  3 17:50:41 2006
@@ -32,7 +32,6 @@
 import org.apache.xmlbeans.XmlBeans;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.SchemaTypeLoader;
-import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 
@@ -65,7 +64,7 @@
     }
 
     private Map parse(File schema1) throws IOException, XmlException, DeploymentException, URISyntaxException {
-        XmlObject xmlObject = XmlBeansUtil.parse(schema1.toURL());
+        XmlObject xmlObject = XmlBeansUtil.parse(schema1.toURL(), getClass().getClassLoader());
         Collection errors = new ArrayList();
         XmlOptions xmlOptions = new XmlOptions();
         xmlOptions.setErrorListener(errors);

Modified: geronimo/branches/pluggable-jacc/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java (original)
+++ geronimo/branches/pluggable-jacc/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java Mon Jul  3 17:50:41 2006
@@ -112,11 +112,11 @@
         ArtifactManager artifactManager = new DefaultArtifactManager();
         ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, Collections.EMPTY_SET, null);
         ConfigurationManager configurationManager = new SimpleConfigurationManager(Collections.EMPTY_SET, artifactResolver, Collections.EMPTY_SET);        
-        context = new DeploymentContext(tmpbasedir, null, environment, ConfigurationModuleType.CAR, naming, configurationManager, Collections.EMPTY_SET);
+        AbstractName moduleName = naming.createRootName(configID, "testejb", NameFactory.EJB_MODULE);
+        context = new DeploymentContext(tmpbasedir, null, environment, moduleName, ConfigurationModuleType.CAR, naming, configurationManager, Collections.EMPTY_SET);
 
         File moduleLocation = new File(tmpbasedir, "ejb");
         moduleLocation.mkdirs();
-        AbstractName moduleName = naming.createRootName(configID, "testejb", NameFactory.EJB_MODULE);
         module = new EJBModule(true, moduleName, environment, new UnpackedJarFile(moduleLocation), "ejb", null, null, null);
 
         runExternalWSTest = System.getProperty("geronimo.run.external.webservicetest", "false").equals("true");

Modified: geronimo/branches/pluggable-jacc/modules/axis/src/java/org/apache/geronimo/axis/client/AxisServiceReference.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/axis/src/java/org/apache/geronimo/axis/client/AxisServiceReference.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/axis/src/java/org/apache/geronimo/axis/client/AxisServiceReference.java (original)
+++ geronimo/branches/pluggable-jacc/modules/axis/src/java/org/apache/geronimo/axis/client/AxisServiceReference.java Mon Jul  3 17:50:41 2006
@@ -34,7 +34,7 @@
 import org.apache.geronimo.naming.reference.SimpleReference;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class AxisServiceReference extends SimpleReference implements ClassLoaderAwareReference {
     private static final Class[] SERVICE_CONSTRUCTOR_TYPES = new Class[]{Map.class, Map.class};

Modified: geronimo/branches/pluggable-jacc/modules/axis/src/java/org/apache/geronimo/axis/client/ServiceImpl.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/axis/src/java/org/apache/geronimo/axis/client/ServiceImpl.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/axis/src/java/org/apache/geronimo/axis/client/ServiceImpl.java (original)
+++ geronimo/branches/pluggable-jacc/modules/axis/src/java/org/apache/geronimo/axis/client/ServiceImpl.java Mon Jul  3 17:50:41 2006
@@ -37,7 +37,7 @@
 
 
 /**
- * @version $Revision:$ $Date$
+ * @version $Revision$ $Date$
  */
 public class ServiceImpl implements javax.xml.rpc.Service, Serializable {
     private static final long serialVersionUID = 8657993237680414470L;

Modified: geronimo/branches/pluggable-jacc/modules/client-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/client-builder/pom.xml?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/client-builder/pom.xml (original)
+++ geronimo/branches/pluggable-jacc/modules/client-builder/pom.xml Mon Jul  3 17:50:41 2006
@@ -76,6 +76,10 @@
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-connector-builder</artifactId>
         </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.modules</groupId>
+      <artifactId>geronimo-security-builder</artifactId>
+    </dependency>
 
         <!-- tranql uses 1.0.3 -->
         <dependency>

Modified: geronimo/branches/pluggable-jacc/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java (original)
+++ geronimo/branches/pluggable-jacc/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java Mon Jul  3 17:50:41 2006
@@ -16,6 +16,23 @@
  */
 package org.apache.geronimo.client.builder;
 
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.StringTokenizer;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
+import java.util.zip.ZipEntry;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.client.AppClientContainer;
@@ -23,6 +40,8 @@
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.deployment.ModuleIDBuilder;
+import org.apache.geronimo.deployment.NamespaceDrivenBuilder;
+import org.apache.geronimo.deployment.NamespaceDrivenBuilderCollection;
 import org.apache.geronimo.deployment.service.EnvironmentBuilder;
 import org.apache.geronimo.deployment.service.ServiceConfigBuilder;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
@@ -44,6 +63,7 @@
 import org.apache.geronimo.j2ee.deployment.RefContext;
 import org.apache.geronimo.j2ee.deployment.ResourceReferenceBuilder;
 import org.apache.geronimo.j2ee.deployment.ServiceReferenceBuilder;
+import org.apache.geronimo.j2ee.deployment.SecurityBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.J2EEAppClientModuleImpl;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
@@ -57,7 +77,6 @@
 import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
 import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.security.deploy.DefaultPrincipal;
-import org.apache.geronimo.security.deployment.SecurityBuilder;
 import org.apache.geronimo.xbeans.geronimo.client.GerApplicationClientDocument;
 import org.apache.geronimo.xbeans.geronimo.client.GerApplicationClientType;
 import org.apache.geronimo.xbeans.geronimo.client.GerResourceType;
@@ -69,23 +88,6 @@
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 
-import java.io.File;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-import java.util.zip.ZipEntry;
-
 
 /**
  * @version $Rev:385232 $ $Date$
@@ -104,6 +106,9 @@
     private final SingleElementCollection connectorModuleBuilder;
     private final SingleElementCollection resourceReferenceBuilder;
     private final SingleElementCollection serviceReferenceBuilder;
+    private final SingleElementCollection securityBuilder;
+    private final NamespaceDrivenBuilderCollection serviceBuilder;
+
     private static final String GERAPPCLIENT_NAMESPACE = GerApplicationClientDocument.type.getDocumentElementName().getNamespaceURI();
 
     public AppClientModuleBuilder(Environment defaultClientEnvironment,
@@ -114,7 +119,9 @@
             EJBReferenceBuilder ejbReferenceBuilder,
             ModuleBuilder connectorModuleBuilder,
             ResourceReferenceBuilder resourceReferenceBuilder,
-            ServiceReferenceBuilder serviceReferenceBuilder) {
+            ServiceReferenceBuilder serviceReferenceBuilder,
+            NamespaceDrivenBuilder securityBuilder,
+            NamespaceDrivenBuilder serviceBuilder) {
         this(defaultClientEnvironment,
                 defaultServerEnvironment,
                 transactionContextManagerObjectName,
@@ -123,7 +130,9 @@
                 new SingleElementCollection(ejbReferenceBuilder),
                 new SingleElementCollection(connectorModuleBuilder),
                 new SingleElementCollection(resourceReferenceBuilder),
-                new SingleElementCollection(serviceReferenceBuilder));
+                new SingleElementCollection(serviceReferenceBuilder),
+                new SingleElementCollection(securityBuilder),
+                serviceBuilder == null? Collections.EMPTY_SET: Collections.singleton(serviceBuilder));
     }
 
     public AppClientModuleBuilder(AbstractNameQuery transactionContextManagerObjectName,
@@ -133,9 +142,10 @@
             Collection connectorModuleBuilder,
             Collection resourceReferenceBuilder,
             Collection serviceReferenceBuilder,
+            Collection securityBuilder,
+            Collection serviceBuilder,
             Environment defaultClientEnvironment,
-            Environment defaultServerEnvironment
-    ) {
+            Environment defaultServerEnvironment) {
         this(defaultClientEnvironment,
                 defaultServerEnvironment,
                 transactionContextManagerObjectName,
@@ -144,7 +154,9 @@
                 new SingleElementCollection(ejbReferenceBuilder),
                 new SingleElementCollection(connectorModuleBuilder),
                 new SingleElementCollection(resourceReferenceBuilder),
-                new SingleElementCollection(serviceReferenceBuilder));
+                new SingleElementCollection(serviceReferenceBuilder),
+                new SingleElementCollection(securityBuilder),
+                serviceBuilder);
     }
 
     private AppClientModuleBuilder(Environment defaultClientEnvironment,
@@ -155,7 +167,9 @@
             SingleElementCollection ejbReferenceBuilder,
             SingleElementCollection connectorModuleBuilder,
             SingleElementCollection resourceReferenceBuilder,
-            SingleElementCollection serviceReferenceBuilder) {
+            SingleElementCollection serviceReferenceBuilder,
+            SingleElementCollection securityBuilder,
+            Collection serviceBuilder) {
         this.defaultClientEnvironment = defaultClientEnvironment;
         this.defaultServerEnvironment = defaultServerEnvironment;
         this.corbaGBeanObjectName = corbaGBeanObjectName;
@@ -165,6 +179,8 @@
         this.connectorModuleBuilder = connectorModuleBuilder;
         this.resourceReferenceBuilder = resourceReferenceBuilder;
         this.serviceReferenceBuilder = serviceReferenceBuilder;
+        this.securityBuilder = securityBuilder;
+        this.serviceBuilder = new NamespaceDrivenBuilderCollection(serviceBuilder);
     }
 
     private EJBReferenceBuilder getEjbReferenceBuilder() {
@@ -183,6 +199,10 @@
         return (ServiceReferenceBuilder) serviceReferenceBuilder.getElement();
     }
 
+    private org.apache.geronimo.j2ee.deployment.SecurityBuilder getSecurityBuilder() {
+        return (SecurityBuilder) securityBuilder.getElement();
+    }
+
     public Module createModule(File plan, JarFile moduleFile, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
         return createModule(plan, moduleFile, "app-client", null, null, null, naming, idBuilder);
     }
@@ -271,7 +291,7 @@
                         rawPlan = XmlBeansUtil.parse((File) plan);
                     } else {
                         URL path = DeploymentUtil.createJarURL(moduleFile, "META-INF/geronimo-application-client.xml");
-                        rawPlan = XmlBeansUtil.parse(path);
+                        rawPlan = XmlBeansUtil.parse(path, getClass().getClassLoader());
                     }
                 }
             } catch (IOException e) {
@@ -462,8 +482,7 @@
 
                 // pop in all the gbeans declared in the geronimo app client file
                 if (geronimoAppClient != null) {
-                    GbeanType[] gbeans = geronimoAppClient.getGbeanArray();
-                    ServiceConfigBuilder.addGBeans(gbeans, appClientClassLoader, appClientDeploymentContext.getModuleName(), appClientDeploymentContext);
+                    serviceBuilder.build(geronimoAppClient, appClientDeploymentContext, appClientDeploymentContext);
                     //deploy the resource adapters specified in the geronimo-application.xml
                     Collection resourceModules = new ArrayList();
                     try {
@@ -562,7 +581,7 @@
                         appClientContainerGBeanData.setAttribute("realmName", realmName);
                         appClientContainerGBeanData.setAttribute("callbackHandlerClassName", callbackHandlerClassName);
                     } else if (geronimoAppClient.isSetDefaultPrincipal()) {
-                        DefaultPrincipal defaultPrincipal = SecurityBuilder.buildDefaultPrincipal(geronimoAppClient.getDefaultPrincipal());
+                        DefaultPrincipal defaultPrincipal = getSecurityBuilder().buildDefaultPrincipal(geronimoAppClient.getDefaultPrincipal());
                         appClientContainerGBeanData.setAttribute("defaultPrincipal", defaultPrincipal);
                     }
                     appClientContainerGBeanData.setReferencePattern("JNDIContext", jndiContextName);
@@ -715,6 +734,8 @@
         infoBuilder.addReference("ConnectorModuleBuilder", ModuleBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ResourceReferenceBuilder", ResourceReferenceBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ServiceReferenceBuilder", ServiceReferenceBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addReference("SecurityBuilder", SecurityBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addReference("ServiceBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
 
         infoBuilder.addInterface(ModuleBuilder.class);
 
@@ -725,6 +746,8 @@
                 "ConnectorModuleBuilder",
                 "ResourceReferenceBuilder",
                 "ServiceReferenceBuilder",
+                "SecurityBuilder",
+                "ServiceBuilders",
                 "defaultClientEnvironment",
                 "defaultServerEnvironment",
         });

Modified: geronimo/branches/pluggable-jacc/modules/client-builder/src/schema/geronimo-application-client-1.1.xsd
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/client-builder/src/schema/geronimo-application-client-1.1.xsd?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/client-builder/src/schema/geronimo-application-client-1.1.xsd (original)
+++ geronimo/branches/pluggable-jacc/modules/client-builder/src/schema/geronimo-application-client-1.1.xsd Mon Jul  3 17:50:41 2006
@@ -57,7 +57,7 @@
 
             <xs:element name="resource" type="geronimo:resourceType" minOccurs="0" maxOccurs="unbounded"/>
 
-            <xs:element ref="sys:gbean" minOccurs="0" maxOccurs="unbounded"/>
+            <xs:element ref="sys:service" minOccurs="0" maxOccurs="unbounded"/>
         </xs:sequence>
 
     </xs:complexType>

Modified: geronimo/branches/pluggable-jacc/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java (original)
+++ geronimo/branches/pluggable-jacc/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java Mon Jul  3 17:50:41 2006
@@ -3,13 +3,13 @@
 import java.io.File;
 
 import junit.framework.TestCase;
-import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.xbeans.geronimo.client.GerApplicationClientDocument;
 import org.apache.geronimo.xbeans.geronimo.client.GerApplicationClientType;
 import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.deployment.xbeans.EnvironmentType;
 import org.apache.geronimo.deployment.xbeans.ArtifactType;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 
 /**
  */
@@ -19,7 +19,7 @@
     File basedir = new File(System.getProperty("basedir", "."));
 
     protected void setUp() throws Exception {
-        builder = new AppClientModuleBuilder(new Environment(), null, null, null, null, null, null, null, null);
+        builder = new AppClientModuleBuilder(new Environment(), null, null, null, null, null, null, null, null, null, null);
     }
 
     public void testResourceRef() throws Exception {
@@ -43,7 +43,7 @@
         ref.setRefName("ref");
         ref.setResourceLink("target");
 
-        SchemaConversionUtils.validateDD(appClient);
+        XmlBeansUtil.validateDD(appClient);
 //        System.out.println(appClient.toString());
     }
 

Modified: geronimo/branches/pluggable-jacc/modules/connector-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/connector-builder/pom.xml?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/connector-builder/pom.xml (original)
+++ geronimo/branches/pluggable-jacc/modules/connector-builder/pom.xml Mon Jul  3 17:50:41 2006
@@ -68,7 +68,6 @@
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>xmlbeans-maven-plugin</artifactId>
-                <version>${xmlbeansMavenPluginVersion}</version>
                 <executions>
                     <execution>
                         <goals>

Modified: geronimo/branches/pluggable-jacc/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java (original)
+++ geronimo/branches/pluggable-jacc/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java Mon Jul  3 17:50:41 2006
@@ -35,8 +35,10 @@
 import java.util.Set;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
+
 import javax.naming.Reference;
 import javax.xml.namespace.QName;
+
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.common.UnresolvedReferenceException;
 import org.apache.geronimo.common.propertyeditor.PropertyEditors;
@@ -60,11 +62,11 @@
 import org.apache.geronimo.connector.outbound.connectionmanagerconfig.TransactionSupport;
 import org.apache.geronimo.connector.outbound.connectionmanagerconfig.XATransactions;
 import org.apache.geronimo.deployment.ModuleIDBuilder;
+import org.apache.geronimo.deployment.NamespaceDrivenBuilderCollection;
+import org.apache.geronimo.deployment.NamespaceDrivenBuilder;
 import org.apache.geronimo.deployment.service.EnvironmentBuilder;
-import org.apache.geronimo.deployment.service.ServiceConfigBuilder;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.deployment.xbeans.EnvironmentType;
-import org.apache.geronimo.deployment.xbeans.GbeanType;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
@@ -120,6 +122,8 @@
  * @version $Rev:385659 $ $Date$
  */
 public class ConnectorModuleBuilder implements ModuleBuilder, ResourceReferenceBuilder {
+    private static QName CONNECTOR_QNAME = GerConnectorDocument.type.getDocumentElementName();
+    static final String GERCONNECTOR_NAMESPACE = CONNECTOR_QNAME.getNamespaceURI();
 
     private final int defaultMaxSize;
     private final int defaultMinSize;
@@ -128,8 +132,7 @@
     private final boolean defaultXATransactionCaching;
     private final boolean defaultXAThreadCaching;
     private final Environment defaultEnvironment;
-    private static QName CONNECTOR_QNAME = GerConnectorDocument.type.getDocumentElementName();
-    static final String GERCONNECTOR_NAMESPACE = CONNECTOR_QNAME.getNamespaceURI();
+    private final NamespaceDrivenBuilderCollection serviceBuilders;
 
     public ConnectorModuleBuilder(Environment defaultEnvironment,
             int defaultMaxSize,
@@ -137,7 +140,8 @@
             int defaultBlockingTimeoutMilliseconds,
             int defaultIdleTimeoutMinutes,
             boolean defaultXATransactionCaching,
-            boolean defaultXAThreadCaching) {
+            boolean defaultXAThreadCaching,
+            Collection serviceBuilders) {
         this.defaultEnvironment = defaultEnvironment;
 
         this.defaultMaxSize = defaultMaxSize;
@@ -146,6 +150,7 @@
         this.defaultIdleTimeoutMinutes = defaultIdleTimeoutMinutes;
         this.defaultXATransactionCaching = defaultXATransactionCaching;
         this.defaultXAThreadCaching = defaultXAThreadCaching;
+        this.serviceBuilders = new NamespaceDrivenBuilderCollection(serviceBuilders);
     }
 
     public Module createModule(File plan, JarFile moduleFile, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
@@ -225,7 +230,7 @@
                 cursor.dispose();
             }
 
-            SchemaConversionUtils.validateDD(gerConnector);
+            XmlBeansUtil.validateDD(gerConnector);
         } catch (XmlException e) {
             throw new DeploymentException(e);
         }
@@ -235,8 +240,8 @@
         if (earEnvironment != null) {
             EnvironmentBuilder.mergeEnvironments(earEnvironment, environment);
             environment = earEnvironment;
-            if(!environment.getConfigId().isResolved()) {
-                throw new IllegalStateException("Connector module ID should be fully resolved (not "+environment.getConfigId()+")");
+            if (!environment.getConfigId().isResolved()) {
+                throw new IllegalStateException("Connector module ID should be fully resolved (not " + environment.getConfigId() + ")");
             }
         } else {
             idBuilder.resolve(environment, new File(moduleFile.getName()).getName(), "rar");
@@ -374,8 +379,7 @@
 
         GerConnectorType geronimoConnector = (GerConnectorType) module.getVendorDD();
 
-        GbeanType[] gbeans = geronimoConnector.getGbeanArray();
-        ServiceConfigBuilder.addGBeans(gbeans, cl, resourceAdapterModuleName, earContext);
+        serviceBuilders.build(geronimoConnector, earContext, earContext);
 
         addConnectorGBeans(earContext, jcaResourcejsr77Name, resourceAdapterModuleData, connector, geronimoConnector, cl);
 
@@ -862,6 +866,8 @@
         infoBuilder.addAttribute("defaultXATransactionCaching", boolean.class, true, true);
         infoBuilder.addAttribute("defaultXAThreadCaching", boolean.class, true, true);
 
+        infoBuilder.addReference("ServiceBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
+
         infoBuilder.addInterface(ModuleBuilder.class);
         infoBuilder.addInterface(ResourceReferenceBuilder.class);
 
@@ -871,7 +877,8 @@
                 "defaultBlockingTimeoutMilliseconds",
                 "defaultIdleTimeoutMinutes",
                 "defaultXATransactionCaching",
-                "defaultXAThreadCaching"});
+                "defaultXAThreadCaching",
+                "ServiceBuilders"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 

Modified: geronimo/branches/pluggable-jacc/modules/connector-builder/src/schema/geronimo-connector-1.1.xsd
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/connector-builder/src/schema/geronimo-connector-1.1.xsd?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/connector-builder/src/schema/geronimo-connector-1.1.xsd (original)
+++ geronimo/branches/pluggable-jacc/modules/connector-builder/src/schema/geronimo-connector-1.1.xsd Mon Jul  3 17:50:41 2006
@@ -297,7 +297,7 @@
 
             <xs:element name="adminobject" type="ger:adminobjectType" minOccurs="0" maxOccurs="unbounded"/>
 
-            <xs:element ref="sys:gbean" minOccurs="0" maxOccurs="unbounded"/>
+            <xs:element ref="sys:service" minOccurs="0" maxOccurs="unbounded"/>
         </xs:sequence>
 
     </xs:complexType>

Modified: geronimo/branches/pluggable-jacc/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java (original)
+++ geronimo/branches/pluggable-jacc/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java Mon Jul  3 17:50:41 2006
@@ -33,6 +33,7 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.jar.JarFile;
+
 import javax.naming.Reference;
 import javax.sql.DataSource;
 import javax.xml.namespace.QName;
@@ -41,6 +42,7 @@
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.deployment.ModuleIDBuilder;
+import org.apache.geronimo.deployment.service.GBeanBuilder;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
@@ -162,10 +164,11 @@
         JarFile rarFile = null;
         try {
             rarFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-ear-noger.ear"));
-
+            GBeanBuilder serviceBuilder = new GBeanBuilder(null, null);
+//            EARConfigBuilder configBuilder = new EARConfigBuilder(defaultEnvironment, transactionContextManagerName, connectionTrackerName, null, null, null, new AbstractNameQuery(serverName, J2EEServerImpl.GBEAN_INFO.getInterfaces()), null, null, ejbReferenceBuilder, null,
             EARConfigBuilder configBuilder = new EARConfigBuilder(defaultEnvironment, null, transactionContextManagerName, connectionTrackerName, null, null, null, new AbstractNameQuery(serverName, J2EEServerImpl.GBEAN_INFO.getInterfaces()), null, null, ejbReferenceBuilder, null,
-                    new ConnectorModuleBuilder(defaultEnvironment, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching),
-                    resourceReferenceBuilder, null, serviceReferenceBuilder, kernel.getNaming());
+                    new ConnectorModuleBuilder(defaultEnvironment, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching, Collections.singleton(serviceBuilder)),
+                    resourceReferenceBuilder, null, serviceReferenceBuilder, null, serviceBuilder, kernel.getNaming());
             ConfigurationData configData = null;
             DeploymentContext context = null;
             ArtifactManager artifactManager = new DefaultArtifactManager();
@@ -338,7 +341,7 @@
         String resourceAdapterName = "testRA";
 
         try {
-            ConnectorModuleBuilder moduleBuilder = new ConnectorModuleBuilder(defaultEnvironment, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching);
+            ConnectorModuleBuilder moduleBuilder = new ConnectorModuleBuilder(defaultEnvironment, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching, Collections.singleton(new GBeanBuilder(null, null)));
             File rarFile = action.getRARFile();
 
             ClassLoader oldCl = Thread.currentThread().getContextClassLoader();

Modified: geronimo/branches/pluggable-jacc/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/PlanParsingTest.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/PlanParsingTest.java (original)
+++ geronimo/branches/pluggable-jacc/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/PlanParsingTest.java Mon Jul  3 17:50:41 2006
@@ -11,7 +11,6 @@
 import org.apache.geronimo.xbeans.geronimo.GerConnectorType;
 import org.apache.geronimo.xbeans.j2ee.ConnectorDocument;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
-import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 
@@ -26,10 +25,10 @@
     public void testLoadGeronimoDeploymentDescriptor10() throws Exception {
         URL srcXml = classLoader.getResource("connector_1_0/geronimo-ra.xml");
 //        File geronimoDD = new File(basedir, "src/test-data/connector_1_0/geronimo-ra.xml");
-        XmlObject plan = XmlBeansUtil.parse(srcXml);
+        XmlObject plan = XmlBeansUtil.parse(srcXml, getClass().getClassLoader());
         GerConnectorDocument connectorDocument = (GerConnectorDocument) plan.changeType(GerConnectorDocument.type);
         GerConnectorType connector = (GerConnectorType) SchemaConversionUtils.fixGeronimoSchema(connectorDocument, CONNECTOR_QNAME, GerConnectorType.type);
-        SchemaConversionUtils.validateDD(connector);
+        XmlBeansUtil.validateDD(connector);
         assertEquals(1, connectorDocument.getConnector().getResourceadapterArray().length);
     }
 
@@ -37,17 +36,17 @@
         URL srcXml = classLoader.getResource("connector_1_5/ra.xml");
 //        File j2eeDD = new File(basedir, "src/test-data/connector_1_5/ra.xml");
 //        assertTrue(j2eeDD.exists());
-        XmlObject plan = XmlBeansUtil.parse(srcXml);
+        XmlObject plan = XmlBeansUtil.parse(srcXml, getClass().getClassLoader());
         ConnectorDocument connectorDocument = (ConnectorDocument) plan.changeType(ConnectorDocument.type);
         assertNotNull(connectorDocument.getConnector().getResourceadapter());
-        SchemaConversionUtils.validateDD(connectorDocument);
+        XmlBeansUtil.validateDD(connectorDocument);
     }
 
     public void testLoadGeronimoDeploymentDescriptor15() throws Exception {
         URL srcXml = classLoader.getResource("connector_1_5/geronimo-ra.xml");
 //        File geronimoDD = new File(basedir, "src/test-data/connector_1_5/geronimo-ra.xml");
 //        assertTrue(geronimoDD.exists());
-        XmlObject plan = XmlBeansUtil.parse(srcXml);
+        XmlObject plan = XmlBeansUtil.parse(srcXml, getClass().getClassLoader());
         GerConnectorDocument connectorDocument = (GerConnectorDocument) plan.changeType(GerConnectorDocument.type);
         GerConnectorType connector = (GerConnectorType) SchemaConversionUtils.fixGeronimoSchema(connectorDocument, CONNECTOR_QNAME, GerConnectorType.type);
         assertEquals(1, connector.getResourceadapterArray().length);
@@ -58,13 +57,13 @@
 //        File resourcePlan = new File(basedir, "src/test-data/data/dup-resourceadapter-name.xml");
 //        assertTrue(resourcePlan.exists());
 
-        XmlObject plan = XmlBeansUtil.parse(srcXml);
+        XmlObject plan = XmlBeansUtil.parse(srcXml, getClass().getClassLoader());
         GerConnectorDocument doc = (GerConnectorDocument) plan.changeType(GerConnectorDocument.type);
         if (doc == null) {
             doc = (GerConnectorDocument) plan;
         }
         try {
-            SchemaConversionUtils.validateDD(doc);
+            XmlBeansUtil.validateDD(doc);
             fail("dup resource adapter name is invalid");
         } catch (XmlException e) {
             //expected
@@ -76,13 +75,13 @@
 //        File resourcePlan = new File(basedir, "src/test-data/data/dup-connectionfactoryinstance-name.xml");
 //        assertTrue(resourcePlan.exists());
 
-        XmlObject plan = XmlBeansUtil.parse(srcXml);
+        XmlObject plan = XmlBeansUtil.parse(srcXml, getClass().getClassLoader());
         GerConnectorDocument doc = (GerConnectorDocument) plan.changeType(GerConnectorDocument.type);
         if (doc == null) {
             doc = (GerConnectorDocument) plan;
         }
         try {
-            SchemaConversionUtils.validateDD(doc);
+            XmlBeansUtil.validateDD(doc);
             fail("dup connection factory name is invalid");
         } catch (XmlException e) {
             //expected
@@ -94,13 +93,13 @@
 //        File resourcePlan = new File(basedir, "src/test-data/data/dup-admin-object-name.xml");
 //        assertTrue(resourcePlan.exists());
 
-        XmlObject plan = XmlBeansUtil.parse(srcXml);
+        XmlObject plan = XmlBeansUtil.parse(srcXml, getClass().getClassLoader());
         GerConnectorDocument doc = (GerConnectorDocument) plan.changeType(GerConnectorDocument.type);
         if (doc == null) {
             doc = (GerConnectorDocument) plan;
         }
         try {
-            SchemaConversionUtils.validateDD(doc);
+            XmlBeansUtil.validateDD(doc);
             fail("dup admin object name is invalid");
         } catch (XmlException e) {
             //expected
@@ -112,7 +111,7 @@
 //        File resourcePlan = new File(basedir, "src/test-data/data/old-schema-plan.xml");
 //        assertTrue(resourcePlan.exists());
 
-        XmlObject plan = XmlBeansUtil.parse(srcXml);
+        XmlObject plan = XmlBeansUtil.parse(srcXml, getClass().getClassLoader());
         GerConnectorDocument doc = (GerConnectorDocument) plan.changeType(GerConnectorDocument.type);
         if (doc == null) {
             doc = (GerConnectorDocument) plan;

Modified: geronimo/branches/pluggable-jacc/modules/connector/src/java/org/apache/geronimo/connector/AdminObjectSource.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/connector/src/java/org/apache/geronimo/connector/AdminObjectSource.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/connector/src/java/org/apache/geronimo/connector/AdminObjectSource.java (original)
+++ geronimo/branches/pluggable-jacc/modules/connector/src/java/org/apache/geronimo/connector/AdminObjectSource.java Mon Jul  3 17:50:41 2006
@@ -18,7 +18,7 @@
 package org.apache.geronimo.connector;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public interface AdminObjectSource {
 

Modified: geronimo/branches/pluggable-jacc/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java (original)
+++ geronimo/branches/pluggable-jacc/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java Mon Jul  3 17:50:41 2006
@@ -29,7 +29,7 @@
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
 
 /**
- * @version $Rev: 395155 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class ResourceAdapterModuleImpl implements ResourceAdapterModule {
     private final J2EEServer server;

Modified: geronimo/branches/pluggable-jacc/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionFactorySource.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionFactorySource.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionFactorySource.java (original)
+++ geronimo/branches/pluggable-jacc/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionFactorySource.java Mon Jul  3 17:50:41 2006
@@ -18,7 +18,7 @@
 package org.apache.geronimo.connector.outbound;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public interface ConnectionFactorySource {
 

Modified: geronimo/branches/pluggable-jacc/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java (original)
+++ geronimo/branches/pluggable-jacc/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java Mon Jul  3 17:50:41 2006
@@ -38,7 +38,7 @@
 import org.apache.geronimo.kernel.repository.Artifact;
 
 /**
- * @version $Rev: 386505 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class AdminObjectWrapperTest extends TestCase {
 

Modified: geronimo/branches/pluggable-jacc/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java (original)
+++ geronimo/branches/pluggable-jacc/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java Mon Jul  3 17:50:41 2006
@@ -44,7 +44,7 @@
 import org.apache.geronimo.kernel.repository.Artifact;
 
 /**
- * @version $Rev: 386505 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class ManagedConnectionFactoryWrapperTest extends TestCase {
 

Modified: geronimo/branches/pluggable-jacc/modules/connector/src/test/org/apache/geronimo/connector/outbound/PoolResizeTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/connector/src/test/org/apache/geronimo/connector/outbound/PoolResizeTest.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/connector/src/test/org/apache/geronimo/connector/outbound/PoolResizeTest.java (original)
+++ geronimo/branches/pluggable-jacc/modules/connector/src/test/org/apache/geronimo/connector/outbound/PoolResizeTest.java Mon Jul  3 17:50:41 2006
@@ -19,7 +19,7 @@
 import junit.framework.TestCase;
 
 /**
- * @version $Rev:  $ $Date$
+ * @version $Rev$ $Date$
  */
 public class PoolResizeTest extends TestCase {
 



Mime
View raw message