Class AppJndiNamingStrategy
- java.lang.Object
-
- org.wicketstuff.javaee.naming.global.AppJndiNamingStrategy
-
- All Implemented Interfaces:
Serializable
,IJndiNamingStrategy
public class AppJndiNamingStrategy extends Object implements IJndiNamingStrategy
Simple Java EE 6 Global JNDI naming support for java:app prefixed JNDI names based on the EJB 3.1 specification Section 4.4.1.1, page 84
The java:app prefix allows a component executing within a Java EE application to access an application-specific namespace.
With this you can use JNDI names in the following format:
java:app/<moduleName>/<bean-name>[!<fully-qualified-interface-name>]
The moduleName is the name of the module in which the session bean is packaged. In a stand-alone ejb-jar file or .war file, the moduleName defaults to the base name of the module with any filename extension removed. In an ear file, the moduleName defaults to the pathname of the module with any filename extension removed, but with any directory names included. The default moduleName can be overriden using the module-name element of ejb-jar.xml (for ejb-jar files) or web.xml (for .war files).
- Author:
- Peter Major
- See Also:
- EJB 3.1 specification, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AppJndiNamingStrategy(String moduleName)
This naming strategy will use the java:global JNDI name format for lookups.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
calculateName(String ejbName, Class<?> ejbType)
Calculates the JNDI name based on the given name and type
-
-
-
Constructor Detail
-
AppJndiNamingStrategy
public AppJndiNamingStrategy(String moduleName)
This naming strategy will use the java:global JNDI name format for lookups. Use this constructor, if the app-name is not defined.- Parameters:
moduleName
- The name of the module
-
-
Method Detail
-
calculateName
public String calculateName(String ejbName, Class<?> ejbType)
Calculates the JNDI name based on the given name and type- Specified by:
calculateName
in interfaceIJndiNamingStrategy
- Parameters:
ejbName
- The name value for the EJB annotation.ejbType
- The type of the injectable field.- Returns:
- The full JNDI name for the given field based on a naming strategy.
-
-