| How to create a MDB 3.0 singleton ? |
| Written by Mark S. | |||||
|
JBoss recipe of the day
EJB3 uses the resource adapter. When using the resource adapter, you need to constrain the number of Sessions: so you set the minimum for the sessions. This will essentially give you a singleton.
You can set the maxSession in your bean with an annotation by adding : @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "1")
You can add this by default in the server/$/deploy/ejb3-interceptors-aop.xml file
<annotation expr="!class(@org.jboss.annotation.ejb.DefaultActivationSpecs)">
@org.jboss.annotation.ejb.DefaultActivationSpecs (value={@~ActivationConfigProperty(propertyName = "maxSession", propertyValue = "1")})
</annotation>
This will set the default for all message driven beans. Will it work in a cluster too ?
|
| Comments |
|
Only registered users can write comments!
Powered by !JoomlaComment 3.26


