Issue Details (XML | Word | Printable)

Key: OPENEJB-253
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: David Blevins
Reporter: Mohammad Nour
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenEJB

Per EJB or EJB Interface JNDI Name declaration

Created: 06/Aug/06 02:54 PM   Updated: 06/Nov/07 05:17 PM  Due: 25/Sep/06
Return to search
Component/s: ejb3 simplified
Affects Version/s: 3.0-beta-1
Fix Version/s: 3.0-beta-2

Time Tracking:
Not Specified

Resolution Date: 06/Nov/07 05:13 PM


 Description  « Hide
1- The current implementation of OEJB prefixes the JNDI names of local Home interface of an EJB by the word *Local*, that is the client would not expect to use when he\she tries to look up the bean.

2- When and EJB3.0 bean supports the backward compatible 2.1 Home interface and business interface, there is no way to specify separate JNDI names to each interface.

We should make the client being able to do this. One way is to make changes to the openejb-jar.xml schema to add new elements and attributes to give the client this ability, an example of an *ejb-deplyment* is as follows:

<ejb-deployment ejb-name="ExampleStatelessBean" container-id="Default Stateless Container">
      
    <deployment-id
               jndi-name="client/tests/stateless/BasicStatelessHomeInterface"
               interface-name="ejb3.beans.interfaces.BeanLocalHomeInterface" />
 
    <deployment-id
               jndi-name="client/tests/stateless/BasicStatelessBizInterface"
               interface-name="ejb3.beans.interfaces.BeanLocalBizInterface" isRemote="false" />
 
</ejb-deployment>

Comments will be added as soon as we agree upon how to tackle this problem.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mohammad Nour added a comment - 14/Aug/06 04:20 PM
The latest suggestion from DBlevins is:

<ejb-deployment deployment-id="SomeBean" ...>
  <jndi-name interface="some.bean.SomeBeanLocalHomeInterface">some/jndi/name/SomeBeanLocalHome</jndi-name>
  <jndi-name interface="some.bean.SomeBeanRemoteHomeInterface">some/jndi/name/SomeBeanRemoteHome</jndi-name>
  <jndi-name interface="some.bean.SomeBeanRemoteBusinessInterface">some/jndi/name/SomeBeanRemoteBizIntfc</jndi-name>
  <jndi-name interface="some.bean.SomeBeanLocalBusinessInterface">some/jndi/name/SomeBeanLocalBizIntfc</jndi-name>
</ejb-deployment>

I give +1 on that and I think it is the best one till now.

David Blevins made changes - 26/Sep/07 11:41 PM
Field Original Value New Value
Fix Version/s 3.0.x [ 12312806 ]
Fix Version/s 3.0-beta-1 [ 12312075 ]
Summary We need to make the client be able to explicitly define the JNDI names of different interfaces provided the EJB Per EJB or EJB Interface JNDI Name declaration
David Blevins made changes - 26/Sep/07 11:49 PM
Affects Version/s 3.0-beta-1 [ 12312075 ]
Affects Version/s 3.0.x [ 12312806 ]
David Blevins made changes - 27/Sep/07 03:17 AM
Affects Version/s 3.0.x [ 12312806 ]
Affects Version/s 3.0-beta-1 [ 12312075 ]
David Blevins made changes - 06/Nov/07 05:06 PM
Assignee David Blevins [ dblevins ]
Repository Revision Date User Message
ASF #592489 Tue Nov 06 17:13:16 UTC 2007 dblevins OPENEJB-253: Per EJB or EJB Interface JNDI Name declaration

Added this format to the openejb-jar.xml :
<jndi name="foo" interface="org.acme.Foo"/>

Or more generally...
<jndi name="foo" interface="Remote"/>

Or more generally still...
<jndi name="foo"/>

The 'name' attribute can still use templates if it likes, such as:
<jndi name="ejb/{interfaceClass.simpleName}" interface="org.acme.Foo"/>
Files Changed
ADD /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiNameInfo.java
MODIFY /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanInfo.java
MODIFY /openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/oejb3/EjbDeployment.java
MODIFY /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java
ADD /openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/oejb3/Jndi.java

David Blevins added a comment - 06/Nov/07 05:13 PM
$ svn ci
Sending container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanInfo.java
Sending container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java
Adding container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiNameInfo.java
Sending container/openejb-jee/src/main/java/org/apache/openejb/jee/oejb3/EjbDeployment.java
Adding container/openejb-jee/src/main/java/org/apache/openejb/jee/oejb3/Jndi.java
Transmitting file data .....
Committed revision 592489.


David Blevins made changes - 06/Nov/07 05:13 PM
Resolution Fixed [ 1 ]
Fix Version/s 3.0.x [ 12312806 ]
Fix Version/s 3.0-beta-2 [ 12312804 ]
Status Open [ 1 ] Closed [ 6 ]
David Blevins added a comment - 06/Nov/07 05:17 PM
Added this format to the openejb-jar.xml :
<jndi name="foo" interface="org.acme.Foo"/>

Or more generally...
<jndi name="foo" interface="Remote"/>

Or more generally still...
<jndi name="foo"/>

The 'name' attribute can still use templates if it likes, such as:
<jndi name="ejb/{interfaceClass.simpleName}" interface="org.acme.Foo"/>


Repository Revision Date User Message
ASF #594005 Mon Nov 12 02:12:39 UTC 2007 dblevins Actually functioning, OPENEJB-253: Per EJB or EJB Interface JNDI Name declaration
Files Changed
MODIFY /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/EjbModule.java
ADD /openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/JndiNameTest.java
MODIFY /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/EjbJarInfoBuilder.java
MODIFY /openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/oejb3/Jndi.java