I have an EJB bean that works with two interfaces, as shown below: The local interface for my web application, and the remote interface for my App Client
@Stateless public class CoreMainEJB implements CoreMainEJBRemote, CoreMainEJBLocal {
so my app client is as follows. In this case, the remote method is called.
public class Main { @EJB private static CoreMainEJBRemote coreEJBRemote; public static void main(String[] args) { coreEJBRemote.process(args[0]); } }
From my web application, I call as shown below. In this case, the local method is called.
@ManagedBean @RequestScoped public class DisplayInbound { @EJB private CoreMainEJBLocal coreMainEJBLocal; public void processPackages() { coreMainEJBLocal.process(...); } }
So, here is my question: If EJB only opened the @Remote interface, but in your web application you enter the EJB bean directly, and not its remote interface, will this cause a remote call or a local call? For instance:
@Stateless public class CoreMainEJB implements CoreMainEJBRemote{
and in a web application, I do it
@EJB private CoreMainEJB coreMainEJB; public void processPackages() { coreMainEJB.process(...);
source share