Patches item #817427, was opened at 2003-10-03 20:59
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=817427&group_id=22866

Category: JBossServer
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: RE (emberson)
Assigned to: Nobody/Anonymous (nobody)
Summary: service-bindings.xml parser and string replace upgrade

Initial Comment:
There are two patches here.



A patch was recently submitted allowing one to use the

"${}" property

replacement in the service-bindings.xml. The patch was

for some of the

files in

jboss-3.2.2RC4-src/varia/src/main/org/jboss/services/binding/.

The patch was incomplete, the parsing of the name of

the service was not

augmented to allow for "${}" property replacement.

The fix is the file XMLServicesStore.java in the

attached zip file.

basically line 126 is changed from

  String serverName = server.getAttribute("name");

to

  String serverName =

Strings.replaceProperties(server.getAttribute("name"));



The second patch concerns how jboss actually does "${}"

property replacement.

Currently, embedded "${}" are not evaluated, which is

to say

${com.acme.{jboss.service.name}.naming.host}

can not be evaluated.

Using a part of the service-bindings.xml found in the

zip file as an example

one could have the following:



   <server name="${jboss.server.name}">

      <service-config name="jboss:service=Naming"

        

delegateClass="org.jboss.services.binding.AttributeMappingDelegate"

      >

         <delegate-config portName="Port"/>

         <binding

            name="${jboss.server.name}-naming"

           

host="${com.acme.${jboss.server.name}.naming.host}" 

           

port="${com.acme.${jboss.server.name}.naming.port}" 

            />

      </service-config>



    ... more ...

   </server>



You can then have a single service definition (if you

want) but depending

upon which jboss instance was starting, different

properties would

looked up to get the needed values. This allows one to

have 1-N jboss

instance all using the same service binding definition

without having

to explicitly create one for each instance.

Included is a standalone file, PropertyReplacer.java,

which allows one

to test the new "${}" property replacement algorithm as

well as the

file Strings.java from the directory

jboss-3.2.2RC3-src/common/src/main/org/jboss/util/ with the

new algorithm.



I am submitting the new "${}" property replacement

algorithm to the

Ant group also since it would be very useful in many of

the ant scripts

we use.



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

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


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to