EJB 3 can implement 2 remote interfaces?

I have 2 remote interfaces, say Example.java and RealExample.java . My bean Bean.java implements these 2 remote interfaces.

According to the EJB 3.0 specification, we can implement 2 remote interfaces in one bean. My first interface is in a.jar and the other interface is in b.jar .

How can I make sure that the appropriate stubs are generated in aclient.jar and bClient.jar . I do not want my stubs to be in the same bank.

+4
source share
2 answers

Yes, EJB 3 can implement two remote interfaces. How stubs are created and in which JAR files are placed that go beyond the EJB specification: it is vendor specific.

I can say that the WebSphere Application Server creation tool createEJBStubs will create stubs in the same JAR as the interfaces themselves.

+3
source

Since adding dynamic proxies to the JDK and dynamic RMI-IIOP (2006), modern application servers have not required the ancient concept of manually creating cigarette butts (not to mention the even older concept of skeletons).

eg. at least JBoss AS 4.x +, Glassfish, and partly WebSphere 7 all you need to include in client banks are interfaces. Nothing more is needed. (Unfortunately, for some unknown reason, WebSphere partially implements this relatively simple function, so if you use WebSphere and have a Java SE client, I feel your pain)

Btw, also note that the proxy server that you retrieve from the remote server can be directly passed to the interface. No PortableRemoteObject (another ancient one) or something like that.

+3
source

All Articles