Stateless Session EJB: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 9: Line 9:
=Example=
=Example=


{{External|https://github.com/NovaOrdis/playground/tree/master/jee/ejb/stateless-via-jndi}}
{{External|Stateless EJB and Servlet deployed as separate modules, EJB is looked up in JNDI https://github.com/NovaOrdis/playground/tree/master/jee/ejb/stateless-via-jndi}}


=Maven=
=Maven=

Revision as of 01:29, 23 March 2017

Internal

Overview

A stateless session bean as per its name does not have any associated client state, but it may preserve its instance state.

Example

Stateless EJB and Servlet deployed as separate modules, EJB is looked up in JNDI https://github.com/NovaOrdis/playground/tree/master/jee/ejb/stateless-via-jndi

Maven

<dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-api</artifactId>
    <version>6.0</version>
    <scope>provided</scope>
</dependency>


Stateless EJB and JNDI

The JNDI bindings for session bean named 'SimpleStatelessBean' in deployment unit 'deployment "stateless-ejb-example.jar"' are as follows:

java:global/stateless-ejb-example/SimpleStatelessBean!io.novaordis.playground.jee.ejb.stateless.SimpleStateless
java:app/stateless-ejb-example/SimpleStatelessBean!io.novaordis.playground.jee.ejb.stateless.SimpleStateless
java:module/SimpleStatelessBean!io.novaordis.playground.jee.ejb.stateless.SimpleStateless
java:jboss/exported/stateless-ejb-example/SimpleStatelessBean!io.novaordis.playground.jee.ejb.stateless.SimpleStateless
java:global/stateless-ejb-example/SimpleStatelessBean
java:app/stateless-ejb-example/SimpleStatelessBean
java:module/SimpleStatelessBean