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/connector/src/test-data/connector_1_5 geronimo-ra.xml
Date Mon, 09 Feb 2004 23:13:28 GMT
djencks     2004/02/09 15:13:28

  Modified:    modules/connector/src/java/org/apache/geronimo/connector/deployment
                        Connector_1_0Module.java Connector_1_5Module.java
               modules/connector/src/schema geronimo-connector_1_5.xsd
                        xmlconfig.xml
               modules/connector/src/test-data/connector_1_0
                        geronimo-ra.xml
               modules/connector/src/test-data/connector_1_5
                        geronimo-ra.xml
  Added:       modules/connector/src/java/org/apache/geronimo/connector/deployment/dconfigbean
                        AdminObjectDConfigBean.java
                        AdminObjectInstanceDConfigBean.java
                        ConfigPropertiesHelper.java
                        ConfigPropertySettingDConfigBean.java
                        ConnectionDefinitionDConfigBean.java
                        ConnectionDefinitionInstanceDConfigBean.java
                        ConnectionManagerDConfigBean.java
                        ResourceAdapterDConfigBean.java
                        ResourceAdapterDConfigRoot.java
  Log:
  initial, untested, dconfigbean impl for connector, as a subject for discussion
  
  Revision  Changes    Path
  1.1                  incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/dconfigbean/AdminObjectDConfigBean.java
  
  Index: AdminObjectDConfigBean.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Geronimo" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Geronimo", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * ====================================================================
   */
  
  package org.apache.geronimo.connector.deployment.dconfigbean;
  
  import javax.enterprise.deploy.model.DDBean;
  
  import org.apache.geronimo.deployment.plugin.DConfigBeanSupport;
  import org.apache.geronimo.xbeans.geronimo.GerAdminobjectType;
  import org.apache.geronimo.xbeans.geronimo.GerAdminobjectInstanceType;
  import org.apache.xmlbeans.SchemaTypeLoader;
  import org.apache.xmlbeans.XmlBeans;
  
  /**
   *
   *
   * @version $Revision: 1.1 $ $Date: 2004/02/09 23:13:27 $
   *
   * */
  public class AdminObjectDConfigBean extends DConfigBeanSupport {
      private final static SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.getContextTypeLoader();
      private final static String[] ADMIN_OBJECT_XPATHS = {};
  
      public AdminObjectDConfigBean(DDBean ddBean, GerAdminobjectType adminObject) {
          super(ddBean, adminObject, SCHEMA_TYPE_LOADER);
          String adminObjectInterface = ddBean.getText("adminobject-interface")[0];
          if (adminObject.getAdminobjectInterface() == null) {
              adminObject.addNewAdminobjectInterface().setStringValue(adminObjectInterface);
          } else {
              assert adminObjectInterface.equals(adminObject.getAdminobjectInterface().getStringValue());
          }
          String adminObjectClass = ddBean.getText("adminobject-class")[0];
          if (adminObject.getAdminobjectClass() == null) {
              adminObject.addNewAdminobjectClass().setStringValue(adminObjectClass);
          } else {
              assert adminObjectClass.equals(adminObject.getAdminobjectClass().getStringValue());
          }
      }
  
      GerAdminobjectType getAdminObject() {
          return (GerAdminobjectType)getXmlObject();
      }
  
      public AdminObjectInstanceDConfigBean[] getAdminObjectInstance() {
          GerAdminobjectInstanceType[] adminobjectInstances = getAdminObject().getAdminobjectInstanceArray();
          AdminObjectInstanceDConfigBean[] adminObjectInstanceDConfigBeans = new AdminObjectInstanceDConfigBean[adminobjectInstances.length];
          for (int i = 0; i < adminobjectInstances.length; i++) {
              GerAdminobjectInstanceType adminobjectInstance = adminobjectInstances[i];
              adminObjectInstanceDConfigBeans[i] = new AdminObjectInstanceDConfigBean(getDDBean(), adminobjectInstance);
          }
          return adminObjectInstanceDConfigBeans;
      }
  
      public void setAdminObjectInstance(AdminObjectInstanceDConfigBean[] adminObjectInstanceDConfigBeans) {
          GerAdminobjectInstanceType[] adminobjectInstances = new GerAdminobjectInstanceType[adminObjectInstanceDConfigBeans.length];
          for (int i = 0; i < adminObjectInstanceDConfigBeans.length; i++) {
              AdminObjectInstanceDConfigBean adminObjectInstanceDConfigBean = adminObjectInstanceDConfigBeans[i];
              if (adminObjectInstanceDConfigBean == null) {
                  throw new IllegalStateException("the " + i + "th adminobject instance was null");
              }
              adminobjectInstances[i] = adminObjectInstanceDConfigBean.getAdminobjectInstance();
              if (adminobjectInstances[i] == null) {
                  adminobjectInstances[i] = GerAdminobjectInstanceType.Factory.newInstance();
              }
          }
          //this will copy all the xmlobjects.
          getAdminObject().setAdminobjectInstanceArray(adminobjectInstances);
          //get the new copies
          GerAdminobjectInstanceType[] newAdminobjectInstances = getAdminObject().getAdminobjectInstanceArray();
          for (int i = 0; i < newAdminobjectInstances.length; i++) {
              GerAdminobjectInstanceType newAdminobjectInstance = newAdminobjectInstances[i];
              adminObjectInstanceDConfigBeans[i].setParent(getDDBean(), newAdminobjectInstance);
          }
      }
  
      public String[] getXpaths() {
          return ADMIN_OBJECT_XPATHS;
      }
  
  }
  
  
  
  1.1                  incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/dconfigbean/AdminObjectInstanceDConfigBean.java
  
  Index: AdminObjectInstanceDConfigBean.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Geronimo" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Geronimo", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * ====================================================================
   */
  
  package org.apache.geronimo.connector.deployment.dconfigbean;
  
  import java.util.HashMap;
  import java.util.Map;
  
  import javax.enterprise.deploy.model.DDBean;
  import javax.enterprise.deploy.spi.DConfigBean;
  import javax.enterprise.deploy.spi.exceptions.ConfigurationException;
  
  import org.apache.geronimo.deployment.plugin.DConfigBeanSupport;
  import org.apache.geronimo.xbeans.geronimo.GerAdminobjectInstanceType;
  import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType;
  import org.apache.xmlbeans.SchemaTypeLoader;
  import org.apache.xmlbeans.XmlBeans;
  
  /**
   *
   *
   * @version $Revision: 1.1 $ $Date: 2004/02/09 23:13:27 $
   *
   * */
  public class AdminObjectInstanceDConfigBean extends DConfigBeanSupport{
      private final static SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.getContextTypeLoader();
  
      private final static String[] ADMIN_OBJECT_INSTANCE_XPATHS = {
          "config-property"};
      private Map configPropertiesMap = new HashMap();
  
      public AdminObjectInstanceDConfigBean() {
          super(null, null, SCHEMA_TYPE_LOADER);
      }
  
      public AdminObjectInstanceDConfigBean(DDBean ddBean, final GerAdminobjectInstanceType adminobjectInstance) {
          super(ddBean, adminobjectInstance, SCHEMA_TYPE_LOADER);
          initialize(ddBean, adminobjectInstance);
      }
  
      void setParent(DDBean ddBean, final GerAdminobjectInstanceType adminobjectInstance) {
          super.setParent(ddBean, adminobjectInstance);
          initialize(ddBean, adminobjectInstance);
      }
  
      private void initialize(DDBean ddBean, final GerAdminobjectInstanceType adminobjectInstance) {
          ConfigPropertiesHelper.initializeConfigSettings(ddBean, new ConfigPropertiesHelper.ConfigPropertiesSource() {
              public GerConfigPropertySettingType[] getConfigPropertySettingArray() {
                  return adminobjectInstance.getConfigPropertySettingArray();
              }
  
              public GerConfigPropertySettingType addNewConfigPropertySetting() {
                  return adminobjectInstance.addNewConfigPropertySetting();
              }
  
          }, configPropertiesMap);
      }
  
  
      GerAdminobjectInstanceType getAdminobjectInstance() {
          return (GerAdminobjectInstanceType)getXmlObject();
      }
  
      public String getAdminObjectName() {
          return getAdminobjectInstance().getAdminobjectName();
      }
  
      public void setAdminObjectName(String adminObjectName) {
          getAdminobjectInstance().setAdminobjectName(adminObjectName);
      }
  
      public DConfigBean getDConfigBean(DDBean bean) throws ConfigurationException {
          String xpath = bean.getXpath();
          if (xpath.endsWith("/config-property")) {
              String configPropertyName = bean.getText("config-property-name")[0];
              ConfigPropertySettingDConfigBean configPropertySetting = (ConfigPropertySettingDConfigBean) configPropertiesMap.get(configPropertyName);
              assert configPropertySetting != null;
              return configPropertySetting;
          }
          return null;
      }
  
  
      public String[] getXpaths() {
          return ADMIN_OBJECT_INSTANCE_XPATHS;
      }
  
  
  }
  
  
  
  1.1                  incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertiesHelper.java
  
  Index: ConfigPropertiesHelper.java
  ===================================================================
  package org.apache.geronimo.connector.deployment.dconfigbean;
  
  import java.util.Map;
  
  import javax.enterprise.deploy.model.DDBean;
  
  import org.apache.geronimo.xbeans.geronimo.GerResourceadapterType;
  import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType;
  
  /**
   *
   *
   * @version $Revision: 1.1 $ $Date: 2004/02/09 23:13:27 $
   *
   * */
  public class ConfigPropertiesHelper {
  
      public static void initializeConfigSettings(DDBean ddBean, ConfigPropertiesSource configPropertiesSource, Map configPropertiesMap) {
          DDBean[] configProperties = ddBean.getChildBean("config-property");
          GerConfigPropertySettingType[] configPropertySettings = configPropertiesSource.getConfigPropertySettingArray();
  
          if (configPropertySettings.length == 0) {
              //we are new
              for (int i = 0; i < configProperties.length; i++) {
                  DDBean configProperty = configProperties[i];
                  GerConfigPropertySettingType configPropertySetting = configPropertiesSource.addNewConfigPropertySetting();
                  String name = configProperty.getText("config-property-name")[0];
                  ConfigPropertySettingDConfigBean configPropertySettingDConfigBean = new ConfigPropertySettingDConfigBean(configProperty, configPropertySetting);
                  configPropertiesMap.put(name, configPropertySettingDConfigBean);
              }
          } else {
              //we are read in from xml.  Check correct length
              assert configProperties.length == configPropertySettings.length;
              for (int i = 0; i < configProperties.length; i++) {
                  DDBean configProperty = configProperties[i];
                  GerConfigPropertySettingType configPropertySetting = configPropertySettings[i];
                  String name = configProperty.getText("config-property-name")[0];
                  assert name.equals(configPropertySetting.getName());
                  ConfigPropertySettingDConfigBean configPropertySettingDConfigBean = new ConfigPropertySettingDConfigBean(configProperty, configPropertySetting);
                  configPropertiesMap.put(name, configPropertySettingDConfigBean);
              }
          }
      }
  
      public interface ConfigPropertiesSource {
          GerConfigPropertySettingType[] getConfigPropertySettingArray();
          GerConfigPropertySettingType addNewConfigPropertySetting();
      }
  }
  
  
  
  1.1                  incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertySettingDConfigBean.java
  
  Index: ConfigPropertySettingDConfigBean.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Geronimo" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Geronimo", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * ====================================================================
   */
  
  package org.apache.geronimo.connector.deployment.dconfigbean;
  
  import javax.enterprise.deploy.model.DDBean;
  
  import org.apache.geronimo.deployment.plugin.DConfigBeanSupport;
  import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType;
  import org.apache.xmlbeans.SchemaTypeLoader;
  import org.apache.xmlbeans.XmlBeans;
  
  /**
   *
   *
   * @version $Revision: 1.1 $ $Date: 2004/02/09 23:13:27 $
   *
   * */
  public class ConfigPropertySettingDConfigBean extends DConfigBeanSupport {
      private final static SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.getContextTypeLoader();
      private final static String[] CONFIG_PROPERTY_SETTING_XPATHS = {"config-property"};
  
      public ConfigPropertySettingDConfigBean(DDBean ddBean, GerConfigPropertySettingType configPropertySetting) {
          super(ddBean, configPropertySetting, SCHEMA_TYPE_LOADER);
          String name = ddBean.getText("config-property-name")[0];
          if (configPropertySetting.getName() == null) {
              configPropertySetting.setName(name);
              String value = ddBean.getText("config-property-value")[0];
              if (value != null) {
                  configPropertySetting.setStringValue(value);
              }
          } else {
              assert name.equals(configPropertySetting.getName());
          }
      }
  
      GerConfigPropertySettingType getConfigPropertySetting() {
          return (GerConfigPropertySettingType)getXmlObject();
      }
  
      public String getConfigPropertyName() {
          return getConfigPropertySetting().getName();
      }
  
      //TODO this needs research about if it works.
      public String getConfigPropertyType() {
          return getDDBean().getText("config-property/config-property-type")[0];
      }
  
      public String getConfigPropertyValue() {
          return getConfigPropertySetting().getStringValue();
      }
  
      public void setConfigPropertyValue(String configPropertyValue) {
          getConfigPropertySetting().setStringValue(configPropertyValue);
      }
      public String[] getXpaths() {
          return CONFIG_PROPERTY_SETTING_XPATHS;
      }
  }
  
  
  
  1.1                  incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionDConfigBean.java
  
  Index: ConnectionDefinitionDConfigBean.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Geronimo" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Geronimo", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * ====================================================================
   */
  
  package org.apache.geronimo.connector.deployment.dconfigbean;
  
  import javax.enterprise.deploy.model.DDBean;
  
  import org.apache.geronimo.deployment.plugin.DConfigBeanSupport;
  import org.apache.geronimo.xbeans.geronimo.GerConnectionDefinitionType;
  import org.apache.geronimo.xbeans.geronimo.GerConnectiondefinitionInstanceType;
  import org.apache.xmlbeans.SchemaTypeLoader;
  import org.apache.xmlbeans.XmlBeans;
  
  /**
   *
   *
   * @version $Revision: 1.1 $ $Date: 2004/02/09 23:13:27 $
   *
   * */
  public class ConnectionDefinitionDConfigBean extends DConfigBeanSupport {
      private final static SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.getContextTypeLoader();
      private final static String[] CONNECTION_DEFINITION_XPATHS = {};
  
      public ConnectionDefinitionDConfigBean(DDBean ddBean, GerConnectionDefinitionType connectionDefinition) {
          super(ddBean, connectionDefinition, SCHEMA_TYPE_LOADER);
          String connectionfactoryInterface = ddBean.getText("connectionfactory-interface")[0];
          if (connectionDefinition.getConnectionfactoryInterface() == null) {
              connectionDefinition.addNewConnectionfactoryInterface().setStringValue(connectionfactoryInterface);
          } else {
              assert connectionfactoryInterface.equals(connectionDefinition.getConnectionfactoryInterface().getStringValue());
          }
      }
  
      GerConnectionDefinitionType getConnectionDefinition() {
          return (GerConnectionDefinitionType)getXmlObject();
      }
  
      public ConnectionDefinitionInstanceDConfigBean[] getConnectionDefinitionInstance() {
          GerConnectiondefinitionInstanceType[] connectiondefinitionInstances = getConnectionDefinition().getConnectiondefinitionInstanceArray();
          ConnectionDefinitionInstanceDConfigBean[] connectiondefinitionInstanceDConfigBeans = new ConnectionDefinitionInstanceDConfigBean[connectiondefinitionInstances.length];
          for (int i = 0; i < connectiondefinitionInstances.length; i++) {
              GerConnectiondefinitionInstanceType connectiondefinitionInstance = connectiondefinitionInstances[i];
              connectiondefinitionInstanceDConfigBeans[i] = new ConnectionDefinitionInstanceDConfigBean(getDDBean(), connectiondefinitionInstance);
          }
          return connectiondefinitionInstanceDConfigBeans;
      }
  
      public void setConnectionDefinitionInstance(ConnectionDefinitionInstanceDConfigBean[] connectiondefinitionInstanceDConfigBeans) {
          GerConnectiondefinitionInstanceType[] connectiondefinitionInstances = new GerConnectiondefinitionInstanceType[connectiondefinitionInstanceDConfigBeans.length];
          for (int i = 0; i < connectiondefinitionInstanceDConfigBeans.length; i++) {
              ConnectionDefinitionInstanceDConfigBean connectiondefinitionInstanceDConfigBean = connectiondefinitionInstanceDConfigBeans[i];
              if (connectiondefinitionInstanceDConfigBean == null) {
                  throw new IllegalStateException("the " + i + "th connectiondefinition instance was null");
              }
              connectiondefinitionInstances[i] = connectiondefinitionInstanceDConfigBean.getConnectiondefinitionInstance();
              if (connectiondefinitionInstances[i] == null) {
                  connectiondefinitionInstances[i] = GerConnectiondefinitionInstanceType.Factory.newInstance();
              }
          }
          //this will copy all the xmlobjects.
          getConnectionDefinition().setConnectiondefinitionInstanceArray(connectiondefinitionInstances);
          //get the new copies
          GerConnectiondefinitionInstanceType[] newconnectiondefinitionInstances = getConnectionDefinition().getConnectiondefinitionInstanceArray();
          for (int i = 0; i < newconnectiondefinitionInstances.length; i++) {
              GerConnectiondefinitionInstanceType newconnectiondefinitionInstance = newconnectiondefinitionInstances[i];
              connectiondefinitionInstanceDConfigBeans[i].setParent(getDDBean(), newconnectiondefinitionInstance);
          }
      }
  
      public String[] getXpaths() {
          return CONNECTION_DEFINITION_XPATHS;
      }
  
  
  }
  
  
  
  1.1                  incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionInstanceDConfigBean.java
  
  Index: ConnectionDefinitionInstanceDConfigBean.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Geronimo" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Geronimo", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * ====================================================================
   */
  
  package org.apache.geronimo.connector.deployment.dconfigbean;
  
  import java.util.HashMap;
  import java.util.Map;
  
  import javax.enterprise.deploy.model.DDBean;
  import javax.enterprise.deploy.spi.DConfigBean;
  import javax.enterprise.deploy.spi.exceptions.ConfigurationException;
  
  import org.apache.geronimo.deployment.plugin.DConfigBeanSupport;
  import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType;
  import org.apache.geronimo.xbeans.geronimo.GerConnectiondefinitionInstanceType;
  import org.apache.geronimo.xbeans.geronimo.GerConnectionmanagerType;
  import org.apache.xmlbeans.SchemaTypeLoader;
  import org.apache.xmlbeans.XmlBeans;
  
  /**
   *
   *
   * @version $Revision: 1.1 $ $Date: 2004/02/09 23:13:27 $
   *
   * */
  public class ConnectionDefinitionInstanceDConfigBean extends DConfigBeanSupport {
      private final static SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.getContextTypeLoader();
  
      private final static String[] CONNECTION_DEFINITION_INSTANCE_XPATHS = {
          "config-property"};
      private Map configPropertiesMap = new HashMap();
  
      private ConnectionManagerDConfigBean connectionManagerDConfigBean;
  
      public ConnectionDefinitionInstanceDConfigBean() {
          super(null, null, SCHEMA_TYPE_LOADER);
      }
  
      public ConnectionDefinitionInstanceDConfigBean(DDBean ddBean, final GerConnectiondefinitionInstanceType connectiondefinitionInstance) {
          super(ddBean, connectiondefinitionInstance, SCHEMA_TYPE_LOADER);
          initialize(ddBean, connectiondefinitionInstance);
      }
  
      void setParent(DDBean ddBean, final GerConnectiondefinitionInstanceType connectiondefinitionInstance){
          super.setParent(ddBean, connectiondefinitionInstance);
          initialize(ddBean, connectiondefinitionInstance);
      }
  
      private void initialize(DDBean ddBean, final GerConnectiondefinitionInstanceType connectiondefinitionInstance) {
          ConfigPropertiesHelper.initializeConfigSettings(ddBean, new ConfigPropertiesHelper.ConfigPropertiesSource() {
              public GerConfigPropertySettingType[] getConfigPropertySettingArray() {
                  return connectiondefinitionInstance.getConfigPropertySettingArray();
              }
  
              public GerConfigPropertySettingType addNewConfigPropertySetting() {
                  return connectiondefinitionInstance.addNewConfigPropertySetting();
              }
  
          }, configPropertiesMap);
          GerConnectionmanagerType connectionmanagerType;
          if (connectiondefinitionInstance.getConnectionmanager() == null) {
              connectionmanagerType = connectiondefinitionInstance.addNewConnectionmanager();
          } else {
              connectionmanagerType = connectiondefinitionInstance.getConnectionmanager();
          }
          if (connectionManagerDConfigBean == null) {
          connectionManagerDConfigBean = new ConnectionManagerDConfigBean(ddBean, connectionmanagerType);
          } else {
              connectionManagerDConfigBean.setParent(ddBean, connectionmanagerType);
          }
      }
  
  
      GerConnectiondefinitionInstanceType getConnectiondefinitionInstance() {
          return (GerConnectiondefinitionInstanceType)getXmlObject();
      }
  
      public String getName() {
          return getConnectiondefinitionInstance().getName();
      }
  
      public void setName(String name) {
          getConnectiondefinitionInstance().setName(name);
      }
  
      public String getGlobalJNDIName() {
          return getConnectiondefinitionInstance().getGlobalJndiName();
      }
  
      public void setGlobalJNDIName(String globalJNDIName) {
          getConnectiondefinitionInstance().setGlobalJndiName(globalJNDIName);
      }
  
      public ConnectionManagerDConfigBean getConnectionManagerDConfigBean() {
          return connectionManagerDConfigBean;
      }
  
      public DConfigBean getDConfigBean(DDBean bean) throws ConfigurationException {
          String xpath = bean.getXpath();
          if (xpath.endsWith("/config-property")) {
              String configPropertyName = bean.getText("config-property-name")[0];
              ConfigPropertySettingDConfigBean configPropertySetting = (ConfigPropertySettingDConfigBean) configPropertiesMap.get(configPropertyName);
              assert configPropertySetting != null;
              return configPropertySetting;
          }
          return null;
      }
  
  
      public String[] getXpaths() {
          return CONNECTION_DEFINITION_INSTANCE_XPATHS;
      }
  
  }
  
  
  
  1.1                  incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionManagerDConfigBean.java
  
  Index: ConnectionManagerDConfigBean.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Geronimo" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Geronimo", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * ====================================================================
   */
  
  package org.apache.geronimo.connector.deployment.dconfigbean;
  
  import java.math.BigInteger;
  
  import javax.enterprise.deploy.model.DDBean;
  
  import org.apache.geronimo.deployment.plugin.DConfigBeanSupport;
  import org.apache.geronimo.xbeans.geronimo.GerConnectionmanagerType;
  import org.apache.xmlbeans.SchemaTypeLoader;
  import org.apache.xmlbeans.XmlBeans;
  
  /**
   * TODO maybe this should not be a dconfigbean and maybe it should be incorporated in the ConnectionDefinitionInstance.
   *
   * @version $Revision: 1.1 $ $Date: 2004/02/09 23:13:27 $
   *
   * */
  public class ConnectionManagerDConfigBean extends DConfigBeanSupport {
      private final static SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.getContextTypeLoader();
  
      public ConnectionManagerDConfigBean(DDBean ddbean, GerConnectionmanagerType connectionmanager) {
          super(ddbean, connectionmanager, SCHEMA_TYPE_LOADER);
      }
  
      void setParent(DDBean ddbean, GerConnectionmanagerType connectionmanager) {
          super.setParent(ddbean, connectionmanager);
      }
  
      GerConnectionmanagerType getConnectionManager() {
          return (GerConnectionmanagerType)getXmlObject();
      }
  
      public boolean isUseConnectionRequestInfo() {
          return getConnectionManager().getUseConnectionRequestInfo();
      }
  
      public void setUseConnectionRequestInfo(boolean useConnectionRequestInfo) {
          getConnectionManager().setUseConnectionRequestInfo(useConnectionRequestInfo);
      }
  
      public boolean isUseSubject() {
          return getConnectionManager().getUseSubject();
      }
  
      public void setUseSubject(boolean useSubject) {
          getConnectionManager().setUseSubject(useSubject);
      }
  
      public boolean isUseTransactionCaching() {
          return getConnectionManager().getUseTransactionCaching();
      }
  
      public void setUseTransactionCaching(boolean useTransactionCaching) {
          getConnectionManager().setUseTransactionCaching(useTransactionCaching);
      }
  
      public boolean isUseLocalTransactions() {
          return getConnectionManager().getUseLocalTransactions();
      }
  
      public void setUseLocalTransactions(boolean useLocalTransactions) {
          getConnectionManager().setUseLocalTransactions(useLocalTransactions);
      }
  
      public boolean isUseTransactions() {
          return getConnectionManager().getUseTransactions();
      }
  
      public void setUseTransactions(boolean useTransactions) {
          getConnectionManager().setUseTransactions(useTransactions);
      }
  
      public int getMaxSize() {
          return getConnectionManager().getMaxSize().intValue();
      }
  
      public void setMaxSize(int maxSize) {
          getConnectionManager().setMaxSize(BigInteger.valueOf(maxSize));
      }
  
      public int getBlockingTimeout() {
          return getConnectionManager().getBlockingTimeout().intValue();
      }
  
      public void setBlockingTimeout(int blockingTimeout) {
          getConnectionManager().setBlockingTimeout(BigInteger.valueOf(blockingTimeout));
      }
  
      public String getName() {
          return getConnectionManager().getName();
      }
  
      public void setName(String name) {
          getConnectionManager().setName(name);
      }
  
      public String getRealmBridgeName() {
          return getConnectionManager().getRealmBridge();
      }
  
      public void setRealmBridgeName(String realmBridgeName) {
          getConnectionManager().setRealmBridge(realmBridgeName);
      }
  
  }
  
  
  
  1.1                  incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/dconfigbean/ResourceAdapterDConfigBean.java
  
  Index: ResourceAdapterDConfigBean.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Geronimo" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Geronimo", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * ====================================================================
   */
  
  package org.apache.geronimo.connector.deployment.dconfigbean;
  
  import java.util.Map;
  import java.util.HashMap;
  
  import javax.enterprise.deploy.model.DDBean;
  import javax.enterprise.deploy.spi.DConfigBean;
  import javax.enterprise.deploy.spi.exceptions.ConfigurationException;
  
  import org.apache.geronimo.deployment.plugin.DConfigBeanSupport;
  import org.apache.geronimo.xbeans.geronimo.GerResourceadapterType;
  import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType;
  import org.apache.xmlbeans.SchemaTypeLoader;
  import org.apache.xmlbeans.XmlBeans;
  
  /**
   *
   *
   * @version $Revision: 1.1 $ $Date: 2004/02/09 23:13:27 $
   *
   * */
  public class ResourceAdapterDConfigBean extends DConfigBeanSupport {
      private final static SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.getContextTypeLoader();
  
      private final static String[] RESOURCE_ADAPTER_XPATHS = {
          "config-property",
          "outbound-resource-adapter/connection-definition",
          "admin-object"};
      private Map configPropertiesMap = new HashMap();
  
      public ResourceAdapterDConfigBean(DDBean ddBean, final GerResourceadapterType resourceadapter) {
          super(ddBean, resourceadapter, SCHEMA_TYPE_LOADER);
          ConfigPropertiesHelper.initializeConfigSettings(ddBean, new ConfigPropertiesHelper.ConfigPropertiesSource() {
              public GerConfigPropertySettingType[] getConfigPropertySettingArray() {
                  return resourceadapter.getConfigPropertySettingArray();
              }
  
              public GerConfigPropertySettingType addNewConfigPropertySetting() {
                  return resourceadapter.addNewConfigPropertySetting();
              }
  
          }, configPropertiesMap);
      }
  
      GerResourceadapterType getResourceadapter() {
          return (GerResourceadapterType)getXmlObject();
      }
  
      public DConfigBean getDConfigBean(DDBean bean) throws ConfigurationException {
          String xpath = bean.getXpath();
          if (xpath.endsWith("/config-property")) {
              String configPropertyName = bean.getText("config-property-name")[0];
              ConfigPropertySettingDConfigBean configPropertySetting = (ConfigPropertySettingDConfigBean) configPropertiesMap.get(configPropertyName);
              assert configPropertySetting != null;
              return configPropertySetting;
          }
          return null;
      }
  
  
      public String[] getXpaths() {
          return RESOURCE_ADAPTER_XPATHS;
      }
  
  }
  
  
  
  1.1                  incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/dconfigbean/ResourceAdapterDConfigRoot.java
  
  Index: ResourceAdapterDConfigRoot.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Geronimo" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Geronimo", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * ====================================================================
   */
  
  package org.apache.geronimo.connector.deployment.dconfigbean;
  
  import java.io.InputStream;
  import java.io.IOException;
  
  import javax.enterprise.deploy.model.DDBeanRoot;
  import javax.enterprise.deploy.model.DDBean;
  import javax.enterprise.deploy.spi.DConfigBean;
  import javax.enterprise.deploy.spi.exceptions.ConfigurationException;
  
  import org.apache.geronimo.deployment.plugin.DConfigBeanRootSupport;
  import org.apache.geronimo.xbeans.geronimo.GerConnectorDocument;
  import org.apache.geronimo.xbeans.geronimo.GerResourceadapterType;
  import org.apache.xmlbeans.SchemaTypeLoader;
  import org.apache.xmlbeans.XmlBeans;
  import org.apache.xmlbeans.XmlException;
  
  /**
   *
   *
   * @version $Revision: 1.1 $ $Date: 2004/02/09 23:13:27 $
   *
   * */
  public class ResourceAdapterDConfigRoot extends DConfigBeanRootSupport {
      private final static SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.getContextTypeLoader();
      private static String[] XPATHS = {
          "resource-adapter"
      };
  
      private ResourceAdapterDConfigBean resourceAdapterDConfigBean;
  
      public ResourceAdapterDConfigRoot(DDBeanRoot ddBean) {
          super(ddBean, GerConnectorDocument.Factory.newInstance(), SCHEMA_TYPE_LOADER);
          GerResourceadapterType resourceAdapter = getConnectorDocument().addNewConnector().addNewResourceadapter();
          replaceResourceAdapterDConfigBean(resourceAdapter);
      }
  
      private void replaceResourceAdapterDConfigBean(GerResourceadapterType resourceAdapter) {
          DDBean ddBean = getDDBean();
          resourceAdapterDConfigBean = new ResourceAdapterDConfigBean(ddBean.getChildBean("resource-adapter")[0], resourceAdapter);
      }
  
      GerConnectorDocument getConnectorDocument() {
          return (GerConnectorDocument)getXmlObject();
      }
  
      public String[] getXpaths() {
          return XPATHS;
      }
  
      public DConfigBean getDConfigBean(DDBean bean) throws ConfigurationException {
          if ("/connector/resource-adapter".equals(bean.getXpath())) {
              return resourceAdapterDConfigBean;
          }
          return null;
      }
  
      public void fromXML(InputStream inputStream) throws XmlException, IOException {
          super.fromXML(inputStream);
          replaceResourceAdapterDConfigBean(getConnectorDocument().getConnector().getResourceadapter());
      }
  }
  
  
  
  1.6       +7 -9      incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/Connector_1_0Module.java
  
  Index: Connector_1_0Module.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/Connector_1_0Module.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Connector_1_0Module.java	9 Feb 2004 07:10:25 -0000	1.5
  +++ Connector_1_0Module.java	9 Feb 2004 23:13:27 -0000	1.6
  @@ -60,9 +60,9 @@
   import java.io.IOException;
   import java.io.InputStream;
   import java.net.URI;
  -import java.util.Collections;
  -import java.util.Collection;
   import java.util.ArrayList;
  +import java.util.Collection;
  +import java.util.Collections;
   import java.util.jar.JarInputStream;
   
   import javax.management.AttributeNotFoundException;
  @@ -71,7 +71,6 @@
   import javax.management.MalformedObjectNameException;
   import javax.management.ObjectName;
   import javax.management.ReflectionException;
  -import javax.enterprise.deploy.shared.CommandType;
   
   import org.apache.geronimo.common.propertyeditor.PropertyEditors;
   import org.apache.geronimo.connector.outbound.ConnectionManagerDeployment;
  @@ -79,7 +78,6 @@
   import org.apache.geronimo.deployment.ConfigurationCallback;
   import org.apache.geronimo.deployment.DeploymentException;
   import org.apache.geronimo.deployment.DeploymentModule;
  -import org.apache.geronimo.deployment.plugin.FailedProgressObject;
   import org.apache.geronimo.deployment.util.UnclosableInputStream;
   import org.apache.geronimo.gbean.DynamicGAttributeInfo;
   import org.apache.geronimo.gbean.GBeanInfo;
  @@ -89,10 +87,10 @@
   import org.apache.geronimo.kernel.Kernel;
   import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType;
   import org.apache.geronimo.xbeans.geronimo.GerConnectionDefinitionType;
  +import org.apache.geronimo.xbeans.geronimo.GerConnectiondefinitionInstanceType;
   import org.apache.geronimo.xbeans.geronimo.GerConnectionmanagerType;
  -import org.apache.geronimo.xbeans.geronimo.GerResourceadapterType;
   import org.apache.geronimo.xbeans.geronimo.GerConnectorDocument;
  -import org.apache.geronimo.xbeans.geronimo.GerConnectionfactoryInstanceType;
  +import org.apache.geronimo.xbeans.geronimo.GerResourceadapterType;
   import org.apache.geronimo.xbeans.j2ee.connector_1_0.ConfigPropertyType;
   import org.apache.geronimo.xbeans.j2ee.connector_1_0.ConnectorDocument;
   import org.apache.geronimo.xbeans.j2ee.connector_1_0.ResourceadapterType;
  @@ -132,8 +130,8 @@
               GerConnectionDefinitionType geronimoConnectionDefinition = geronimoResourceAdapter.getOutboundResourceadapter().getConnectionDefinitionArray(i);
               assert geronimoConnectionDefinition != null: "Null GeronimoConnectionDefinition";
               //ConnectionManagerFactory
  -            for (int j = 0; j < geronimoConnectionDefinition.getConnectionfactoryInstanceArray().length; j++) {
  -                GerConnectionfactoryInstanceType gerConnectionfactoryInstance = geronimoConnectionDefinition.getConnectionfactoryInstanceArray()[j];
  +            for (int j = 0; j < geronimoConnectionDefinition.getConnectiondefinitionInstanceArray().length; j++) {
  +                GerConnectiondefinitionInstanceType gerConnectionfactoryInstance = geronimoConnectionDefinition.getConnectiondefinitionInstanceArray()[j];
   
                   GerConnectionmanagerType connectionManagerFactory = gerConnectionfactoryInstance.getConnectionmanager();
                   GBeanInfo connectionManagerFactoryGBeanInfo;
  
  
  
  1.6       +4 -4      incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/Connector_1_5Module.java
  
  Index: Connector_1_5Module.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/Connector_1_5Module.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Connector_1_5Module.java	9 Feb 2004 07:10:25 -0000	1.5
  +++ Connector_1_5Module.java	9 Feb 2004 23:13:27 -0000	1.6
  @@ -94,7 +94,7 @@
   import org.apache.geronimo.xbeans.geronimo.GerConnectionmanagerType;
   import org.apache.geronimo.xbeans.geronimo.GerConnectorDocument;
   import org.apache.geronimo.xbeans.geronimo.GerResourceadapterType;
  -import org.apache.geronimo.xbeans.geronimo.GerConnectionfactoryInstanceType;
  +import org.apache.geronimo.xbeans.geronimo.GerConnectiondefinitionInstanceType;
   import org.apache.geronimo.xbeans.geronimo.GerAdminobjectInstanceType;
   import org.apache.geronimo.xbeans.j2ee.AdminobjectType;
   import org.apache.geronimo.xbeans.j2ee.ConfigPropertyType;
  @@ -165,8 +165,8 @@
               String connectionFactoryInterfaceName = geronimoConnectionDefinition.getConnectionfactoryInterface().getStringValue();
               ConnectionDefinitionType connectionDefinition = (ConnectionDefinitionType) connectionDefinitions.get(connectionFactoryInterfaceName);
               assert connectionDefinition != null: "No connection definition for ConnectionFactory class: " + connectionFactoryInterfaceName;
  -            for (int j = 0; j < geronimoConnectionDefinition.getConnectionfactoryInstanceArray().length; j++) {
  -                GerConnectionfactoryInstanceType connectionfactoryInstance = geronimoConnectionDefinition.getConnectionfactoryInstanceArray()[j];
  +            for (int j = 0; j < geronimoConnectionDefinition.getConnectiondefinitionInstanceArray().length; j++) {
  +                GerConnectiondefinitionInstanceType connectionfactoryInstance = geronimoConnectionDefinition.getConnectiondefinitionInstanceArray()[j];
   
                   //ConnectionManagerFactory
                   GerConnectionmanagerType connectionManagerFactory = connectionfactoryInstance.getConnectionmanager();
  
  
  
  1.3       +3 -3      incubator-geronimo/modules/connector/src/schema/geronimo-connector_1_5.xsd
  
  Index: geronimo-connector_1_5.xsd
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/schema/geronimo-connector_1_5.xsd,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- geronimo-connector_1_5.xsd	8 Feb 2004 20:21:57 -0000	1.2
  +++ geronimo-connector_1_5.xsd	9 Feb 2004 23:13:27 -0000	1.3
  @@ -190,13 +190,13 @@
                       </xsd:documentation>
                   </xsd:annotation>
               </xsd:element>
  -            <xsd:element name="connectionfactory-instance"
  -                type="ger:connectionfactory-instanceType"
  +            <xsd:element name="connectiondefinition-instance"
  +                type="ger:connectiondefinition-instanceType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
           </xsd:sequence>
       </xsd:complexType>
  -    <xsd:complexType name="connectionfactory-instanceType">
  +    <xsd:complexType name="connectiondefinition-instanceType">
           <xsd:sequence>
               <xsd:element name="name"
                   type="xsd:string"/>
  
  
  
  1.3       +2 -2      incubator-geronimo/modules/connector/src/schema/xmlconfig.xml
  
  Index: xmlconfig.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/schema/xmlconfig.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- xmlconfig.xml	8 Feb 2004 20:21:57 -0000	1.2
  +++ xmlconfig.xml	9 Feb 2004 23:13:27 -0000	1.3
  @@ -5,9 +5,9 @@
           <xb:package>org.apache.geronimo.xbeans.j2ee</xb:package>
       </xb:namespace-->
   
  -    <xb:namespace uri="##local">
  +    <!--xb:namespace uri="##local">
           <xb:package>org.apache.geronimo.xbeans.j2ee.connector_1_0</xb:package>
  -    </xb:namespace>
  +    </xb:namespace-->
   
       <xb:namespace uri="http://org.apache.geronimo/xml/ns/j2ee">
           <xb:package>org.apache.geronimo.xbeans.geronimo</xb:package>
  
  
  
  1.3       +6 -6      incubator-geronimo/modules/connector/src/test-data/connector_1_0/geronimo-ra.xml
  
  Index: geronimo-ra.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test-data/connector_1_0/geronimo-ra.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- geronimo-ra.xml	8 Feb 2004 20:21:57 -0000	1.2
  +++ geronimo-ra.xml	9 Feb 2004 23:13:28 -0000	1.3
  @@ -4,7 +4,7 @@
           <outbound-resourceadapter>
               <connection-definition>
                   <connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>
  -                <connectionfactory-instance>
  +                <connectiondefinition-instance>
                       <name>FirstTestOutboundConnectionFactory</name>
                       <config-property-setting name="OutboundStringProperty1">newvalue1</config-property-setting>
                       <config-property-setting name="OutboundStringProperty3">newvalue2</config-property-setting>
  @@ -20,8 +20,8 @@
                           <useSubject>true</useSubject>
                       </connectionmanager>
                       <global-jndi-name>connectionfactories/testcf</global-jndi-name>
  -                </connectionfactory-instance>
  -                <connectionfactory-instance>
  +                </connectiondefinition-instance>
  +                <connectiondefinition-instance>
                       <name>SecondTestOutboundConnectionFactory</name>
                       <config-property-setting name="OutboundStringProperty4">newvalue3</config-property-setting>
                       <config-property-setting name="OutboundStringProperty1">newvalue4</config-property-setting>
  @@ -36,8 +36,8 @@
                           <useConnectionRequestInfo>false</useConnectionRequestInfo>
                           <useSubject>true</useSubject>
                       </connectionmanager>
  -                </connectionfactory-instance>
  -                <connectionfactory-instance>
  +                </connectiondefinition-instance>
  +                <connectiondefinition-instance>
                       <name>ThirdTestOutboundConnectionFactory</name>
                       <config-property-setting name="OutboundStringProperty">StringValue3</config-property-setting>
                       <connectionmanager>
  @@ -51,7 +51,7 @@
                           <useConnectionRequestInfo>false</useConnectionRequestInfo>
                           <useSubject>true</useSubject>
                       </connectionmanager>
  -                </connectionfactory-instance>
  +                </connectiondefinition-instance>
               </connection-definition>
               <transaction-support>XATransaction</transaction-support>
           </outbound-resourceadapter>
  
  
  
  1.3       +6 -6      incubator-geronimo/modules/connector/src/test-data/connector_1_5/geronimo-ra.xml
  
  Index: geronimo-ra.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test-data/connector_1_5/geronimo-ra.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- geronimo-ra.xml	8 Feb 2004 20:21:57 -0000	1.2
  +++ geronimo-ra.xml	9 Feb 2004 23:13:28 -0000	1.3
  @@ -6,7 +6,7 @@
           <outbound-resourceadapter>
               <connection-definition>
                   <connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>
  -                <connectionfactory-instance>
  +                <connectiondefinition-instance>
                       <name>FirstTestOutboundConnectionFactory</name>
                       <config-property-setting name="OutboundStringProperty1">newvalue1</config-property-setting>
                       <config-property-setting name="OutboundStringProperty3">newvalue2</config-property-setting>
  @@ -22,8 +22,8 @@
                           <useSubject>true</useSubject>
                       </connectionmanager>
                       <global-jndi-name>connectionfactories/testcf</global-jndi-name>
  -                </connectionfactory-instance>
  -                <connectionfactory-instance>
  +                </connectiondefinition-instance>
  +                <connectiondefinition-instance>
                       <name>SecondTestOutboundConnectionFactory</name>
                       <config-property-setting name="OutboundStringProperty4">newvalue3</config-property-setting>
                       <config-property-setting name="OutboundStringProperty1">newvalue4</config-property-setting>
  @@ -38,11 +38,11 @@
                           <useConnectionRequestInfo>false</useConnectionRequestInfo>
                           <useSubject>true</useSubject>
                        </connectionmanager>
  -                </connectionfactory-instance>
  +                </connectiondefinition-instance>
               </connection-definition>
               <connection-definition>
                   <connectionfactory-interface>org.apache.geronimo.connector.mock.MockConnectionFactory</connectionfactory-interface>
  -                <connectionfactory-instance>
  +                <connectiondefinition-instance>
                       <name>ThirdTestOutboundConnectionFactory</name>
                       <config-property-setting name="OutboundStringProperty">StringValue3</config-property-setting>
                       <connectionmanager>
  @@ -56,7 +56,7 @@
                           <useConnectionRequestInfo>false</useConnectionRequestInfo>
                           <useSubject>true</useSubject>
                       </connectionmanager>
  -                </connectionfactory-instance>
  +                </connectiondefinition-instance>
               </connection-definition>
               <transaction-support>XATransaction</transaction-support>
           </outbound-resourceadapter>
  
  
  

Mime
View raw message