<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Java EE Implementation Technical Requirements
</h3>
<span style="margin-bottom: 10px;">
    modified by <a href="http://community.jboss.org/people/david.lloyd%40jboss.com">David Lloyd</a> in <i>JBoss AS7 Development</i> - <a href="http://community.jboss.org/docs/DOC-16195">View the full document</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><h5>Purpose</h5><p>The purpose of this document is to specify the ways in which JBoss AS integrates with the implementations of various Java EE specifications.&#160; It does not specify details of the implementations themselves unless the correct behavior in JBoss AS depends on the specific behavior of the corresponding EE specification implementation.</p><h5>JNDI</h5><h6>Services</h6><ol><li>Each JNDI binding into the "java:" space shall have a corresponding MSC service.&#160; <em style="font-style: italic;">This includes programmatic bindings.</em><ol><li>Services corresponding to bindings in the "java:app" space shall be named "jboss.naming.context.java.app.binding.<em style="font-style: italic;">appname</em>.<em style="font-style: italic;">contextname</em>", where <em style="font-style: italic;">appname</em> is the EE application name and <em style="font-style: italic;">contextname</em> is the full JNDI context name, sans the leading "app/".</li><li>Services corresponding to bindings in the "java:module" space shall be named "jboss.naming.context.java.module.binding.<em style="font-style: italic;">appname</em>.<em style="font-style: italic;">modulename</em>.<em style="font-style: italic;">contextname</em>", where <em style="font-style: italic;">appname</em> is the EE application name, <em style="font-style: italic;">modulename</em> is the EE module name, and <em style="font-style: italic;">contextname</em> is the full JNDI context name, sans the leading "module/".</li><li>Services corresponding to bindings in the "java:comp" space shall be named "jboss.naming.context.java.comp.binding.<em style="font-style: italic;">appname</em>.<em style="font-style: italic;">modulename</em>.<em style="font-style: italic;">componentname</em>.<em style="font-style: italic;">contextname</em>", where <em style="font-style: italic;">appname</em> is the EE application name, <em style="font-style: italic;">modulename</em> is the EE module name, <em style="font-style: italic;">componentname</em> is the EE component name, and <em style="font-style: italic;">contextname</em> is the full JNDI context name, sans the leading "comp/".</li><li>Services corresponding to bindings in the "java:global" or any other space shall be named "jboss.naming.context.java.global.binding.<em style="font-style: italic;">contextname</em>" where <em style="font-style: italic;">contextname</em> is the full JNDI context name (including the leading "global/" if present).</li><li>In cases like the WAR case where one or more of these namespaces are aliased, the most general namespace is used.&#160; For example, in a WAR deployment the "java:comp" namespace and the "java:module" namespace are equivalent, so bindings into "java:comp" should be aliased into the "java:module" area with the service named as if the binding had gone into the "java:module" area.</li><li>In cases where an EE deployment unit is added outside of an application deployment (EAR), the application name is considered to be equal to the module name; in this case the preceding aliasing rule does not apply.</li></ol></li><li>Any binding service created from within, or on behalf of, a deployment unit shall have a dependency upon that deployment unit's "install" phase service, and shall be removed (with the corresponding bindings undone) with the deployment unit when the "install" phase service is removed.&#160; In this way, all bindings which were established on behalf of a deployment unit will be removed when the deployment unit is undeployed.</li></ol><h5>Interceptors</h5><ol><li>System-wide EJB interceptors should be specified in the domain configuration, except as specified below.</li><li>By default, our standard interceptors should be enabled, however each standard interceptor will have a corresponding domain element which can be used to disable that interceptor if so desired.</li><li>Custom interceptors can be specified in the appropriate subsystem by a combination of module name and class name.</li></ol><h5>Managed Beans and Java EE (non-CDI) Injection</h5><div><h6>Services</h6><ol><li>Each Managed Bean has a service which represents the availability of that Managed Bean.<ol><li>The service value is, or allows access to, a factory which produces proxy instances which access instances of that managed bean as defined in the EE and Managed Bean specifications.</li><li>The service shall be named "jboss.managed-bean.<em style="font-style: italic;">appname</em>.<em style="font-style: italic;">modulename</em>.<em style="font-style: italic;">name</em>", where <em style="font-style: italic;">appname</em> is the EE application name, <em style="font-style: italic;">modulename</em> is the EE module name, and <em style="font-style: italic;">name</em> is the name of the managed bean.</li></ol></li><li>The Managed Bean service depends on the JNDI binding service for its JNDI binding, if it is a named Managed Bean.</li><li>The Managed Bean service has a dependency upon the JNDI binding service corresponding to the mappedName (whether it is generated or specified) of each of its injected resources.</li><li>For unnamed (type-based) resource injections, a dependency is introduced from the injection's mappedName JNDI binding service to the service corresponding to the container-managed class (container-managed class is defined in <strong style="font-weight: bold;">EE.5.2.5</strong>).<ol><li>The class must be visible from the current module, including via a "Class-Path:" or modular dependency.</li><li>The list of visible container-managed classes is built and maintained during deployment on the deployment unit context, assembled from information collected from all immediate dependencies.</li></ol></li><li>For named (JNDI-based) resource injections where the source name is in the "java:" JNDI protocol space, a dependency is introduced from the injection's mappedName JNDI binding service to the service corresponding to the JNDI binding of the resource.</li><li>Resources on any interceptor classes associated with the Managed Bean are treated as dependencies the same way as resources associated with the Managed Bean itself.</li></ol><h6>Object Factory and Proxy</h6><ol><li>The object factory bound into JNDI shall only yield a valid instance if the corresponding Managed Bean service is UP.&#160; If the service is not UP, the object factory should block.&#160; If the service is failed, or if a dependency is failed or missing, then an exception should be thrown.&#160; A blocking object factory can be unblocked by a transition to either the UP state or a failed/missing state.</li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h5>EJB: Singleton Beans</h5><h6>Services</h6><ol><li>Each Singleton EJB has a corresponding MSC service.<ol><li>The service value is, or allows access to, a factory which produces proxy instances to the singleton instance. (<em style="font-style: italic;">TODO:</em> does this return the same proxy every time or a new one every time?)</li><li>The service shall be named "jboss.ejb.singleton.<em style="font-style: italic;">appname</em>.<em style="font-style: italic;">modulename</em>.<em style="font-style: italic;">beanname</em>" where <em style="font-style: italic;">appname</em> is the EE application name, <em style="font-style: italic;">modulename</em> is the EE module name, and <em style="font-style: italic;">beanname</em> is the name of the EJB.</li></ol></li><li>If the singleton is an <em style="font-style: italic;">eager</em> singleton, the service shall have an implicit service dependency on all other EJB and Servlet components' services (with the exception of other <em style="font-style: italic;">eager </em>EJB singletons, which must be explicitly depended on).&#160; This is because <em style="font-style: italic;">eager</em> singletons presume to have immediate access to any other services bound into JNDI.&#160; (<em style="font-style: italic;">Note</em>: perhaps we can somehow use lazy proxies to achieve this behavior instead, if this dependency becomes a problem)</li><li>Each Singleton EJB service shall have a dependency on services corresponding to the JNDI bindings of any resources injected via JNDI, as well as any such resources injected into any interceptor associated with this EJB configuration.</li><li><em style="font-style: italic;">TODO: Determine what rules (if any) pertain to service dependencies of things injected via CDI</em></li><li><em style="font-style: italic;"><br/></em></li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h5>EJB: Stateless Session Beans</h5><h6>Services</h6><ol><li>Each declared Stateless Session Bean has a corresponding MSC service.<ol><li>The service value is, or allows access to, a factory which produces proxy instances to an instance of this EJB, according to the rules of the EJB specification implementation.</li><li>The service shall be named "jboss.ejb.stateless.<em style="font-style: italic;">appname</em>.<em style="font-style: italic;">modulename</em>.<em style="font-style: italic;">beanname</em>" where <em style="font-style: italic;">appname</em> is the EE application name, <em style="font-style: italic;">modulename</em> is the EE module name, and <em style="font-style: italic;">beanname</em> is the name of the EJB.</li></ol></li><li>Each Stateless Session Bean EJB service shall have a dependency on services corresponding to&#160; the JNDI bindings of any resources injected via JNDI, as well as any such resources injected into any interceptor associated with this EJB configuration.</li><li>The instance pools utilized by the Stateless Session Bean portion of the EJB subsystem(s) shall be configurable via the domain model.</li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h5>EJB: Stateful Session Beans</h5><h6>Services</h6><ol><li>Each declared Stateful Session Bean has a corresponding MSC service.<ol><li>The service value is, or allows access to, a factory which produces proxy instances to an instance of this EJB, according to the rules of the EJB specification implementation.</li><li>The service shall be named "jboss.ejb.stateful.<em style="font-style: italic;">appname</em>.<em style="font-style: italic;">modulename</em>.<em style="font-style: italic;">beanname</em>" where <em style="font-style: italic;">appname</em> is the EE application name, <em style="font-style: italic;">modulename</em> is the EE module name, and <em style="font-style: italic;">beanname</em> is the name of the EJB.</li></ol></li><li>Each Stateful Session Bean EJB service shall have a dependency on services corresponding to the JNDI bindings of any resources injected via JNDI, as well as any such resources injected into any interceptor associated with this EJB definition.</li><li>In order to meet the requirements for proper JPA integration, construction of stateful EJB instances shall happen at the time of the original lookup, as opposed to being constructed lazily.</li><li>In order to meet the requirements for proper CDI integration, the expiration policy or lifecycle of the EJB must be controllable externally in cases where CDI manages the overall session lifecycle.</li><li>When constructing a stateful EJB from any context, the transaction, persistence, and security context from the constructing thread must be propagating to the thread which is constructing <em style="font-style: italic;">and</em> initializing the EJB instance.&#160; This is most easily accomplished by reusing the same thread for this purpose.</li><li>The domain model for the Stateful Session Bean portion of the EJB subsystem(s) shall allow configuration of:<ol><li>Cache size</li><li>Default timeouts (idle and passivation)</li><li>Passivation (enable or disable)</li></ol></li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h5>EJB: Message-Driven Beans (MDBs)</h5><h6>Services</h6><ol><li>Each declared MDB has a corresponding MSC service.<ol><li>The service shall be named "jboss.ejb.mdb.<em style="font-style: italic;">appname</em>.<em style="font-style: italic;">modulename</em>.<em style="font-style: italic;">beanname</em>" where <em style="font-style: italic;">appname</em> is the EE application name, <em style="font-style: italic;">modulename</em> is the EE module name, and <em style="font-style: italic;">beanname</em> is the name of the MDB.</li><li>When started, the service shall cause endpoint activation to occur on the resource adapter as well as initiating the management of MDB instances.</li><li>When stopped, the service shall cause endpoint deactivation to occur.</li></ol></li><li>Each MDB service shall have a dependency upon the service that corresponds to the JCA Resource Adapter defined by the MDB configuration.</li><li>Each MDB service shall have a dependency upon services corresponding to any resources injected via JNDI, as well as any such resources injected into any interceptor associated with this MDB definition.</li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h5>JCA: Message Inflow</h5><h6>Services</h6><ol><li>Each JCA Resource Adapter (RA) shall have a corresponding MSC service.<ol><li>(service name req.)</li></ol></li><li>Each JCA RA service shall have a dependency on services corresponding to the JNDI bindings of any resources injected via JNDI.</li></ol><div> </div><h5>Class Loading and Modularization of EE Deployments</h5><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h4>Important Note!</h4><p>Please forward all questions and comments about this documentation to <a class="jive-link-email-small" href="mailto:jboss-as7-dev@lists.jboss.org">jboss-as7-dev@lists.jboss.org</a>.&#160; Comments on this article have been disabled.</p></div></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">

        <p style="margin: 0;">Create a new document in JBoss AS7 Development at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2225">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>