Create an Interface- this will be the remote interface of your Stateless EJB:
package com.pierre;
public interface Messenger {
String getMessage(String name);
}
Create the Implementation:
package com.pierre;
import javax.ejb.Remote;
import javax.ejb.Stateless;
@Stateless
@Remote(Messenger.class)
public class MessengerSB implements Messenger {
public String getMessage(String name) {
return "Ciao " + name;
}
}
Deploy your project to the WebLogic Server:
You will magically get this:
Application Name: PVEJB30Test
EJB Module Name:PVEJB30Test
Bean Name: MessengerSB
Easy. It could be easier (for instance, not having to create the Interface) but it's easy.
In the JNDI tree you will get:
PVEJB30TestPVEJB30TestMessengerSB_Home (=
and
|
No comments:
Post a Comment