Title: JNDI Names # What's My Bean's JNDI Name? There are two things to keep in mind before you start reading: 1 OpenEJB provides a default JNDI name to your EJB. 2 You can customize the JNDI name. ## Default JNDI name The default JNDI name is in the following format: {deploymentId}{interfaceType.annotationName} Lets try and understand the above format. Both *deploymentId* and *interfaceType.annotationName* are pre-defined variables. There are other pre-defined variables available which you could use to customize the JNDI name format. # JNDI Name Formatting The *openejb.jndiname.format* property allows you to supply a template for the global JNDI names of all your EJBs. With it, you have complete control over the structure of the JNDI layout can institute a design pattern just right for your client apps. See the [Service Locator](service-locator.html) doc for clever ways to use the JNDI name formatting functionality in client code.
variable | description |
moduleId | Typically the name of the ejb-jar file or the |
ejbType | STATEFUL, STATELESS, BMP_ENTITY, CMP_ENTITY, or MESSAGE_DRIVEN |
ejbClass | for a class named org.acme.superfun.WidgetBean results in org.acme.superfun.WidgetBean |
ejbClass.simpleName | for a class named org.acme.superfun.WidgetBean results in WidgetBean |
ejbClass.packageName | for a class named org.acme.superfun.WidgetBean results in org.acme.superfun |
ejbName | The ejb-name as specified in xml or via the 'name' attribute in an @Stateful, @Stateless, or @MessageDriven annotation |
deploymentId | The unique system id for the ejb. Typically the ejbName unless specified in the openejb-jar.xml or via changing the openejb.deploymentId.format |
interfaceType | see interfaceType.annotationName |
interfaceType.annotationName | Following the EJB 3 annotations @RemoteHome, @LocalHome, @Remote and @Local RemoteHome (EJB 2 EJBHome) LocalHome (EJB 2 EJBLocalHome) Remote (EJB 3 Business Remote) Local (EJB 3 Business Local) Endpoint (EJB webservice endpoint) |
interfaceType.annotationNameLC | This is the same as interfaceType.annotationName, but all in lower case. |
interfaceType.xmlName | Following the ejb-jar.xml descriptor elements |
interfaceType.xmlNameCc | Camel-case version of interfaceType.xmlName: Home (EJB 2 EJBHome) LocalHome (EJB 2 EJBLocalHome) BusinessRemote (EJB 3 Business Remote) BusinessLocal (EJB 3 Business Local) ServiceEndpoint (EJB webservice endpoint) |
interfaceType.openejbLegacyName Following the OpenEJB 1.0 hard-coded format: (empty string) (EJB 2 EJBHome) Local (EJB 2 EJBLocalHome) BusinessRemote (EJB 3 Business Remote) BusinessLocal (EJB 3 Business Local) ServiceEndpoint (EJB webservice endpoint) | |
interfaceClass |
(business) for a class named org.acme.superfun.WidgetRemote results in org.acme.superfun.WidgetRemote (home) for a class named org.acme.superfun.WidgetHome results in org.acme.superfun.WidgetHome |
interfaceClass.simpleName | (business) for a class named org.acme.superfun.WidgetRemote results in WidgetRemote (home) for a class named org.acme.superfun.WidgetHome results in WidgetHome |
interfaceClass.packageName | for a class named org.acme.superfun.WidgetRemote results in org.acme.superfun |