EJB's - when to use Remote and/or local interfaces?

前端 未结 4 1390
温柔的废话
温柔的废话 2020-12-02 03:30

I\'m very new to Java EE and I\'m trying to understand the concept of Local interfaces and Remote interfaces. I\'ve been told that one of the big advantages of Java EE is th

4条回答
  •  自闭症患者
    2020-12-02 04:32

    This may answers your concerns :

    Generally, your Enterprise Java Bean will need a remote client view in cases when you plan to use the bean in distributed environments. Specifically, these are the cases when the client that will be working with it will be in a different Java Virtual Machine (JVM). In the case of a remote client view, calling any method from the remote home interface and/or remote component interface will be handled via remote method invocation (RMI).

    An EJB can use local client view only if it is really guaranteed that other enterprise beans or clients will only address the bean within a single JVM. If this is the case, such access will be carried out with direct method calls, instead of RMI.

    Source: http://www.onjava.com/pub/a/onjava/2004/11/03/localremote.html?page=last&x-showcontent=text

提交回复
热议问题