3/26/2005

Naming, java:comp

The application component's container provides it with a JNDI Context (InitialContext) instance that stores the Naming Environment that component accesses. Component obtains objects enlisted in its environment thru JNDI Interfaces. Environment entries are immutable.

Deployment descriptors are the recommended place for declaring component environment. The component can use some other mechanism to specify or lookup its environmental attributes. Keeping them in DDs makes it easier for assembler/deployer to change env properties without the need to modify the code.

The application component's naming environment is available at "java:comp/env". This is the root of the naming environment tree.
for EJB references recommended context is java:comp/env/ejb i.e. references should be named as ejb/Ejb1 ...
Environment is specified as env-entry, ejb-ref, resource-ref, message-destination-ref as the case may be.

No comments:

Post a Comment