3 Replies Latest reply on Mar 16, 2006 11:02 PM by Scott Stark

    Simple Service Parameterization

    Brian Wallis Master

      As part of my application I am deploying a mailservice using the org.jboss.mail.MailService mbean. In the service file I need to specify various parameters such as the mail host, login details, etc.

      Currently we do that at installation time by massaging the mail-serivce.xml file, replacing some tokens with the correct values. Of course this means I cannot include this service.xml file in my ear file as part of the application.

      Is there anyway I can do this so that I can just use a parameter file somewhere (maybe a properties file or as system properties at jboss startup). ie: my service file would be something like:

      <mbean code="org.jboss.mail.MailService"
       name="jboss:service=ESERV_Mail">
       <attribute name="JNDIName">java:/ESERV_Mail</attribute>
       <attribute name="User">${mail.user}</attribute>
       <attribute name="Password">${mail.passwd}</attribute>
      etc...
      


      There are many other cases where I would like to be able to do something like this such as database connection parameters (user/pass@sid), database server hostname, JCA parameters for external host names, ports, etc.. Is there a general mechanism for doing this?

      thanks,