1 Reply Latest reply on Sep 10, 2014 11:41 AM by Urh Srecnik

    JDBC ConnectionListener Parameters

    Urh Srecnik Newbie

      Hi,

      We're using WildFly 8.1.0.Final. I have created custom implementation of org.jboss.jca.adapters.jdbc.spi.listener.ConnectionListener and deployed it as a module in $WILDFLY_HOME/modules/system/layers/base/mycompany/mymodule/. Following line was added to standalone.xml (datasources > datasource > pool):

      <connection-listener class-name="com.my.package.MyConnectionListener" />
      

      Now, the listener works as expected - my question is what is the best way (or better, what options are available) to pass parameters to MyConnectionListener? Those parameters should be specific to the configured data-source. It seems that there is no such property as "<connection-listener-parameters>" available?

        • 1. Re: JDBC ConnectionListener Parameters
          Urh Srecnik Newbie

          The solution was to simply create bean properties (getMyProperty(), setMyProperty() methods) and add following to standalone.xml:

           

          <connection-listener class-name="com.my.package.MyConnectionListener">

              <config-property name="myProperty">my-value</config-property>

          </connection-listener>


          if using jboss-cli.sh, you can specify properties like this:

          data-source add --name=MyTestDS --connection-listener-property={"myProperty"=>"my-value"} --connection-listener-class=com.my.package.MyConnectionListener ...