Patches item #790877, was opened at 2003-08-18 23:03
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376687&aid=790877&group_id=22866

Category: None
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: RE (emberson)
Assigned to: Nobody/Anonymous (nobody)
Summary: Binding service does not read system properties

Initial Comment:
Binding Services Patch

JBoss version 3.2.2RC2
Patch to
jboss-3.2.2RC2-src/varia/src/main/org/jboss/services/binding
which ends up in the jar: bindingservice-plugin.jar

Problem: The services binding xml file does not allow
one to read
the value of the ports/hosts from system properties used by
org.jboss.services.binding.AttributeMappingDelegate.

Problem: One can not pass in arbitrary parameters to
the XSL consumed by
org.jboss.services.binding.XSLTConfigDelegate.


Solution is to modify the files:
    XMLServicesStore.java
    XSLTConfigDelegate.java
    AttributeMappingDelegate.java
in the directory:
   
jboss-3.2.2RC2-src/varia/src/main/org/jboss/services/binding
so that they use the
org.jboss.util.Strings.replaceProperties(...)
method and have XSLTConfigDelegate.java use the
delegate-config
attribute child elements to provide the name and value of
XSL parameters.

Examples:

note hardcoded port: 1099
currently:
      <service-config name="jboss:service=Naming"
        
delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >  
         <delegate-config portName="Port"/>
         <binding port="1099" />
      </service-config>
with patch:
      <service-config name="jboss:service=Naming"
        
delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
         <delegate-config portName="Port"/>
         <binding
port="${com.mycomp.instance1.jndi.port}" />
      </service-config>

note hardcoded db sid: HARD_CODED_SID
currently:
      <!-- Oracle related services -->
      <service-config
name="jboss.jca:service=ManagedConnectionFactory,name=OracleDS"
        
delegateClass="org.jboss.services.binding.XSLTConfigDelegate"
      >
         <delegate-config>
         <xslt-config
configName="ManagedConnectionFactoryProperties"><![CDATA[
<xsl:stylesheet
      xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
version='1.0'>

  <xsl:output method="xml" />
  <xsl:param name="host"/>
  <xsl:param name="port"/>

  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>
         
  <xsl:template
match="[EMAIL PROTECTED]'ConnectionURL']">
    <config-property type="java.lang.String"
name="ConnectionURL">jdbc:oracle:thin:@<xsl:value-of
select='$host'/>:<xsl:value-of
select='$port'/>:HARD_CODED_SID</config-property>
  </xsl:template>
      
  <xsl:template match="*|@*">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>
]]>
         </xslt-config>
         </delegate-config>
         <binding host="foobarhost"
                port="1521" />
      </service-config>

   </server>
with patch:
      <!-- Oracle related services -->
      <service-config
name="jboss.jca:service=ManagedConnectionFactory,name=OracleDS"
        
delegateClass="org.jboss.services.binding.XSLTConfigDelegate"
      >
         <delegate-config>
         <xslt-config
configName="ManagedConnectionFactoryProperties"><![CDATA[
<xsl:stylesheet
      xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
version='1.0'>

  <xsl:output method="xml" />
  <xsl:param name="host"/>
  <xsl:param name="port"/>
  <xsl:param name="sid"/>

  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template
match="[EMAIL PROTECTED]'ConnectionURL']">
    <config-property type="java.lang.String"
name="ConnectionURL">jdbc:oracle:thin:@<xsl:value-of
select='$host'/>:<xsl:value-of
select='$port'/>:<xsl:value-of
select='$sid'/></config-property>
  </xsl:template> 
      
  <xsl:template match="*|@*">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>
]]>   
         </xslt-config>
          <attribute
name="sid">${com.mycomp.db.sid}</attribute>
         </delegate-config>
         <binding host="${com.mycomp.db.host}"
                port="${com.mycomp.db.port}" />
      </service-config>
  
   </server>
  

The patched files are attached BindingServicesPatch.zip .

Please let me know if these will be included in 3.2.2.
Thanks

RME


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376687&aid=790877&group_id=22866


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to