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 Thu, 19 Feb 2004 23:16:06 GMT
djencks     2004/02/19 15:16:06

  Modified:    modules/connector/src/java/org/apache/geronimo/connector/deployment
                        Connector_1_5Module.java
               modules/connector/src/java/org/apache/geronimo/connector/deployment/dconfigbean
                        ResourceAdapterDConfigBean.java
               modules/connector/src/schema geronimo-connector_1_5.xsd
               modules/connector/src/test/org/apache/geronimo/connector/deployment
                        Connector_1_5Test.java
               modules/connector/src/test-data/connector_1_0
                        geronimo-ra.xml
               modules/connector/src/test-data/connector_1_5
                        geronimo-ra.xml
  Log:
  Make the geronimo connector schema handle both 1.0 and 1.5 adapters a little better
  
  Revision  Changes    Path
  1.9       +10 -3     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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Connector_1_5Module.java	10 Feb 2004 19:59:14 -0000	1.8
  +++ Connector_1_5Module.java	19 Feb 2004 23:16:06 -0000	1.9
  @@ -140,14 +140,21 @@
           }
           ObjectName resourceAdapterObjectName = null;
           GBeanInfoFactory resourceAdapterInfoFactory = new GBeanInfoFactory(ResourceAdapterWrapper.class.getName(),
ResourceAdapterWrapper.getGBeanInfo());
  -        GBeanMBean resourceAdapterGBean = setUpDynamicGBean(resourceAdapterInfoFactory,
resourceadapter.getConfigPropertyArray(), geronimoResourceAdapter.getConfigPropertySettingArray());
  +        GBeanMBean resourceAdapterGBean = setUpDynamicGBean(resourceAdapterInfoFactory,
resourceadapter.getConfigPropertyArray(), geronimoResourceAdapter.getResourceadapterInstance().getConfigPropertySettingArray());
           try {
               resourceAdapterGBean.setAttribute("ResourceAdapterClass", cl.loadClass(resourceAdapterClassName));
           } catch (Exception e) {
               throw new DeploymentException(e);
           }
  +        ObjectName bootstrapContextObjectName = null;
           try {
  -            resourceAdapterObjectName = ObjectName.getInstance(BASE_RESOURCE_ADAPTER_NAME
+ geronimoResourceAdapter.getResourceadapterName() + ",configID=" + configID);
  +            bootstrapContextObjectName = ObjectName.getInstance(geronimoResourceAdapter.getResourceadapterInstance().getBootstrapcontextName().getStringValue());
  +        } catch (MalformedObjectNameException e) {
  +            throw new DeploymentException("Could not create object name for bootstrap context",
e);
  +        }
  +        resourceAdapterGBean.setReferencePatterns("BootstrapContext", Collections.singleton(bootstrapContextObjectName));
  +        try {
  +            resourceAdapterObjectName = ObjectName.getInstance(BASE_RESOURCE_ADAPTER_NAME
+ geronimoResourceAdapter.getResourceadapterInstance().getResourceadapterName() + ",configID="
+ configID);
           } catch (MalformedObjectNameException e) {
               throw new DeploymentException("Could not construct resource adapter object
name", e);
           }
  
  
  
  1.5       +24 -5     incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/dconfigbean/ResourceAdapterDConfigBean.java
  
  Index: ResourceAdapterDConfigBean.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/dconfigbean/ResourceAdapterDConfigBean.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ResourceAdapterDConfigBean.java	18 Feb 2004 20:57:07 -0000	1.4
  +++ ResourceAdapterDConfigBean.java	19 Feb 2004 23:16:06 -0000	1.5
  @@ -69,6 +69,7 @@
   import org.apache.geronimo.xbeans.geronimo.GerOutboundResourceadapterType;
   import org.apache.geronimo.xbeans.geronimo.GerConnectionDefinitionType;
   import org.apache.geronimo.xbeans.geronimo.GerAdminobjectType;
  +import org.apache.geronimo.xbeans.geronimo.GerResourceadapterInstanceType;
   import org.apache.xmlbeans.SchemaTypeLoader;
   import org.apache.xmlbeans.XmlBeans;
   
  @@ -91,13 +92,19 @@
   
       public ResourceAdapterDConfigBean(DDBean ddBean, final GerResourceadapterType resourceadapter)
{
           super(ddBean, resourceadapter, SCHEMA_TYPE_LOADER);
  +        if (getResourceadapterInstance() == null) {
  +            resourceadapter.addNewResourceadapterInstance();
  +        }
  +        if (getResourceadapterInstance().getBootstrapcontextName() == null) {
  +            getResourceadapterInstance().addNewBootstrapcontextName();
  +        }
           ConfigPropertiesHelper.initializeConfigSettings(ddBean, new ConfigPropertiesHelper.ConfigPropertiesSource()
{
               public GerConfigPropertySettingType[] getConfigPropertySettingArray() {
  -                return resourceadapter.getConfigPropertySettingArray();
  +                return getResourceadapterInstance().getConfigPropertySettingArray();
               }
   
               public GerConfigPropertySettingType addNewConfigPropertySetting() {
  -                return resourceadapter.addNewConfigPropertySetting();
  +                return getResourceadapterInstance().addNewConfigPropertySetting();
               }
   
               public void removeConfigPropertySetting(int j) {
  @@ -177,12 +184,24 @@
           return (GerResourceadapterType)getXmlObject();
       }
   
  +    private GerResourceadapterInstanceType getResourceadapterInstance() {
  +        return getResourceadapter().getResourceadapterInstance();
  +    }
  +
       public String getResourceAdapterName() {
  -        return getResourceadapter().getResourceadapterName();
  +        return getResourceadapterInstance().getResourceadapterName();
       }
   
       public void setResourceAdapterName(String resourceAdapterName) {
  -        getResourceadapter().setResourceadapterName(resourceAdapterName);
  +        getResourceadapterInstance().setResourceadapterName(resourceAdapterName);
  +    }
  +
  +    public String getBootstrapContext() {
  +        return getResourceadapterInstance().getBootstrapcontextName().getStringValue();
  +    }
  +
  +    public void setBootstrapContext(String bootstrapContext) {
  +        getResourceadapterInstance().getBootstrapcontextName().setStringValue(bootstrapContext);
       }
   
       public DConfigBean getDConfigBean(DDBean bean) throws ConfigurationException {
  
  
  
  1.7       +20 -9     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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- geronimo-connector_1_5.xsd	12 Feb 2004 16:29:00 -0000	1.6
  +++ geronimo-connector_1_5.xsd	19 Feb 2004 23:16:06 -0000	1.7
  @@ -252,9 +252,7 @@
       <xsd:complexType name="connectorType">
           <xsd:annotation>
               <xsd:documentation>
  -
                   The connectorType defines a resource adapter.
  -
               </xsd:documentation>
           </xsd:annotation>
   
  @@ -346,13 +344,8 @@
       <xsd:complexType name="resourceadapterType">
   
           <xsd:sequence>
  -            <xsd:element name="resourceadapter-name" type="xsd:string"/>
  -            <xsd:element name="config-property-setting"
  -                type="ger:config-property-settingType"
  -                minOccurs="0"
  -                maxOccurs="unbounded"/>
  -            <xsd:element name="bootstrapcontext-name"
  -                type="j2ee:string"
  +            <xsd:element name="resourceadapter-instance"
  +                type="ger:resourceadapter-instanceType"
                   minOccurs="0"/>
               <xsd:element name="outbound-resourceadapter"
                   type="ger:outbound-resourceadapterType"
  @@ -362,6 +355,24 @@
                   type="ger:adminobjectType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
  +        </xsd:sequence>
  +    </xsd:complexType>
  +
  +    <xsd:complexType name="resourceadapter-instanceType">
  +        <xsd:annotation>
  +            <xsd:documentation>
  +                The resourceadapter instance info is put in a separate optional element
  +                to provide easier more consistent support for 1.0 adapters.
  +            </xsd:documentation>
  +        </xsd:annotation>
  +        <xsd:sequence>
  +            <xsd:element name="resourceadapter-name" type="xsd:string"/>
  +            <xsd:element name="config-property-setting"
  +                type="ger:config-property-settingType"
  +                minOccurs="0"
  +                maxOccurs="unbounded"/>
  +            <xsd:element name="bootstrapcontext-name"
  +                type="j2ee:string"/>
           </xsd:sequence>
       </xsd:complexType>
   
  
  
  
  1.9       +5 -3      incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/deployment/Connector_1_5Test.java
  
  Index: Connector_1_5Test.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/deployment/Connector_1_5Test.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Connector_1_5Test.java	18 Feb 2004 20:57:08 -0000	1.8
  +++ Connector_1_5Test.java	19 Feb 2004 23:16:06 -0000	1.9
  @@ -101,6 +101,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.GerResourceadapterInstanceType;
   import org.apache.geronimo.xbeans.j2ee.ConnectorDocument;
   import org.apache.xmlbeans.XmlOptions;
   
  @@ -194,8 +195,9 @@
           InputStream is = new ByteArrayInputStream(bytes);
           GerConnectorDocument gcDoc = GerConnectorDocument.Factory.parse(is);
           GerResourceadapterType ra = gcDoc.getConnector().getResourceadapter();
  -        assertEquals("TestRAName", ra.getResourceadapterName());
  -        GerConfigPropertySettingType rasetting = ra.getConfigPropertySettingArray(0);
  +        GerResourceadapterInstanceType rai = ra.getResourceadapterInstance();
  +        assertEquals("TestRAName", rai.getResourceadapterName());
  +        GerConfigPropertySettingType rasetting = rai.getConfigPropertySettingArray(0);
           assertEquals("TestRAValue", rasetting.getStringValue());
   
           //admin object
  
  
  
  1.7       +0 -2      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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- geronimo-ra.xml	12 Feb 2004 16:29:00 -0000	1.6
  +++ geronimo-ra.xml	19 Feb 2004 23:16:06 -0000	1.7
  @@ -1,8 +1,6 @@
   <?xml version="1.0" encoding="UTF-8"?>
   <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee" version="1.0">
       <resourceadapter>
  -        <!-- how can we get rid of this?-->
  -        <resourceadapter-name>testRA</resourceadapter-name>
           <outbound-resourceadapter>
               <connection-definition>
                   <connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>
  
  
  
  1.7       +6 -4      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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- geronimo-ra.xml	12 Feb 2004 16:29:00 -0000	1.6
  +++ geronimo-ra.xml	19 Feb 2004 23:16:06 -0000	1.7
  @@ -1,9 +1,11 @@
   <?xml version="1.0" encoding="UTF-8"?>
   <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee" version="1.5">
       <resourceadapter>
  -        <resourceadapter-name>testRA</resourceadapter-name>
  -        <config-property-setting name="RAStringProperty">NewStringValue</config-property-setting>
  -        <bootstrapcontext-name>geronimo.jca:service=bootstrapcontext</bootstrapcontext-name>
  +        <resourceadapter-instance>
  +            <resourceadapter-name>testRA</resourceadapter-name>
  +            <config-property-setting name="RAStringProperty">NewStringValue</config-property-setting>
  +            <bootstrapcontext-name>geronimo.jca:service=bootstrapcontext</bootstrapcontext-name>
  +        </resourceadapter-instance>
           <outbound-resourceadapter>
               <connection-definition>
                   <connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>
  @@ -36,7 +38,7 @@
                           <useTransactionCaching>true</useTransactionCaching>
                           <useConnectionRequestInfo>false</useConnectionRequestInfo>
                           <useSubject>true</useSubject>
  -                     </connectionmanager>
  +                    </connectionmanager>
                   </connectiondefinition-instance>
               </connection-definition>
               <connection-definition>
  
  
  

Mime
View raw message