0 Replies Latest reply on May 15, 2006 5:28 PM by andreyk

    Setting MBean parametrized constructor to call in jboss-serv

    andreyk

      Hi,

      I appologize if similar question has passed here once,.. but anyway.

      I have MBean which has ctor with String parameter. Now my purpose is to force jboss to call this ctor instead of default one that I know how to arrange in jboss-service.xml file or xmbean-dd one.
      I saw some examples in the Net, mostly they address me to jboss-service file with the following notation:

      <mbean code="package_path.SomeName"
      name="jboss:service=SomeName"
      xmbean-dd="conf/SomeNameService-xmbean.xml">
      <attribute name="Measurement">Time</attribute>
      </mbean>

      Is it pretty good for my task? If so, do I need to remove ctor description in xmbean-dd file and stay with operations only?

      At the same time I noticed that jboss_xmbean_1_0.dtd schema defines "parameter" element as optional for "constructor" element. Since my xmbean-dd file uses this schema, I guess it's possible to write something like this:
      <mbean>
       <constructor>
       <description>Parametrized Constructor</description>
       <name>ConstructorName</name>
       <parameter>Time</parameter>
       </constructor>
      </mbean>

      and it will work.

      Please advise which method is better.

      Thank you,

      Andrey