You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2009/06/14 09:40:08 UTC

svn commit: r784518 [3/6] - in /geronimo/server/trunk: ./ framework/buildsupport/car-maven-plugin/ framework/configs/client-system/ framework/configs/client-system/src/main/history/ framework/configs/geronimo-gbean-deployer-bootstrap/src/main/history/ ...

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java?rev=784518&r1=784517&r2=784518&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java Sun Jun 14 07:40:05 2009
@@ -23,30 +23,39 @@
 import java.util.Map;
 
 import javax.management.ObjectName;
+import javax.management.MalformedObjectNameException;
 
 import org.apache.catalina.Container;
 import org.apache.catalina.Context;
 import org.apache.catalina.Engine;
 import org.apache.catalina.LifecycleListener;
 import org.apache.catalina.Realm;
+import org.apache.catalina.Service;
+import org.apache.catalina.LifecycleException;
+import org.apache.catalina.Lifecycle;
+import org.apache.catalina.core.StandardService;
+import org.apache.catalina.startup.ContextConfig;
 import org.apache.catalina.connector.Connector;
 import org.apache.catalina.realm.JAASRealm;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.gbean.annotation.GBean;
+import org.apache.geronimo.gbean.annotation.ParamAttribute;
+import org.apache.geronimo.gbean.annotation.ParamReference;
+import org.apache.geronimo.gbean.annotation.ParamSpecial;
+import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.management.geronimo.NetworkConnector;
 import org.apache.geronimo.management.geronimo.WebManager;
+import org.apache.geronimo.security.jaas.ConfigurationFactory;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
 import org.apache.geronimo.tomcat.realm.TomcatGeronimoRealm;
 import org.apache.geronimo.tomcat.realm.TomcatJAASRealm;
 import org.apache.geronimo.tomcat.util.SecurityHolder;
 import org.apache.geronimo.webservices.SoapHandler;
 import org.apache.geronimo.webservices.WebServiceContainer;
-import org.apache.geronimo.security.jaas.ConfigurationFactory;
 import org.apache.naming.resources.DirContextURLStreamHandlerFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -56,6 +65,7 @@
  *
  * @version $Rev$ $Date$
  */
+@GBean
 public class TomcatContainer implements SoapHandler, GBeanLifecycle, TomcatWebContainer {
 
     private static final Logger log = LoggerFactory.getLogger(TomcatContainer.class);
@@ -68,46 +78,39 @@
     /**
      * Reference to the org.apache.catalina.Embedded embedded.
      */
-    private TomcatGeronimoEmbedded embedded;
+    private Service embedded;
 
     /**
      * Tomcat Engine that will contain the host
      */
-    private Engine engine;
-
-    /**
-     * Geronimo class loader
-     */
-    private ClassLoader classLoader;
+    private final Engine engine;
 
     private final Map webServices = new HashMap();
     private final String objectName;
     private final String[] applicationListeners;
     private final WebManager manager;
     private static boolean first = true;
-    private final LifecycleListenerGBean listenerChain;
-
-    // Required as it's referenced by deployed webapps
-    public TomcatContainer() {
-        this.objectName = null; // is this OK??
-        this.applicationListeners = null;
-        setCatalinaHome(DEFAULT_CATALINA_HOME);
-        manager = null;
-        listenerChain=null;
-    }
 
     /**
      * GBean constructor (invoked dynamically when the gbean is declared in a plan)
      */
     public TomcatContainer(
-            ClassLoader classLoader, 
-            String catalinaHome, 
-            String[] applicationListeners, 
-            ObjectRetriever engineGBean, 
-            LifecycleListenerGBean listenerChain,
-            ServerInfo serverInfo, 
-            String objectName, 
-            WebManager manager) {
+            @ParamSpecial(type= SpecialAttributeType.classLoader)ClassLoader classLoader,
+            @ParamAttribute(name="catalinaHome")String catalinaHome,
+            @ParamAttribute(name="applicationListeners")String[] applicationListeners,
+
+            @ParamReference(name="Server")TomcatServerGBean server,
+            @ParamAttribute(name="serviceName")String serviceName,
+
+            @ParamReference(name="EngineGBean")ObjectRetriever engineGBean,
+            @ParamReference(name="ListenerChain")LifecycleListenerGBean listenerChain,
+            @ParamReference(name="ServerInfo")ServerInfo serverInfo,
+            @ParamSpecial(type= SpecialAttributeType.objectName)String objectName,
+            @ParamReference(name="WebManager")WebManager manager) throws MalformedObjectNameException, LifecycleException {
+
+        if (classLoader == null) throw new IllegalArgumentException("classLoader cannot be null.");
+        if (engineGBean == null && server == null) throw new IllegalArgumentException("Server and EngineGBean cannot both be null.");
+
         // Register a stream handler factory for the JNDI protocol
         URLStreamHandlerFactory streamHandlerFactory =
             new DirContextURLStreamHandlerFactory();
@@ -125,25 +128,75 @@
             }
         }
 
-
         if (catalinaHome == null)
             catalinaHome = DEFAULT_CATALINA_HOME;
+        catalinaHome = serverInfo.resolveServerPath(catalinaHome);
+        System.setProperty("catalina.home", catalinaHome);
 
-        setCatalinaHome(serverInfo.resolveServerPath(catalinaHome));
-
-        if (classLoader == null) {
-            throw new IllegalArgumentException("classLoader cannot be null.");
-        }
+        if (server != null) {
+            this.engine = server.getEngine(serviceName);
+        } else {
+            this.engine = (Engine) engineGBean.getInternalObject();
+            StandardService embedded = new StandardService();
+//            StandardService embedded = new Embedded();
+
+            // Assemble FileLogger as a gbean
+            /*
+             * FileLogger fileLog = new FileLogger(); fileLog.setDirectory("."); fileLog.setPrefix("vsjMbedTC5");
+             * fileLog.setSuffix(".log"); fileLog.setTimestamp(true);
+             */
+
+            // 2. Set the relevant properties of this object itself. In particular,
+            // you will want to establish the default Logger to be used, as well as
+            // the default Realm if you are using container-managed security.
+//            embedded.setUseNaming(false);
+
+            //Add default contexts
+            File rootContext = new File(catalinaHome + "/ROOT");
+
+            String docBase = "";
+            if (rootContext.exists()) {
+                docBase = "ROOT";
+            }
 
-        if (engineGBean == null) {
-            throw new IllegalArgumentException("engineGBean cannot be null.");
-        }
-        
+            Container[] hosts = engine.findChildren();
+            Context defaultContext;
+            ObjectName objName = objectName == null ? null : ObjectName.getInstance(objectName);
+            for (Container host : hosts) {
+                defaultContext = createContext("", docBase, classLoader);
+                if (objName != null) {
+                    defaultContext.setName(objName.getKeyProperty(NameFactory.J2EE_NAME));
+                }
+                if (defaultContext instanceof GeronimoStandardContext) {
+                    GeronimoStandardContext ctx = (GeronimoStandardContext) defaultContext;
+                    // Without this the Tomcat FallBack Application is left behind,
+                    // MBean - ...J2EEApplication=none,J2EEServer=none,..........
+                    ctx.setJ2EEApplication(null);
+                    // if objectName != null extract J2EEServer from objectName/host
+                    ctx.setJ2EEServer(objName == null ? "geronimo" : objName.getKeyProperty(NameFactory.J2EE_SERVER));
+                    ctx.setJavaVMs(new String[]{});
+                    ctx.setServer(objName == null ? "geronimo" : objName.getKeyProperty(NameFactory.J2EE_SERVER));
+                }
+                host.addChild(defaultContext);
+            }
 
-        this.classLoader = classLoader;
+            // 6. Call addEngine() to attach this Engine to the set of defined
+            // Engines for this object.
+            embedded.setContainer(engine);
+
+            if (listenerChain != null){
+                LifecycleListenerGBean listenerGBean = listenerChain;
+                while(listenerGBean != null){
+                    embedded.addLifecycleListener((LifecycleListener)listenerGBean.getInternalObject());
+                    listenerGBean = listenerGBean.getNextListener();
+                }
+            }
 
-        this.engine = (Engine) engineGBean.getInternalObject();
-        this.listenerChain = listenerChain;
+            // 9. Call start() to initiate normal operations of all the attached
+            // components.
+            embedded.start();
+            this.embedded = embedded;
+        }
         this.objectName = objectName;
         this.applicationListeners = applicationListeners;
         this.manager = manager;
@@ -195,71 +248,11 @@
         // The comments are from the javadoc of the Embedded class
 
         // 1. Instantiate a new instance of this class.
-        if (embedded == null) {
-            embedded = new TomcatGeronimoEmbedded();
-        }
-
-        // Assemble FileLogger as a gbean
-        /*
-         * FileLogger fileLog = new FileLogger(); fileLog.setDirectory("."); fileLog.setPrefix("vsjMbedTC5");
-         * fileLog.setSuffix(".log"); fileLog.setTimestamp(true);
-         */
-
-        // 2. Set the relevant properties of this object itself. In particular,
-        // you will want to establish the default Logger to be used, as well as
-        // the default Realm if you are using container-managed security.
-        embedded.setUseNaming(false);
-
-        //Add default contexts
-        File rootContext = new File(System.getProperty("catalina.home") + "/ROOT");
-
-        String docBase = "";
-        if (rootContext.exists()) {
-            docBase = "ROOT";
-        }
-
-        Container[] hosts = engine.findChildren();
-        Context defaultContext;
-        ObjectName objName = objectName == null ? null : ObjectName.getInstance(objectName);
-        for (int i = 0; i < hosts.length; i++) {
-            defaultContext = embedded.createContext("", docBase, classLoader);
-            if(objName != null) {
-                defaultContext.setName(objName.getKeyProperty(NameFactory.J2EE_NAME));
-            }
-            if (defaultContext instanceof GeronimoStandardContext) {
-                GeronimoStandardContext ctx = (GeronimoStandardContext) defaultContext;
-                // Without this the Tomcat FallBack Application is left behind,
-                // MBean - ...J2EEApplication=none,J2EEServer=none,..........
-                ctx.setJ2EEApplication(null);
-                // if objectName != null extract J2EEServer from objectName/host
-                ctx.setJ2EEServer(objName == null ? "geronimo" : objName.getKeyProperty(NameFactory.J2EE_SERVER));
-                ctx.setJavaVMs(new String[]{});
-                ctx.setServer(objName == null ? "geronimo" : objName.getKeyProperty(NameFactory.J2EE_SERVER));
-            }
-            hosts[i].addChild(defaultContext);
-        }
-
-        // 6. Call addEngine() to attach this Engine to the set of defined
-        // Engines for this object.
-        embedded.addEngine(engine);
-        
-        if (listenerChain != null){
-            LifecycleListenerGBean listenerGBean = listenerChain;
-            while(listenerGBean != null){
-                embedded.addLifecycleListener((LifecycleListener)listenerGBean.getInternalObject());
-                listenerGBean = listenerGBean.getNextListener();
-            }
-        }
-
-        // 9. Call start() to initiate normal operations of all the attached
-        // components.
-        embedded.start();
     }
 
     public void doStop() throws Exception {
-        if (embedded != null) {
-            embedded.stop();
-            embedded = null;
+        if (embedded instanceof Lifecycle) {
+            ((Lifecycle)embedded).stop();
         }
 
     }
@@ -274,7 +267,7 @@
      * @see org.apache.catalina.Host
      */
     public void addContext(TomcatContext ctx) throws Exception {
-        Context anotherCtxObj = embedded.createContext(ctx.getContextPath(), ctx.getDocBase(), ctx.getClassLoader());
+        Context anotherCtxObj = createContext(ctx.getContextPath(), ctx.getDocBase(), ctx.getClassLoader());
 
         // Set the context for the Tomcat implementation
         ctx.setContext(anotherCtxObj);
@@ -373,10 +366,6 @@
 
     }
 
-    public void setCatalinaHome(String catalinaHome) {
-        System.setProperty("catalina.home", catalinaHome);
-    }
-
     public void addConnector(Connector connector) {
         embedded.addConnector(connector);
     }
@@ -386,7 +375,7 @@
     }
 
     public void addWebService(String contextPath, String[] virtualHosts, WebServiceContainer webServiceContainer, ConfigurationFactory configurationFactory, String realmName, String transportGuarantee, String authMethod, String[] protectedMethods, ClassLoader classLoader) throws Exception {
-        Context webServiceContext = embedded.createEJBWebServiceContext(contextPath, webServiceContainer, configurationFactory, realmName, transportGuarantee, authMethod, protectedMethods, classLoader);
+        Context webServiceContext = createEJBWebServiceContext(contextPath, webServiceContainer, configurationFactory, realmName, transportGuarantee, authMethod, protectedMethods, classLoader);
 
         String virtualServer;
         if (virtualHosts != null && virtualHosts.length > 0) {
@@ -416,49 +405,94 @@
         webServices.remove(contextPath);
     }
 
-    public static final GBeanInfo GBEAN_INFO;
+//    public static final GBeanInfo GBEAN_INFO;
+//
+//    static {
+//        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic("Tomcat Web Container", TomcatContainer.class);
+//
+//        infoFactory.setConstructor(new String[]{
+//                "classLoader",
+//                "catalinaHome",
+//                "applicationListeners",
+//                "EngineGBean",
+//                "LifecycleListenerChain",
+//                "ServerInfo",
+//                "objectName",
+//                "WebManager"});
+//
+//        infoFactory.addAttribute("classLoader", ClassLoader.class, false);
+//
+//        infoFactory.addAttribute("catalinaHome", String.class, true);
+//
+//        infoFactory.addAttribute("applicationListeners", String[].class, true);
+//
+//        infoFactory.addAttribute("objectName", String.class, false);
+//
+//        infoFactory.addReference("EngineGBean", ObjectRetriever.class, GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
+//        infoFactory.addReference("LifecycleListenerChain", LifecycleListenerGBean.class, LifecycleListenerGBean.J2EE_TYPE);
+//
+//        infoFactory.addReference("ServerInfo", ServerInfo.class, "GBean");
+//        infoFactory.addReference("WebManager", WebManager.class);
+//
+//        infoFactory.addOperation("addContext", new Class[]{TomcatContext.class});
+//        infoFactory.addOperation("removeContext", new Class[]{TomcatContext.class});
+//
+//        infoFactory.addOperation("addConnector", new Class[]{Connector.class});
+//        infoFactory.addOperation("removeConnector", new Class[]{Connector.class});
+//
+//        infoFactory.addInterface(SoapHandler.class);
+//        infoFactory.addInterface(TomcatWebContainer.class);
+//
+//        GBEAN_INFO = infoFactory.getBeanInfo();
+//    }
+//
+//    public static GBeanInfo getGBeanInfo() {
+//        return GBEAN_INFO;
+//    }
+
+    public Context createContext(String path, String docBase, ClassLoader cl) {
+
+        if( log.isDebugEnabled() )
+            log.debug("Creating context '" + path + "' with docBase '" +
+                       docBase + "'");
+
+        GeronimoStandardContext context = new GeronimoStandardContext();
+
+        context.setDocBase(docBase);
+        context.setPath(path);
+
+        if (cl != null)
+            context.setParentClassLoader(cl);
+
+        ContextConfig config = new ContextConfig();
+//        config.setCustomAuthenticators(authenticators);
+        context.addLifecycleListener(config);
+
+        context.setDelegate(true);
+        return context;
+
+    }
+    
+    public Context createEJBWebServiceContext(String contextPath,
+            WebServiceContainer webServiceContainer,
+            ConfigurationFactory configurationFactory,
+            String realmName,
+            String transportGuarantee,
+            String authMethod,
+            String[] protectedMethods,
+            ClassLoader classLoader) {
+
+         if( log.isDebugEnabled() )
+             log.debug("Creating EJBWebService context '" + contextPath + "'.");
+
+         TomcatEJBWebServiceContext context = new TomcatEJBWebServiceContext(contextPath, webServiceContainer, configurationFactory, realmName, transportGuarantee, authMethod, protectedMethods, classLoader);
+
+         ContextConfig config = new ContextConfig();
+//         config.setCustomAuthenticators(authenticators);
+         ((Lifecycle) context).addLifecycleListener(config);
 
-    static {
-        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic("Tomcat Web Container", TomcatContainer.class);
+         return (context);
 
-        infoFactory.setConstructor(new String[]{
-                "classLoader", 
-                "catalinaHome", 
-                "applicationListeners", 
-                "EngineGBean", 
-                "LifecycleListenerChain",
-                "ServerInfo", 
-                "objectName", 
-                "WebManager"});
-
-        infoFactory.addAttribute("classLoader", ClassLoader.class, false);
-
-        infoFactory.addAttribute("catalinaHome", String.class, true);
-
-        infoFactory.addAttribute("applicationListeners", String[].class, true);
-
-        infoFactory.addAttribute("objectName", String.class, false);
-
-        infoFactory.addReference("EngineGBean", ObjectRetriever.class, GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
-        infoFactory.addReference("LifecycleListenerChain", LifecycleListenerGBean.class, LifecycleListenerGBean.J2EE_TYPE);
-
-        infoFactory.addReference("ServerInfo", ServerInfo.class, "GBean");
-        infoFactory.addReference("WebManager", WebManager.class);
-
-        infoFactory.addOperation("addContext", new Class[]{TomcatContext.class});
-        infoFactory.addOperation("removeContext", new Class[]{TomcatContext.class});
-
-        infoFactory.addOperation("addConnector", new Class[]{Connector.class});
-        infoFactory.addOperation("removeConnector", new Class[]{Connector.class});
-
-        infoFactory.addInterface(SoapHandler.class);
-        infoFactory.addInterface(TomcatWebContainer.class);
-
-        GBEAN_INFO = infoFactory.getBeanInfo();
-    }
-
-    public static GBeanInfo getGBeanInfo() {
-        return GBEAN_INFO;
-    }
+     }
 
 }

Added: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatServerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatServerGBean.java?rev=784518&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatServerGBean.java (added)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatServerGBean.java Sun Jun 14 07:40:05 2009
@@ -0,0 +1,137 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.geronimo.tomcat;
+
+import java.io.Reader;
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.File;
+import java.io.FileReader;
+import java.util.Arrays;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.JAXBElement;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.geronimo.gbean.annotation.GBean;
+import org.apache.geronimo.gbean.annotation.ParamSpecial;
+import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
+import org.apache.geronimo.gbean.annotation.ParamReference;
+import org.apache.geronimo.gbean.annotation.ParamAttribute;
+import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.tomcat.model.ServerType;
+import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.catalina.Server;
+import org.apache.catalina.Lifecycle;
+import org.apache.catalina.Engine;
+import org.apache.catalina.Service;
+import org.xml.sax.SAXException;
+
+/**
+ * @version $Rev$ $Date$
+ */
+
+@GBean
+public class TomcatServerGBean implements GBeanLifecycle {
+    public static final XMLInputFactory XMLINPUT_FACTORY = XMLInputFactory.newInstance();
+    public static final JAXBContext SERVER_CONTEXT;
+
+    static {
+        try {
+            SERVER_CONTEXT = JAXBContext.newInstance(ServerType.class);
+        } catch (JAXBException e) {
+            throw new RuntimeException("Could not create jaxb contexts for plugin types", e);
+        }
+    }
+
+    //server.xml as a string
+    private final String serverConfig;
+    private final ClassLoader classLoader;
+    private final ServerInfo serverInfo;
+    private final Server server;
+
+    public TomcatServerGBean(@ParamAttribute(name = "serverConfig")String serverConfig,
+                             @ParamAttribute(name = "serverConfigLocation")String serverConfigLocation,
+                             @ParamReference(name = "ServerInfo") ServerInfo serverInfo,
+                             @ParamSpecial(type= SpecialAttributeType.classLoader)ClassLoader classLoader) throws Exception {
+        this.serverConfig = serverConfig;
+        this.serverInfo = serverInfo;
+        this.classLoader = classLoader;
+
+        Reader in;
+        if (serverConfig != null) {
+            in = new StringReader(serverConfig);
+        } else {
+            File loc = serverInfo.resolveServer(serverConfigLocation);
+            in = new FileReader(loc);
+        }
+        try {
+            ServerType serverType = loadServerType(in);
+            server = serverType.build(classLoader);
+        } finally {
+            in.close();
+        }
+    }
+
+    static ServerType loadServerType(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+        Unmarshaller unmarshaller = SERVER_CONTEXT.createUnmarshaller();
+        XMLStreamReader xmlStream = XMLINPUT_FACTORY.createXMLStreamReader(in);
+        JAXBElement<ServerType> element = unmarshaller.unmarshal(xmlStream, ServerType.class);
+        ServerType serverType = element.getValue();
+        return serverType;
+    }
+
+    public void doStart() throws Exception {
+        ((Lifecycle)server).start();
+    }
+
+    public void doStop() throws Exception {
+        ((Lifecycle)server).stop();
+    }
+
+    public void doFail() {
+        try {
+            doStop();
+        } catch (Exception e) {
+            //TODO log??
+        }
+    }
+
+    public Engine getEngine(String serviceName) {
+        Service service;
+        if (serviceName == null) {
+            Service[] services = server.findServices();
+            if (services == null || services.length == 0) throw new IllegalStateException("No services in server");
+
+            if (services.length > 1) throw new IllegalStateException("More than one service in server.  Provide name of desired server" + Arrays.asList(services));
+            service = services[0];
+
+        } else {
+            service = server.findService(serviceName);
+        }
+        return (Engine) service.getContainer();
+    }
+}

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatServerGBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatServerGBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatServerGBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ClusterType.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ClusterType.java?rev=784518&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ClusterType.java (added)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ClusterType.java Sun Jun 14 07:40:05 2009
@@ -0,0 +1,37 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2009.06.02 at 10:12:18 AM PDT 
+//
+
+
+package org.apache.geronimo.tomcat.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for ClusterType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="ClusterType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ClusterType")
+public class ClusterType {
+
+
+}

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ClusterType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ClusterType.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ClusterType.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ConnectorType.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ConnectorType.java?rev=784518&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ConnectorType.java (added)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ConnectorType.java Sun Jun 14 07:40:05 2009
@@ -0,0 +1,680 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.06.05 at 10:24:22 AM PDT
+//
+
+
+package org.apache.geronimo.tomcat.model;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.List;
+import java.util.ArrayList;
+import java.lang.reflect.Constructor;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.namespace.QName;
+
+import org.apache.catalina.connector.Connector;
+import org.apache.catalina.LifecycleListener;
+import org.apache.xbean.recipe.ObjectRecipe;
+import org.apache.xbean.recipe.Option;
+
+
+/**
+ * <p>Java class for ConnectorType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="ConnectorType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="Listener" type="{}ListenerType" maxOccurs="unbounded" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="className" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="allowTrace" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       &lt;attribute name="emptySessionPath" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       &lt;attribute name="enableLookups" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       &lt;attribute name="maxPostSize" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       &lt;attribute name="maxSavePostSize" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       &lt;attribute name="port" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       &lt;attribute name="protocol" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="protocolHandlerClassName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="proxyName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="proxyPort" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       &lt;attribute name="redirectPort" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       &lt;attribute name="scheme" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="secure" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       &lt;attribute name="encoding" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="useBodyEncodingForURI" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="xpoweredBy" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="useIPVHosts" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ConnectorType", propOrder = {
+    "listener"
+})
+public class ConnectorType {
+
+    @XmlElement(name = "Listener")
+    protected List<ListenerType> listener;
+    @XmlAttribute
+    protected String className = Connector.class.getName();
+    @XmlAttribute
+    protected Boolean allowTrace;
+    @XmlAttribute
+    protected Boolean emptySessionPath;
+    @XmlAttribute
+    protected Boolean enableLookups;
+    @XmlAttribute
+    protected Integer maxPostSize;
+    @XmlAttribute
+    protected Integer maxSavePostSize;
+    @XmlAttribute
+    protected Integer port;
+    @XmlAttribute
+    protected String protocol;
+    @XmlAttribute
+    protected String protocolHandlerClassName;
+    @XmlAttribute
+    protected String proxyName;
+    @XmlAttribute
+    protected Integer proxyPort;
+    @XmlAttribute
+    protected Integer redirectPort;
+    @XmlAttribute
+    protected String scheme;
+    @XmlAttribute
+    protected Boolean secure;
+    @XmlAttribute
+    protected String encoding;
+    @XmlAttribute
+    protected String useBodyEncodingForURI;
+    @XmlAttribute
+    protected String xpoweredBy;
+    @XmlAttribute
+    protected Boolean useIPVHosts;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+    private static final String EMPTY_SESSION_PATH = "emptySessionPath";
+    private static final String ENABLE_LOOKUPS = "enableLookups";
+    private static final String MAX_POST_SIZE = "maxPostSize";
+    private static final String MAX_SAVE_POST_SIZE = "maxSavePostSize";
+    private static final String PORT = "port";
+    private static final String PROTOCOL = "protocol";
+    private static final String PROTOCOL_HANDLER_CLASS_NAME = "protocolHandlerClassName";
+    private static final String PROXY_NAME = "proxyName";
+    private static final String PROXY_PORT = "proxyPort";
+    private static final String REDIRECT_PORT = "redirectPort";
+    private static final String SCHEME = "scheme";
+    private static final String SECURE = "secure";
+    private static final String ENCODING = "encoding";
+    private static final String USE_BODY_ENCODING_FOR_URI = "useBodyEncodingForURI";
+    private static final String X_POWERED_BY = "xPoweredBy";
+    private static final String USE_IPVHOSTS = "useIPVHosts";
+    private static final String ALLOW_TRACE = "allowTrace";
+
+
+    /**
+     * Gets the value of the listener property.
+     *
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the listener property.
+     *
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getListener().add(newItem);
+     * </pre>
+     *
+     *
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link ListenerType }
+     *
+     *
+     */
+    public List<ListenerType> getListener() {
+        if (listener == null) {
+            listener = new ArrayList<ListenerType>();
+        }
+        return this.listener;
+    }
+
+    /**
+     * Gets the value of the className property.
+     *
+     * @return
+     *     possible object is
+     *     {@link String }
+     *
+     */
+    public String getClassName() {
+        return className;
+    }
+
+    /**
+     * Sets the value of the className property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *
+     */
+    public void setClassName(String value) {
+        this.className = value;
+    }
+
+    /**
+     * Gets the value of the allowTrace property.
+     *
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *
+     */
+    public Boolean isAllowTrace() {
+        return allowTrace;
+    }
+
+    /**
+     * Sets the value of the allowTrace property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *
+     */
+    public void setAllowTrace(Boolean value) {
+        this.allowTrace = value;
+    }
+
+    /**
+     * Gets the value of the emptySessionPath property.
+     *
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *
+     */
+    public Boolean isEmptySessionPath() {
+        return emptySessionPath;
+    }
+
+    /**
+     * Sets the value of the emptySessionPath property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *
+     */
+    public void setEmptySessionPath(Boolean value) {
+        this.emptySessionPath = value;
+    }
+
+    /**
+     * Gets the value of the enableLookups property.
+     *
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *
+     */
+    public Boolean isEnableLookups() {
+        return enableLookups;
+    }
+
+    /**
+     * Sets the value of the enableLookups property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *
+     */
+    public void setEnableLookups(Boolean value) {
+        this.enableLookups = value;
+    }
+
+    /**
+     * Gets the value of the maxPostSize property.
+     *
+     * @return
+     *     possible object is
+     *     {@link Integer }
+     *
+     */
+    public Integer getMaxPostSize() {
+        return maxPostSize;
+    }
+
+    /**
+     * Sets the value of the maxPostSize property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link Integer }
+     *
+     */
+    public void setMaxPostSize(Integer value) {
+        this.maxPostSize = value;
+    }
+
+    /**
+     * Gets the value of the maxSavePostSize property.
+     *
+     * @return
+     *     possible object is
+     *     {@link Integer }
+     *
+     */
+    public Integer getMaxSavePostSize() {
+        return maxSavePostSize;
+    }
+
+    /**
+     * Sets the value of the maxSavePostSize property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link Integer }
+     *
+     */
+    public void setMaxSavePostSize(Integer value) {
+        this.maxSavePostSize = value;
+    }
+
+    /**
+     * Gets the value of the port property.
+     *
+     * @return
+     *     possible object is
+     *     {@link Integer }
+     *
+     */
+    public Integer getPort() {
+        return port;
+    }
+
+    /**
+     * Sets the value of the port property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link Integer }
+     *
+     */
+    public void setPort(Integer value) {
+        this.port = value;
+    }
+
+    /**
+     * Gets the value of the protocol property.
+     *
+     * @return
+     *     possible object is
+     *     {@link String }
+     *
+     */
+    public String getProtocol() {
+        return protocol;
+    }
+
+    /**
+     * Sets the value of the protocol property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *
+     */
+    public void setProtocol(String value) {
+        this.protocol = value;
+    }
+
+    /**
+     * Gets the value of the protocolHandlerClassName property.
+     *
+     * @return
+     *     possible object is
+     *     {@link String }
+     *
+     */
+    public String getProtocolHandlerClassName() {
+        return protocolHandlerClassName;
+    }
+
+    /**
+     * Sets the value of the protocolHandlerClassName property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *
+     */
+    public void setProtocolHandlerClassName(String value) {
+        this.protocolHandlerClassName = value;
+    }
+
+    /**
+     * Gets the value of the proxyName property.
+     *
+     * @return
+     *     possible object is
+     *     {@link String }
+     *
+     */
+    public String getProxyName() {
+        return proxyName;
+    }
+
+    /**
+     * Sets the value of the proxyName property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *
+     */
+    public void setProxyName(String value) {
+        this.proxyName = value;
+    }
+
+    /**
+     * Gets the value of the proxyPort property.
+     *
+     * @return
+     *     possible object is
+     *     {@link Integer }
+     *
+     */
+    public Integer getProxyPort() {
+        return proxyPort;
+    }
+
+    /**
+     * Sets the value of the proxyPort property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link Integer }
+     *
+     */
+    public void setProxyPort(Integer value) {
+        this.proxyPort = value;
+    }
+
+    /**
+     * Gets the value of the redirectPort property.
+     *
+     * @return
+     *     possible object is
+     *     {@link Integer }
+     *
+     */
+    public Integer getRedirectPort() {
+        return redirectPort;
+    }
+
+    /**
+     * Sets the value of the redirectPort property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link Integer }
+     *
+     */
+    public void setRedirectPort(Integer value) {
+        this.redirectPort = value;
+    }
+
+    /**
+     * Gets the value of the scheme property.
+     *
+     * @return
+     *     possible object is
+     *     {@link String }
+     *
+     */
+    public String getScheme() {
+        return scheme;
+    }
+
+    /**
+     * Sets the value of the scheme property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *
+     */
+    public void setScheme(String value) {
+        this.scheme = value;
+    }
+
+    /**
+     * Gets the value of the secure property.
+     *
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *
+     */
+    public Boolean isSecure() {
+        return secure;
+    }
+
+    /**
+     * Sets the value of the secure property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *
+     */
+    public void setSecure(Boolean value) {
+        this.secure = value;
+    }
+
+    /**
+     * Gets the value of the encoding property.
+     *
+     * @return
+     *     possible object is
+     *     {@link String }
+     *
+     */
+    public String getEncoding() {
+        return encoding;
+    }
+
+    /**
+     * Sets the value of the encoding property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *
+     */
+    public void setEncoding(String value) {
+        this.encoding = value;
+    }
+
+    /**
+     * Gets the value of the useBodyEncodingForURI property.
+     *
+     * @return
+     *     possible object is
+     *     {@link String }
+     *
+     */
+    public String getUseBodyEncodingForURI() {
+        return useBodyEncodingForURI;
+    }
+
+    /**
+     * Sets the value of the useBodyEncodingForURI property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *
+     */
+    public void setUseBodyEncodingForURI(String value) {
+        this.useBodyEncodingForURI = value;
+    }
+
+    /**
+     * Gets the value of the xpoweredBy property.
+     *
+     * @return
+     *     possible object is
+     *     {@link String }
+     *
+     */
+    public String getXpoweredBy() {
+        return xpoweredBy;
+    }
+
+    /**
+     * Sets the value of the xpoweredBy property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *
+     */
+    public void setXpoweredBy(String value) {
+        this.xpoweredBy = value;
+    }
+
+    /**
+     * Gets the value of the useIPVHosts property.
+     *
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *
+     */
+    public Boolean isUseIPVHosts() {
+        return useIPVHosts;
+    }
+
+    /**
+     * Sets the value of the useIPVHosts property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *
+     */
+    public void setUseIPVHosts(Boolean value) {
+        this.useIPVHosts = value;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     *
+     * <p>
+     * the map is keyed by the name of the attribute and
+     * the value is the string value of the attribute.
+     *
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     *
+     *
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+
+    public Connector getConnector(ClassLoader cl) throws Exception {
+        Map<String, Object> properties = new HashMap<String, Object>();
+        if (isAllowTrace() != null) {
+            properties.put(ALLOW_TRACE, isAllowTrace());
+        }
+        if (isEmptySessionPath() != null) {
+            properties.put(EMPTY_SESSION_PATH, isEmptySessionPath());
+        }
+        if (isEnableLookups() != null) {
+            properties.put(ENABLE_LOOKUPS, isEnableLookups());
+        }
+        if (getMaxPostSize() != null) {
+            properties.put(MAX_POST_SIZE, getMaxPostSize());
+        }
+        if (getMaxSavePostSize() != null) {
+            properties.put(MAX_SAVE_POST_SIZE, getMaxSavePostSize());
+        }
+        if (getPort() != null) {
+            properties.put(PORT, getPort());
+        }
+        if (getProtocol() != null) {
+            properties.put(PROTOCOL, getProtocol());
+        }
+        if (getProtocolHandlerClassName() != null) {
+            properties.put(PROTOCOL_HANDLER_CLASS_NAME, getProtocolHandlerClassName());
+        }
+        if (getProxyName() != null) {
+            properties.put(PROXY_NAME, getProxyName());
+        }
+        if (getProxyPort() != null) {
+            properties.put(PROXY_PORT, getProxyPort());
+        }
+        if (getRedirectPort() != null) {
+            properties.put(REDIRECT_PORT, getRedirectPort());
+        }
+        if (getScheme() != null) {
+            properties.put(SCHEME, getScheme());
+        }
+        if (isSecure() != null) {
+            properties.put(SECURE, isSecure());
+        }
+        if (getEncoding() != null) {
+            properties.put(ENCODING, getEncoding());
+        }
+        if (getUseBodyEncodingForURI() != null) {
+            properties.put(USE_BODY_ENCODING_FOR_URI, getUseBodyEncodingForURI());
+        }
+        if (getXpoweredBy() != null) {
+            properties.put(X_POWERED_BY, getXpoweredBy());
+        }
+        if (isUseIPVHosts() != null) {
+            properties.put(USE_IPVHOSTS, isUseIPVHosts());
+        }
+        for (Map.Entry<QName, String> entry: otherAttributes.entrySet()) {
+            String name = entry.getKey().getLocalPart();
+            properties.put(name, entry.getValue());
+        }
+        ObjectRecipe recipe = new ObjectRecipe(className, properties);
+        recipe.allow(Option.IGNORE_MISSING_PROPERTIES);
+        Connector connector = (Connector) recipe.create(cl);
+        
+        for (ListenerType listenerType: getListener()) {
+            LifecycleListener listener = listenerType.getLifecycleListener(cl);
+            connector.addLifecycleListener(listener);
+        }
+        return connector;
+    }
+}

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ConnectorType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ConnectorType.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ConnectorType.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ContextType.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ContextType.java?rev=784518&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ContextType.java (added)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ContextType.java Sun Jun 14 07:40:05 2009
@@ -0,0 +1,39 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2009.06.02 at 10:12:18 AM PDT 
+//
+
+
+package org.apache.geronimo.tomcat.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for ContextType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="ContextType">
+ *   &lt;complexContent>
+ *     &lt;extension base="{}NamingResourcesType">
+ *     &lt;/extension>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ContextType")
+public class ContextType
+    extends NamingResourcesType
+{
+
+
+}

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ContextType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ContextType.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ContextType.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EjbType.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EjbType.java?rev=784518&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EjbType.java (added)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EjbType.java Sun Jun 14 07:40:05 2009
@@ -0,0 +1,37 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2009.06.02 at 10:12:18 AM PDT 
+//
+
+
+package org.apache.geronimo.tomcat.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for EjbType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="EjbType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "EjbType")
+public class EjbType {
+
+
+}

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EjbType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EjbType.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EjbType.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EngineType.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EngineType.java?rev=784518&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EngineType.java (added)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EngineType.java Sun Jun 14 07:40:05 2009
@@ -0,0 +1,381 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.06.05 at 10:24:22 AM PDT
+//
+
+
+package org.apache.geronimo.tomcat.model;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+import org.apache.catalina.core.StandardEngine;
+import org.apache.catalina.Engine;
+import org.apache.catalina.Realm;
+import org.apache.catalina.Host;
+import org.apache.catalina.Lifecycle;
+import org.apache.catalina.LifecycleListener;
+import org.apache.catalina.Server;
+import org.apache.xbean.recipe.ObjectRecipe;
+import org.apache.xbean.recipe.Option;
+
+
+/**
+ * <p>Java class for EngineType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="EngineType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="Realm" type="{}RealmType" minOccurs="0"/>
+ *         &lt;element name="Host" type="{}HostType" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="Cluster" type="{}ClusterType" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="Listener" type="{}ListenerType" maxOccurs="unbounded" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="className" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="defaultHost" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="jvmRoute" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="backgroundProcessorDelay" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "EngineType", propOrder = {
+    "realm",
+    "host",
+    "cluster",
+    "listener"
+})
+public class EngineType {
+
+    @XmlElement(name = "Realm")
+    protected RealmType realm;
+    @XmlElement(name = "Host")
+    protected List<HostType> host;
+    @XmlElement(name = "Cluster")
+    protected List<ClusterType> cluster;
+    @XmlElement(name = "Listener")
+    protected List<ListenerType> listener;
+    @XmlAttribute
+    protected String className = StandardEngine.class.getName();
+    @XmlAttribute
+    protected String name;
+    @XmlAttribute
+    protected String defaultHost;
+    @XmlAttribute
+    protected String jvmRoute;
+    @XmlAttribute
+    protected Integer backgroundProcessorDelay;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the realm property.
+     *
+     * @return
+     *     possible object is
+     *     {@link RealmType }
+     *
+     */
+    public RealmType getRealm() {
+        return realm;
+    }
+
+    /**
+     * Sets the value of the realm property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link RealmType }
+     *
+     */
+    public void setRealm(RealmType value) {
+        this.realm = value;
+    }
+
+    /**
+     * Gets the value of the host property.
+     *
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the host property.
+     *
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getHost().add(newItem);
+     * </pre>
+     *
+     *
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link HostType }
+     *
+     *
+     */
+    public List<HostType> getHost() {
+        if (host == null) {
+            host = new ArrayList<HostType>();
+        }
+        return this.host;
+    }
+
+    /**
+     * Gets the value of the cluster property.
+     *
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the cluster property.
+     *
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getCluster().add(newItem);
+     * </pre>
+     *
+     *
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link ClusterType }
+     *
+     *
+     */
+    public List<ClusterType> getCluster() {
+        if (cluster == null) {
+            cluster = new ArrayList<ClusterType>();
+        }
+        return this.cluster;
+    }
+
+    /**
+     * Gets the value of the listener property.
+     *
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the listener property.
+     *
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getListener().add(newItem);
+     * </pre>
+     *
+     *
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link ListenerType }
+     *
+     *
+     */
+    public List<ListenerType> getListener() {
+        if (listener == null) {
+            listener = new ArrayList<ListenerType>();
+        }
+        return this.listener;
+    }
+
+    /**
+     * Gets the value of the className property.
+     *
+     * @return
+     *     possible object is
+     *     {@link String }
+     *
+     */
+    public String getClassName() {
+        return className;
+    }
+
+    /**
+     * Sets the value of the className property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *
+     */
+    public void setClassName(String value) {
+        this.className = value;
+    }
+
+    /**
+     * Gets the value of the name property.
+     *
+     * @return
+     *     possible object is
+     *     {@link String }
+     *
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the value of the name property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *
+     */
+    public void setName(String value) {
+        this.name = value;
+    }
+
+    /**
+     * Gets the value of the defaultHost property.
+     *
+     * @return
+     *     possible object is
+     *     {@link String }
+     *
+     */
+    public String getDefaultHost() {
+        return defaultHost;
+    }
+
+    /**
+     * Sets the value of the defaultHost property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *
+     */
+    public void setDefaultHost(String value) {
+        this.defaultHost = value;
+    }
+
+    /**
+     * Gets the value of the jvmRoute property.
+     *
+     * @return
+     *     possible object is
+     *     {@link String }
+     *
+     */
+    public String getJvmRoute() {
+        return jvmRoute;
+    }
+
+    /**
+     * Sets the value of the jvmRoute property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *
+     */
+    public void setJvmRoute(String value) {
+        this.jvmRoute = value;
+    }
+
+    /**
+     * Gets the value of the backgroundProcessorDelay property.
+     *
+     * @return
+     *     possible object is
+     *     {@link Integer }
+     *
+     */
+    public Integer getBackgroundProcessorDelay() {
+        return backgroundProcessorDelay;
+    }
+
+    /**
+     * Sets the value of the backgroundProcessorDelay property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link Integer }
+     *
+     */
+    public void setBackgroundProcessorDelay(Integer value) {
+        this.backgroundProcessorDelay = value;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     *
+     * <p>
+     * the map is keyed by the name of the attribute and
+     * the value is the string value of the attribute.
+     *
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     *
+     *
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+    public Engine getEngine(ClassLoader cl) throws Exception {
+        Map<String, Object> properties = new HashMap<String, Object>();
+        properties.put("name", getName());
+        properties.put("defaultHost", getDefaultHost());
+        properties.put("jvmRoute", getJvmRoute());
+        properties.put("backgroundProcessorDelay", getBackgroundProcessorDelay());
+
+        for (Map.Entry<QName, String> entry: otherAttributes.entrySet()) {
+            String name = entry.getKey().getLocalPart();
+            properties.put(name, entry.getValue());
+        }
+        ObjectRecipe recipe = new ObjectRecipe(className, properties);
+        recipe.allow(Option.IGNORE_MISSING_PROPERTIES);
+        Engine engine = (Engine) recipe.create(cl);
+//        Class<? extends Engine> engineClass = cl.loadClass(className).asSubclass(Engine.class);
+//        Engine engine = engineClass.newInstance();
+//        engine.setName(name);
+//        engine.setDefaultHost(defaultHost);
+//        engine.setJvmRoute(jvmRoute);
+//        engine.setBackgroundProcessorDelay(backgroundProcessorDelay);
+        //realm
+        if (this.realm != null) {
+            Realm realm = this.realm.getRealm(cl);
+            engine.setRealm(realm);
+        }
+        //host
+        for (HostType hostType: getHost()) {
+            Host host = hostType.getHost(cl);
+            engine.addChild(host);
+        }
+        //cluster
+        //listener
+        if (engine instanceof Lifecycle) {
+            Lifecycle lifecycle = (Lifecycle) engine;
+            for (ListenerType listenerType: getListener()) {
+                LifecycleListener listener = listenerType.getLifecycleListener(cl);
+                lifecycle.addLifecycleListener(listener);
+            }
+        }
+        return engine;
+    }
+}

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EngineType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EngineType.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EngineType.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EnvironmentType.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EnvironmentType.java?rev=784518&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EnvironmentType.java (added)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EnvironmentType.java Sun Jun 14 07:40:05 2009
@@ -0,0 +1,37 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2009.06.02 at 10:12:18 AM PDT 
+//
+
+
+package org.apache.geronimo.tomcat.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for EnvironmentType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="EnvironmentType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "EnvironmentType")
+public class EnvironmentType {
+
+
+}

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EnvironmentType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EnvironmentType.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/EnvironmentType.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ExecutorType.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ExecutorType.java?rev=784518&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ExecutorType.java (added)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ExecutorType.java Sun Jun 14 07:40:05 2009
@@ -0,0 +1,108 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2009.06.02 at 10:12:18 AM PDT 
+//
+
+
+package org.apache.geronimo.tomcat.model;
+
+import java.util.Map;
+import java.util.HashMap;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.namespace.QName;
+
+import org.apache.catalina.Executor;
+import org.apache.catalina.core.StandardThreadExecutor;
+import org.apache.xbean.recipe.ObjectRecipe;
+import org.apache.xbean.recipe.Option;
+
+
+/**
+ * <p>Java class for ExecutorType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="ExecutorType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;attribute name="className" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ExecutorType")
+public class ExecutorType {
+
+    @XmlAttribute
+    protected String className = StandardThreadExecutor.class.getName();
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the className property.
+     *
+     * @return
+     *     possible object is
+     *     {@link String }
+     *
+     */
+    public String getClassName() {
+        return className;
+    }
+
+    /**
+     * Sets the value of the className property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *
+     */
+    public void setClassName(String value) {
+        this.className = value;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     *
+     * <p>
+     * the map is keyed by the name of the attribute and
+     * the value is the string value of the attribute.
+     *
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     *
+     *
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+
+    public Executor getExecutor(ClassLoader cl) throws Exception {
+        Map<String, Object> properties = new HashMap<String, Object>();
+
+        for (Map.Entry<QName, String> entry: otherAttributes.entrySet()) {
+            String name = entry.getKey().getLocalPart();
+            properties.put(name, entry.getValue());
+        }
+        ObjectRecipe recipe = new ObjectRecipe(className, properties);
+        recipe.allow(Option.IGNORE_MISSING_PROPERTIES);
+        Executor executor = (Executor) recipe.create(cl);
+        return executor;
+    }
+}

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ExecutorType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ExecutorType.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/ExecutorType.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/HostType.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/HostType.java?rev=784518&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/HostType.java (added)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/model/HostType.java Sun Jun 14 07:40:05 2009
@@ -0,0 +1,566 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2009.06.02 at 10:12:18 AM PDT 
+//
+
+
+package org.apache.geronimo.tomcat.model;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.namespace.QName;
+
+import org.apache.catalina.Host;
+import org.apache.catalina.LifecycleListener;
+import org.apache.catalina.Lifecycle;
+import org.apache.catalina.Valve;
+import org.apache.catalina.Pipeline;
+import org.apache.catalina.Cluster;
+import org.apache.catalina.Realm;
+import org.apache.catalina.core.StandardHost;
+import org.apache.catalina.core.ContainerBase;
+import org.apache.xbean.recipe.ObjectRecipe;
+import org.apache.xbean.recipe.Option;
+
+
+/**
+ * <p>Java class for HostType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="HostType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="Alias" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="Cluster" type="{}ClusterType" minOccurs="0"/>
+ *         &lt;element name="Listener" type="{}ListenerType" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="Realm" type="{}RealmType" minOccurs="0"/>
+ *         &lt;element name="Valve" type="{}ValveType" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="Context" type="{}ContextType" maxOccurs="unbounded" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="className" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="appBase" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="hostConfigClass" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="unpackWARs" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       &lt;attribute name="autoDeploy" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       &lt;attribute name="deployOnStartup" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       &lt;attribute name="xmlValidation" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       &lt;attribute name="xmlNamespaceAware" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "HostType", propOrder = {
+    "alias",
+    "cluster",
+    "listener",
+    "realm",
+    "valve",
+    "context"
+})
+public class HostType {
+
+    @XmlElement(name = "Alias")
+    protected List<String> alias;
+    @XmlElement(name = "Cluster")
+    protected ClusterType cluster;
+    @XmlElement(name = "Listener")
+    protected List<ListenerType> listener;
+    @XmlElement(name = "Realm")
+    protected RealmType realm;
+    @XmlElement(name = "Valve")
+    protected List<ValveType> valve;
+    @XmlElement(name = "Context")
+    protected List<ContextType> context;
+    @XmlAttribute
+    protected String className = StandardHost.class.getName();
+    @XmlAttribute
+    protected String name;
+    @XmlAttribute
+    protected String appBase;
+    @XmlAttribute
+    protected String hostConfigClass;
+    @XmlAttribute
+    protected Boolean unpackWARs;
+    @XmlAttribute
+    protected Boolean autoDeploy;
+    @XmlAttribute
+    protected Boolean deployOnStartup;
+    @XmlAttribute
+    protected Boolean xmlValidation;
+    @XmlAttribute
+    protected Boolean xmlNamespaceAware;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the alias property.
+     *
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the alias property.
+     *
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAlias().add(newItem);
+     * </pre>
+     *
+     *
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     *
+     *
+     */
+    public List<String> getAlias() {
+        if (alias == null) {
+            alias = new ArrayList<String>();
+        }
+        return this.alias;
+    }
+
+    /**
+     * Gets the value of the cluster property.
+     *
+     * @return
+     *     possible object is
+     *     {@link ClusterType }
+     *
+     */
+    public ClusterType getCluster() {
+        return cluster;
+    }
+
+    /**
+     * Sets the value of the cluster property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link ClusterType }
+     *
+     */
+    public void setCluster(ClusterType value) {
+        this.cluster = value;
+    }
+
+    /**
+     * Gets the value of the listener property.
+     *
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the listener property.
+     *
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getListener().add(newItem);
+     * </pre>
+     *
+     *
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link ListenerType }
+     *
+     *
+     */
+    public List<ListenerType> getListener() {
+        if (listener == null) {
+            listener = new ArrayList<ListenerType>();
+        }
+        return this.listener;
+    }
+
+    /**
+     * Gets the value of the realm property.
+     *
+     * @return
+     *     possible object is
+     *     {@link RealmType }
+     *
+     */
+    public RealmType getRealm() {
+        return realm;
+    }
+
+    /**
+     * Sets the value of the realm property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link RealmType }
+     *
+     */
+    public void setRealm(RealmType value) {
+        this.realm = value;
+    }
+
+    /**
+     * Gets the value of the valve property.
+     *
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the valve property.
+     *
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getValve().add(newItem);
+     * </pre>
+     *
+     *
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link ValveType }
+     *
+     *
+     */
+    public List<ValveType> getValve() {
+        if (valve == null) {
+            valve = new ArrayList<ValveType>();
+        }
+        return this.valve;
+    }
+
+    /**
+     * Gets the value of the context property.
+     *
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the context property.
+     *
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getContext().add(newItem);
+     * </pre>
+     *
+     *
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link ContextType }
+     *
+     *
+     */
+    public List<ContextType> getContext() {
+        if (context == null) {
+            context = new ArrayList<ContextType>();
+        }
+        return this.context;
+    }
+
+    /**
+     * Gets the value of the className property.
+     *
+     * @return
+     *     possible object is
+     *     {@link String }
+     *
+     */
+    public String getClassName() {
+        return className;
+    }
+
+    /**
+     * Sets the value of the className property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *
+     */
+    public void setClassName(String value) {
+        this.className = value;
+    }
+
+    /**
+     * Gets the value of the name property.
+     *
+     * @return
+     *     possible object is
+     *     {@link String }
+     *
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the value of the name property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *
+     */
+    public void setName(String value) {
+        this.name = value;
+    }
+
+    /**
+     * Gets the value of the appBase property.
+     *
+     * @return
+     *     possible object is
+     *     {@link String }
+     *
+     */
+    public String getAppBase() {
+        return appBase;
+    }
+
+    /**
+     * Sets the value of the appBase property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *
+     */
+    public void setAppBase(String value) {
+        this.appBase = value;
+    }
+
+    /**
+     * Gets the value of the hostConfigClass property.
+     *
+     * @return
+     *     possible object is
+     *     {@link String }
+     *
+     */
+    public String getHostConfigClass() {
+        return hostConfigClass;
+    }
+
+    /**
+     * Sets the value of the hostConfigClass property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *
+     */
+    public void setHostConfigClass(String value) {
+        this.hostConfigClass = value;
+    }
+
+    /**
+     * Gets the value of the unpackWARs property.
+     *
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *
+     */
+    public Boolean isUnpackWARs() {
+        return unpackWARs;
+    }
+
+    /**
+     * Sets the value of the unpackWARs property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *
+     */
+    public void setUnpackWARs(Boolean value) {
+        this.unpackWARs = value;
+    }
+
+    /**
+     * Gets the value of the autoDeploy property.
+     *
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *
+     */
+    public Boolean isAutoDeploy() {
+        return autoDeploy;
+    }
+
+    /**
+     * Sets the value of the autoDeploy property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *
+     */
+    public void setAutoDeploy(Boolean value) {
+        this.autoDeploy = value;
+    }
+
+    /**
+     * Gets the value of the deployOnStartup property.
+     *
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *
+     */
+    public Boolean isDeployOnStartup() {
+        return deployOnStartup;
+    }
+
+    /**
+     * Sets the value of the deployOnStartup property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *
+     */
+    public void setDeployOnStartup(Boolean value) {
+        this.deployOnStartup = value;
+    }
+
+    /**
+     * Gets the value of the xmlValidation property.
+     *
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *
+     */
+    public Boolean isXmlValidation() {
+        return xmlValidation;
+    }
+
+    /**
+     * Sets the value of the xmlValidation property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *
+     */
+    public void setXmlValidation(Boolean value) {
+        this.xmlValidation = value;
+    }
+
+    /**
+     * Gets the value of the xmlNamespaceAware property.
+     *
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *
+     */
+    public Boolean isXmlNamespaceAware() {
+        return xmlNamespaceAware;
+    }
+
+    /**
+     * Sets the value of the xmlNamespaceAware property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *
+     */
+    public void setXmlNamespaceAware(Boolean value) {
+        this.xmlNamespaceAware = value;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     *
+     * <p>
+     * the map is keyed by the name of the attribute and
+     * the value is the string value of the attribute.
+     *
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     *
+     *
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+    public Host getHost(ClassLoader cl) throws Exception {
+        Map<String, Object> properties = new HashMap<String, Object>();
+        properties.put("name", getName());
+        properties.put("appBase", getAppBase());
+        properties.put("hostConfigClass", getHostConfigClass());
+        properties.put("unpackWars", isUnpackWARs());
+        properties.put("autoDeploy", isAutoDeploy());
+        properties.put("deployOnStartup", isDeployOnStartup());
+        properties.put("xmlValidation", isXmlValidation());
+        properties.put("xmlNamespaceAware", isXmlNamespaceAware());
+
+        //TODO cluster
+//        if (getCluster() != null) {
+//            ClusterType clusterType = getCluster();
+//            Cluster cluster = clusterType.getCluster(cl);
+//            properties.put("cluater", cluster);
+//        }
+        if (getRealm() != null) {
+            Realm realm = getRealm().getRealm(cl);
+            properties.put("realm", realm);
+        }
+        for (Map.Entry<QName, String> entry: otherAttributes.entrySet()) {
+            String name = entry.getKey().getLocalPart();
+            properties.put(name, entry.getValue());
+        }
+        ObjectRecipe recipe = new ObjectRecipe(className, properties);
+        recipe.allow(Option.IGNORE_MISSING_PROPERTIES);
+        Host host = (Host) recipe.create(cl);
+
+        if (host instanceof Lifecycle) {
+            Lifecycle lifecycle = (Lifecycle) host;
+            for (ListenerType listenerType: getListener()) {
+                LifecycleListener listener = listenerType.getLifecycleListener(cl);
+                lifecycle.addLifecycleListener(listener);
+            }
+        }
+        //alias
+        for (String alias: getAlias()) {
+            host.addAlias(alias);
+        }
+
+        //valve
+        if (host instanceof Pipeline) {
+            Pipeline pipeline = (Pipeline) host;
+            for (ValveType valveType: getValve()) {
+                Valve valve = valveType.getValve(cl);
+                pipeline.addValve(valve);
+            }
+        }
+
+        //context
+        //TODO contexts
+        return host;
+    }
+}