mercredi 3 juin 2015

Configure specific SFSB stateful-timeout in standalone.xml (JBOSS)

For my JEE 3.1 application I have a SFSB for which I have set a specific timeout. I need to have easy access to this value to allow it to be easily configurable.

First I had the annotation in my SFSB class:

@StatefulTimeout(value = 2, unit = TimeUnit.HOURS)

This works as expected. But I need this value to be (easily) configurable. Therefore I removed the annotation and placed the following xml in my ejb-jar.xml. Again this works as expected.

<session>
    <ejb-name>MyStatefulSessionBeanName</ejb-name>
    <ejb-class>foo.bar.MyStatefulSessionBean</ejb-class>
    <session-type>Stateful</session-type>
    <stateful-timeout>
        <timeout>2</timeout>
        <unit>Hours</unit>
    </stateful-timeout>
</session>

But the ejb-jar.xml is packaged in a .jar which is within my .ear application deployment. Therefore my question is, can this setting be placed in the standalone.xml file of jboss?

Aucun commentaire:

Enregistrer un commentaire