geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject cvs commit: incubator-geronimo/modules/jetty/src/schema geronimo-jetty.xsd
Date Tue, 09 Mar 2004 18:03:53 GMT
djencks     2004/03/09 10:03:53

  Modified:    modules/jetty/src/java/org/apache/geronimo/jetty/deployment
                        WARConfigBuilder.java WebAppDConfigBean.java
               modules/jetty/src/schema geronimo-jetty.xsd
  Added:       modules/jetty/src/java/org/apache/geronimo/jetty/deployment
                        JettyGBeanAdapter.java JettyRefAdapter.java
  Log:
  Use adapters for gbean xml, add some jndi references
  
  Revision  Changes    Path
  1.12      +50 -97    incubator-geronimo/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WARConfigBuilder.java
  
  Index: WARConfigBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WARConfigBuilder.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- WARConfigBuilder.java	27 Feb 2004 07:35:03 -0000	1.11
  +++ WARConfigBuilder.java	9 Mar 2004 18:03:52 -0000	1.12
  @@ -17,60 +17,57 @@
   
   package org.apache.geronimo.jetty.deployment;
   
  +import java.io.BufferedInputStream;
   import java.io.BufferedOutputStream;
   import java.io.ByteArrayInputStream;
   import java.io.ByteArrayOutputStream;
   import java.io.File;
  +import java.io.FileInputStream;
   import java.io.FileOutputStream;
   import java.io.IOException;
   import java.io.InputStream;
  -import java.io.FileInputStream;
  -import java.io.BufferedInputStream;
   import java.net.MalformedURLException;
   import java.net.URI;
   import java.net.URISyntaxException;
   import java.net.URL;
   import java.util.Collections;
  +import java.util.HashMap;
  +import java.util.Map;
   import java.util.Properties;
  -import java.util.ArrayList;
   import java.util.jar.JarInputStream;
   import java.util.jar.JarOutputStream;
   import java.util.zip.ZipEntry;
  +
   import javax.management.MalformedObjectNameException;
   import javax.management.ObjectName;
  -import javax.naming.NamingException;
   
   import org.apache.geronimo.deployment.ConfigurationBuilder;
   import org.apache.geronimo.deployment.DeploymentContext;
   import org.apache.geronimo.deployment.DeploymentException;
  +import org.apache.geronimo.deployment.service.GBeanHelper;
   import org.apache.geronimo.deployment.util.XmlBeansUtil;
  -import org.apache.geronimo.deployment.service.GBeanBuilder;
   import org.apache.geronimo.gbean.GBeanInfo;
   import org.apache.geronimo.gbean.GBeanInfoFactory;
  -import org.apache.geronimo.gbean.GConstructorInfo;
  -import org.apache.geronimo.gbean.GReferenceInfo;
   import org.apache.geronimo.gbean.jmx.GBeanMBean;
   import org.apache.geronimo.jetty.JettyWebApplicationContext;
   import org.apache.geronimo.kernel.Kernel;
   import org.apache.geronimo.kernel.config.ConfigurationManager;
   import org.apache.geronimo.kernel.repository.Repository;
  -import org.apache.geronimo.xbeans.geronimo.jetty.JettyAttributeType;
  +import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
  +import org.apache.geronimo.naming.java.ComponentContextBuilder;
  +import org.apache.geronimo.naming.java.ReadOnlyContext;
  +import org.apache.geronimo.naming.jmx.JMXReferenceFactory;
   import org.apache.geronimo.xbeans.geronimo.jetty.JettyGbeanType;
  -import org.apache.geronimo.xbeans.geronimo.jetty.JettyReferenceType;
  -import org.apache.geronimo.xbeans.geronimo.jetty.JettyReferencesType;
  +import org.apache.geronimo.xbeans.geronimo.jetty.JettyLocalRefType;
   import org.apache.geronimo.xbeans.geronimo.jetty.JettyWebAppDocument;
   import org.apache.geronimo.xbeans.geronimo.jetty.JettyWebAppType;
  +import org.apache.geronimo.xbeans.j2ee.EnvEntryType;
   import org.apache.geronimo.xbeans.j2ee.WebAppDocument;
   import org.apache.geronimo.xbeans.j2ee.WebAppType;
  -import org.apache.geronimo.xbeans.j2ee.EnvEntryType;
  -import org.apache.geronimo.naming.java.ReadOnlyContext;
  -import org.apache.geronimo.naming.java.ComponentContextBuilder;
  -import org.apache.xmlbeans.SchemaType;
   import org.apache.xmlbeans.SchemaTypeLoader;
   import org.apache.xmlbeans.XmlBeans;
   import org.apache.xmlbeans.XmlException;
   import org.apache.xmlbeans.XmlObject;
  -import org.apache.xmlbeans.XmlOptions;
   
   /**
    *
  @@ -147,18 +144,7 @@
                   throw new DeploymentException(e);
               }
   
  -            // todo do we need to support include and dependency or can we rely on the
parent?
  -            // add low-level GBean definitions to the config
  -//            addIncludes(context, configType);
  -//            addDependencies(context, configType.getDependencyArray());
  -            ClassLoader cl = context.getClassLoader(repository);
  -            addGBeans(context, jettyWebApp.getGbeanArray(), cl);
  -
  -
  -            // add the GBean for the web application
  -            addWebAppGBean(context, webApp, jettyWebApp, module.getAbsoluteFile().toURI());
  -
  -            // todo do we need to add GBeans to make the servlets JSR77 ManagedObjects?
  +            buildGBeanConfiguration(context, jettyWebApp, webApp, module.getAbsoluteFile().toURI());
   
               context.close();
               os.flush();
  @@ -228,19 +214,9 @@
                   throw new DeploymentException("Did not find WEB-INF/web.xml in module");
               }
   
  -            // todo do we need to support include and dependency or can we rely on the
parent?
  -            // add low-level GBean definitions to the config
  -//            addIncludes(context, configType);
  -//            addDependencies(context, configType.getDependencyArray());
  -            ClassLoader cl = context.getClassLoader(repository);
  -            addGBeans(context, jettyWebApp.getGbeanArray(), cl);
  +            buildGBeanConfiguration(context, jettyWebApp, webApp, warRoot);
   
   
  -            // add the GBean for the web application
  -            addWebAppGBean(context, webApp, jettyWebApp, warRoot);
  -
  -            // todo do we need to add GBeans to make the servlets JSR77 ManagedObjects?
  -
               context.close();
               os.flush();
           } finally {
  @@ -248,7 +224,26 @@
           }
       }
   
  -    private void addWebAppGBean(DeploymentContext context, WebAppType webApp, JettyWebAppType
jettyWebApp, URI warRoot) throws DeploymentException {
  +    private void buildGBeanConfiguration(DeploymentContext context, JettyWebAppType jettyWebApp,
WebAppType webApp, URI warRoot) throws DeploymentException {
  +        // todo do we need to support include and dependency or can we rely on the parent?
  +        // add low-level GBean definitions to the config
  +//            addIncludes(context, configType);
  +//            addDependencies(context, configType.getDependencyArray());
  +        ClassLoader cl = context.getClassLoader(repository);
  +
  +        JettyGbeanType[] gbeans = jettyWebApp.getGbeanArray();
  +        for (int i = 0; i < gbeans.length; i++) {
  +            GBeanHelper.addGbean(new JettyGBeanAdapter(gbeans[i]), cl, context);
  +        }
  +
  +
  +        // add the GBean for the web application
  +        addWebAppGBean(context, webApp, jettyWebApp, warRoot, cl);
  +
  +        // todo do we need to add GBeans to make the servlets JSR77 ManagedObjects?
  +    }
  +
  +    private void addWebAppGBean(DeploymentContext context, WebAppType webApp, JettyWebAppType
jettyWebApp, URI warRoot, ClassLoader cl) throws DeploymentException {
           String contextRoot = jettyWebApp.getContextRoot().trim();
           if (contextRoot.length() == 0) {
               throw new DeploymentException("Missing value for context-root");
  @@ -268,7 +263,7 @@
               throw new DeploymentException("Unable to construct ObjectName", e);
           }
   
  -        ReadOnlyContext compContext = buildComponentContext(webApp, jettyWebApp);
  +        ReadOnlyContext compContext = buildComponentContext(webApp, jettyWebApp, cl);
   
           GBeanMBean gbean = new GBeanMBean(JettyWebApplicationContext.GBEAN_INFO);
           try {
  @@ -287,68 +282,26 @@
           context.addGBean(name, gbean);
       }
   
  -    private ReadOnlyContext buildComponentContext(WebAppType webApp, JettyWebAppType jettyWebApp)
throws DeploymentException {
  -        ComponentContextBuilder builder = new ComponentContextBuilder();
  +    private ReadOnlyContext buildComponentContext(WebAppType webApp, JettyWebAppType jettyWebApp,
ClassLoader cl) throws DeploymentException {
  +        ComponentContextBuilder builder = new ComponentContextBuilder(new JMXReferenceFactory());
           EnvEntryType[] envEntries = webApp.getEnvEntryArray();
  -        for (int i = 0; i < envEntries.length; i++) {
  -            EnvEntryType envEntry = envEntries[i];
  -            String name = envEntry.getEnvEntryName().getStringValue();
  -            String type = envEntry.getEnvEntryType().getStringValue();
  -            String text = envEntry.getEnvEntryValue().getStringValue();
  -            try {
  -                builder.addEnvEntry(name, type, text);
  -            } catch (NumberFormatException e) {
  -                throw new DeploymentException("Invalid env-entry value for name: " + name,
e);
  -            } catch (NamingException e) {
  -                throw new DeploymentException("Invalid env-entry definition for name: "
+ name, e);
  -            }
  -        }
  +        ENCConfigBuilder.addEnvEntries(envEntries, builder);
           // todo ejb-ref
           // todo ejb-local-ref
           // todo resource-ref
  +        Map resourceRefMap = new HashMap();
  +        JettyLocalRefType[] jettyResourceRefs = jettyWebApp.getResourceRefArray();
  +        for (int i = 0; i < jettyResourceRefs.length; i++) {
  +            JettyLocalRefType jettyResourceRef = jettyResourceRefs[i];
  +            resourceRefMap.put(jettyResourceRef.getRefName(), new JettyRefAdapter(jettyResourceRef));
  +        }
  +        ENCConfigBuilder.addResourceRefs(webApp.getResourceRefArray(), cl, resourceRefMap,
builder);
           // todo resource-env-ref
           // todo message-destination-ref
           // todo usertransaction
           return builder.getContext();
       }
   
  -    /**
  -     * Add any GBean explicitly defined in the deployment plan
  -     * @param context the context of this deployment
  -     * @param gbeans the XMLBeans for the <gbean> entries
  -     * @param cl the ClassLoader to use to load the GBeans
  -     * @throws DeploymentException if there is a problem with the plan
  -     */
  -    private void addGBeans(DeploymentContext context, JettyGbeanType[] gbeans, ClassLoader
cl) throws DeploymentException {
  -        for (int i = 0; i < gbeans.length; i++) {
  -            JettyGbeanType gbean = gbeans[i];
  -            GBeanBuilder builder = new GBeanBuilder(gbean.getName(), cl, gbean.getClass1());
  -
  -            // set up attributes
  -            JettyAttributeType[] attrs = gbean.getAttributeArray();
  -            for (int j = 0; j < attrs.length; j++) {
  -                JettyAttributeType attr = attrs[j];
  -                builder.setAttribute(attr.getName(), attr.getType(), attr.getStringValue());
  -            }
  -
  -            // set up all single pattern references
  -            JettyReferenceType[] refs = gbean.getReferenceArray();
  -            for (int j = 0; j < refs.length; j++) {
  -                JettyReferenceType ref = refs[j];
  -                builder.setReference(ref.getName(), ref.getStringValue());
  -            }
  -
  -            // set up app multi-patterned references
  -            JettyReferencesType[] refs2 = gbean.getReferencesArray();
  -            for (int j = 0; j < refs2.length; j++) {
  -                JettyReferencesType type = refs2[j];
  -                builder.setReference(type.getName(), type.getPatternArray());
  -            }
  -
  -            context.addGBean(builder.getName(), builder.getGBean());
  -        }
  -    }
  -
   
       private URI getParentID(JettyWebAppType jettyWebApp) throws DeploymentException {
           URI parentID;
  @@ -389,12 +342,12 @@
       static {
           GBeanInfoFactory infoFactory = new GBeanInfoFactory(WARConfigBuilder.class);
           infoFactory.addInterface(ConfigurationBuilder.class);
  -        infoFactory.addReference(new GReferenceInfo("Repository", Repository.class));
  -        infoFactory.addReference(new GReferenceInfo("Kernel", Kernel.class));
  -        infoFactory.setConstructor(new GConstructorInfo(
  +        infoFactory.addReference("Repository", Repository.class);
  +        infoFactory.addReference("Kernel", Kernel.class);
  +        infoFactory.setConstructor(
                   new String[]{"Kernel", "Repository"},
                   new Class[]{Kernel.class, Repository.class}
  -        ));
  +        );
           GBEAN_INFO = infoFactory.getBeanInfo();
       }
   
  
  
  
  1.13      +74 -34    incubator-geronimo/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WebAppDConfigBean.java
  
  Index: WebAppDConfigBean.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WebAppDConfigBean.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- WebAppDConfigBean.java	25 Feb 2004 09:57:44 -0000	1.12
  +++ WebAppDConfigBean.java	9 Mar 2004 18:03:52 -0000	1.13
  @@ -23,10 +23,12 @@
   import javax.enterprise.deploy.spi.exceptions.ConfigurationException;
   
   import org.apache.geronimo.deployment.plugin.DConfigBeanSupport;
  -//import org.apache.geronimo.naming.deployment.ENCHelper;
  +import org.apache.geronimo.naming.deployment.ENCHelper;
  +import org.apache.geronimo.naming.deployment.RefAdapter;
  +import org.apache.geronimo.xbeans.geronimo.jetty.JettyLocalRefType;
  +import org.apache.geronimo.xbeans.geronimo.jetty.JettyRemoteRefType;
   import org.apache.geronimo.xbeans.geronimo.jetty.JettyWebAppType;
   import org.apache.xmlbeans.SchemaTypeLoader;
  -import org.apache.xmlbeans.XmlBeans;
   
   /**
    *
  @@ -35,78 +37,118 @@
    */
   public class WebAppDConfigBean extends DConfigBeanSupport {
   
  -//    private ENCHelper encHelper;
  +    private ENCHelper encHelper;
   
       WebAppDConfigBean(DDBean ddBean, JettyWebAppType webApp) {
           super(ddBean, webApp);
  -/*
  -        encHelper = new ENCHelper(ddBean, new ENCHelper.XmlEnvRefs() {
  -            public GerEjbRefType[] getEjbRefs() {
  -                return getWebApp().getEjbRefArray();
  +
  +        ENCHelper.XmlEnvRefs envRefs = new ENCHelper.XmlEnvRefs() {
  +            public RefAdapter[] getEjbRefs() {
  +                return wrapArray(getWebApp().getEjbRefArray());
  +            }
  +
  +            public RefAdapter addNewEjbRef() {
  +                return new JettyRefAdapter(getWebApp().addNewEjbRef());
               }
   
  -            public GerEjbRefType addNewEjbRef() {
  -                return getWebApp().addNewEjbRef();
  +            public void setEjbRef(int i, RefAdapter refAdapter) {
  +                getWebApp().setEjbRefArray(i, (JettyRemoteRefType) refAdapter.getXmlObject());
  +                refAdapter.setXmlObject(getWebApp().getEjbRefArray(i));
               }
   
               public void removeEjbRef(int i) {
                   getWebApp().removeEjbRef(i);
               }
   
  -            public GerEjbLocalRefType[] getEjbLocalRefs() {
  -                return getWebApp().getEjbLocalRefArray();
  +            public RefAdapter[] getEjbLocalRefs() {
  +                return wrapArray(getWebApp().getEjbLocalRefArray());
               }
   
  -            public GerEjbLocalRefType addNewEjbLocalRef() {
  -                return getWebApp().addNewEjbLocalRef();
  +            public RefAdapter addNewEjbLocalRef() {
  +                return new JettyRefAdapter(getWebApp().addNewEjbLocalRef());
  +            }
  +
  +            public void setEjbLocalRef(int i, RefAdapter refAdapter) {
  +                getWebApp().setEjbLocalRefArray(i, (JettyLocalRefType) refAdapter.getXmlObject());
  +                refAdapter.setXmlObject(getWebApp().getEjbLocalRefArray(i));
               }
   
               public void removeEjbLocalRef(int i) {
                   getWebApp().removeEjbLocalRef(i);
               }
   
  -            public GerMessageDestinationRefType[] getMessageDestinationRefs() {
  -                return getWebApp().getMessageDestinationRefArray();
  +            public RefAdapter[] getMessageDestinationRefs() {
  +                return wrapArray(getWebApp().getMessageDestinationRefArray());
  +            }
  +
  +            public RefAdapter addNewMessageDestinationRef() {
  +                return new JettyRefAdapter(getWebApp().addNewMessageDestinationRef());
               }
   
  -            public GerMessageDestinationRefType addNewMessageDestinationRef() {
  -                return getWebApp().addNewMessageDestinationRef();
  +            public void setMessageDestinationRef(int i, RefAdapter refAdapter) {
  +                getWebApp().setMessageDestinationRefArray(i, (JettyLocalRefType) refAdapter.getXmlObject());
  +                refAdapter.setXmlObject(getWebApp().getMessageDestinationRefArray(i));
               }
   
               public void removeMessageDestinationRef(int i) {
                   getWebApp().removeMessageDestinationRef(i);
               }
   
  -            public GerResourceEnvRefType[] getResourceEnvRefs() {
  -                return getWebApp().getResourceEnvRefArray();
  +            public RefAdapter[] getResourceEnvRefs() {
  +                return wrapArray(getWebApp().getResourceEnvRefArray());
  +            }
  +
  +            public RefAdapter addNewResourceEnvRef() {
  +                return new JettyRefAdapter(getWebApp().addNewResourceEnvRef());
               }
   
  -            public GerResourceEnvRefType addNewResourceEnvRef() {
  -                return getWebApp().addNewResourceEnvRef();
  +            public void setResourceEnvRef(int i, RefAdapter refAdapter) {
  +                getWebApp().setResourceEnvRefArray(i, (JettyLocalRefType) refAdapter.getXmlObject());
  +                refAdapter.setXmlObject(getWebApp().getResourceEnvRefArray(i));
               }
   
               public void removeResourceEnvRef(int i) {
                   getWebApp().removeResourceEnvRef(i);
               }
   
  -            public GerResourceRefType[] getResourceRefs() {
  -                return getWebApp().getResourceRefArray();
  +            public RefAdapter[] getResourceRefs() {
  +                return wrapArray(getWebApp().getResourceRefArray());
               }
   
  -            public GerResourceRefType addNewResourceRef() {
  -                return getWebApp().addNewResourceRef();
  +            public RefAdapter addNewResourceRef() {
  +                return new JettyRefAdapter(getWebApp().addNewResourceRef());
  +            }
  +
  +            public void setResourceRef(int i, RefAdapter refAdapter) {
  +                getWebApp().setResourceRefArray(i, (JettyLocalRefType) refAdapter.getXmlObject());
  +                refAdapter.setXmlObject(getWebApp().getResourceRefArray(i));
               }
   
               public void removeResourceRef(int i) {
                   getWebApp().removeResourceRef(i);
               }
   
  -        });
  -*/
  +            private RefAdapter[] wrapArray(JettyRemoteRefType[] refs) {
  +                RefAdapter[] wrapped = new RefAdapter[refs.length];
  +                for (int i = 0; i < refs.length; i++) {
  +                    wrapped[i] = new JettyRefAdapter(refs[i]);
  +                }
  +                return wrapped;
  +            }
  +
  +        };
  +        //which version are we dealing with?
  +        String version = ddBean.getRoot().getAttributeValue("version");
  +        if ("2.4".equals(version)) {
  +            encHelper = new ENCHelper(ddBean, envRefs, getXPathsForJ2ee_1_4(ENCHelper.ENC_XPATHS),
getXPathsForJ2ee_1_4(ENCHelper.NAME_XPATHS));
  +        } else {
  +            encHelper = new ENCHelper(ddBean, envRefs, getXPathsWithPrefix(null, ENCHelper.ENC_XPATHS),
getXPathsWithPrefix(null, ENCHelper.NAME_XPATHS));
  +        }
  +
       }
   
       JettyWebAppType getWebApp() {
  -        return (JettyWebAppType)getXmlObject();
  +        return (JettyWebAppType) getXmlObject();
       }
   
       public String getContextRoot() {
  @@ -136,17 +178,15 @@
       }
   
       public DConfigBean getDConfigBean(DDBean ddBean) throws ConfigurationException {
  -        return null;
  -//        return encHelper.getDConfigBean(ddBean);
  +        return encHelper.getDConfigBean(ddBean);
       }
   
       public void removeDConfigBean(DConfigBean dcBean) throws BeanNotFoundException {
  -        //encHelper.removeDConfigBean(dcBean);
  +        encHelper.removeDConfigBean(dcBean);
       }
   
       public String[] getXpaths() {
  -        return null;
  -//        return ENCHelper.ENC_XPATHS;
  +        return getXPathsForJ2ee_1_4(ENCHelper.ENC_XPATHS);
       }
   
       protected SchemaTypeLoader getSchemaTypeLoader() {
  
  
  
  1.1                  incubator-geronimo/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyGBeanAdapter.java
  
  Index: JettyGBeanAdapter.java
  ===================================================================
  /**
   *
   * Copyright 2004 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.jetty.deployment;
  
  import org.apache.geronimo.deployment.service.GBeanAdapter;
  import org.apache.geronimo.xbeans.geronimo.jetty.JettyGbeanType;
  
  /**
   *
   *
   * @version $Revision: 1.1 $ $Date: 2004/03/09 18:03:52 $
   *
   * */
  public class JettyGBeanAdapter implements GBeanAdapter {
  
      private final JettyGbeanType gbean;
  
      public JettyGBeanAdapter(JettyGbeanType gbean) {
          this.gbean = gbean;
      }
  
      public String getName() {
          return gbean.getName();
      }
  
      public String getClass1() {
          return gbean.getClass1();
      }
  
      public int getAttributeCount() {
          return gbean.getAttributeArray().length;
      }
  
      public String getAttributeName(int i) {
          return gbean.getAttributeArray(i).getName();
      }
  
      public String getAttributeType(int i) {
          return gbean.getAttributeArray(i).getType();
      }
  
      public String getAttributeStringValue(int i) {
          return gbean.getAttributeArray(i).getStringValue();
      }
  
      public int getReferenceCount() {
          return gbean.getReferenceArray().length;
      }
  
      public String getReferenceName(int i) {
          return gbean.getReferenceArray(i).getName();
      }
  
      public String getReferenceStringValue(int i) {
          return gbean.getReferenceArray(i).getStringValue();
      }
  
      public int getReferencesCount() {
          return gbean.getReferencesArray().length;
      }
  
      public String getReferencesName(int i) {
          return gbean.getReferencesArray(i).getName();
      }
  
      public String[] getReferencesPatternArray(int i) {
          return gbean.getReferencesArray(i).getPatternArray();
      }
  }
  
  
  
  1.1                  incubator-geronimo/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyRefAdapter.java
  
  Index: JettyRefAdapter.java
  ===================================================================
  /**
   *
   * Copyright 2004 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.jetty.deployment;
  
  import org.apache.geronimo.naming.deployment.RefAdapter;
  import org.apache.geronimo.xbeans.geronimo.jetty.JettyRemoteRefType;
  import org.apache.xmlbeans.XmlObject;
  
  /**
   *
   *
   * @version $Revision: 1.1 $ $Date: 2004/03/09 18:03:52 $
   *
   * */
  public class JettyRefAdapter implements RefAdapter {
  
      private JettyRemoteRefType ref;
  
      public JettyRefAdapter(JettyRemoteRefType ref) {
          this.ref = ref;
      }
  
      public XmlObject getXmlObject() {
          return ref;
      }
  
      public void setXmlObject(XmlObject xmlObject) {
          ref = (JettyRemoteRefType)xmlObject;
      }
  
      public String getRefName() {
          return ref.getRefName();
      }
  
      public void setRefName(String name) {
          ref.setRefName(name);
      }
  
      public String getServerName() {
          return ref.getServer();
      }
  
      public void setServerName(String serverName) {
          ref.setServer(serverName);
      }
  
      public String getKernelName() {
          return ref.getKernelName();
      }
  
      public void setKernelName(String kernelName) {
          ref.setKernelName(kernelName);
      }
  
      public String getTargetName() {
          return ref.getTargetName();
      }
  
      public void setTargetName(String targetName) {
          ref.setTargetName(targetName);
      }
  
      public String getExternalUri() {
          return ref.getExternalUri();
      }
  
      public void setExternalUri(String externalURI) {
          ref.setExternalUri(externalURI);
      }
  
  }
  
  
  
  1.6       +22 -4     incubator-geronimo/modules/jetty/src/schema/geronimo-jetty.xsd
  
  Index: geronimo-jetty.xsd
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/jetty/src/schema/geronimo-jetty.xsd,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- geronimo-jetty.xsd	20 Feb 2004 07:19:13 -0000	1.5
  +++ geronimo-jetty.xsd	9 Mar 2004 18:03:52 -0000	1.6
  @@ -11,6 +11,7 @@
       <xs:import namespace="http://geronimo.apache.org/xml/ns/j2ee" schemaLocation="../../../naming/src/schema/geronimo-naming.xsd"/>
       <xs:import namespace="http://geronimo.apache.org/xml/ns/security" schemaLocation="../../../security/src/schema/geronimo-security.xsd"/>
   -->
  +    <xs:include schemaLocation="../../../naming/src/schema/geronimo-naming.xsd"/>
       <xs:include schemaLocation="../../../deployment/src/schema/geronimo-common.xsd"/>
   
       <xs:element name="web-app" type="jetty:web-appType"/>
  @@ -19,10 +20,27 @@
           <xs:sequence>
               <xs:element name="context-root" type="xs:string"/>
               <xs:element name="context-priority-classloader" type="xs:boolean"/>
  -<!--
  -            <xs:group ref="ger:jndiEnvironmentRefsGroup"/>
  -            <xs:element name="security" type="sec:securityType" minOccurs="0"/>
  --->
  +
  +            <!--xs:group ref="jetty:jndiEnvironmentRefsGroup"/-->
  +            <xs:element name="ejb-ref"
  +                type="jetty:remote-refType"
  +                minOccurs="0" maxOccurs="unbounded"/>
  +            <xs:element name="ejb-local-ref"
  +                type="jetty:local-refType"
  +                minOccurs="0" maxOccurs="unbounded"/>
  +            <!-- leave web services out until I know what they do -->
  +            <!--xsd:group ref="service-refGroup"/-->
  +            <xs:element name="resource-ref"
  +                type="jetty:local-refType"
  +                minOccurs="0" maxOccurs="unbounded"/>
  +            <xs:element name="resource-env-ref"
  +                type="jetty:local-refType"
  +                minOccurs="0" maxOccurs="unbounded"/>
  +            <xs:element name="message-destination-ref"
  +                type="jetty:remote-refType"
  +                minOccurs="0" maxOccurs="unbounded"/>
  +            <!--xs:element name="security" type="sec:securityType" minOccurs="0"/-->
  +
               <xs:element name="gbean" type="jetty:gbeanType" minOccurs="0" maxOccurs="unbounded"/>
           </xs:sequence>
           <xs:attribute name="configId" type="xs:string" use="required"/>
  
  
  

Mime
View raw message