The IntraVM server. Allows for interaction among beans in the same virtual machine while respecting the remote semantics required by EJB.
There are two servers in OpenEJB
|
- The Reference Implementation (RI) Server
- All communication with clients/beans is remote, over a network, distributed and done with sockets.
- Has a network based JNDI naming server.
- Method invocation process = Client/Bean > Proxy > Handler > method & arguments are serialized > Ri Server > Container > Ri Server > return value is serialized > Handler > Proxy > Client/Bean.
- It is for reference only and not intended for production use.
- The IntraVM Server
- All communication with clients/beans is local, in the same computer, in the same VM, and done using thread-specific storage.
- Has a thread-based JNDI naming server.
- Method invocation process = Client/Bean > Proxy > Handler > arguments are copied > Container > return value is copied > Handler > Proxy > Client/Bean.
- It is a core part of the container system and required by the EJB spec that all same-vm calls be treaded like they remote.
Proxy Handlers for each server are as follows
|
- The Reference Implementation (RI) Server
- {@link org.openejb.ri.server.EjbProxyHandler}
- Serialized and sent along with a Proxy to serve as an EJBHome or EJBObject to a remote client/bean in the network.
- Handles method invocations by serializing them and sending them over the network to the Ri Server.
- Thread-Based, the RI Server dedicates a new thread to each EjbProxyHandler it returns to the client. Method invocations received by the RI Server from the Proxy and EjbProxyHandler are executed on the container in the handler's dedicated thread.
- The IntraVM Server
- {@link org.openejb.core.ivm.EjbHomeProxyHandler} (subclass of {@link org.openejb.core.ivm.BaseEjbProxyHandler})
- Instantiated and sent along with a Proxy to serve as an EJBHome to a local client/bean in the same VM.
- Handles method invocations by copying the arguments and passing them directly to the container.
- Not Thread-Based, only one EjbHomeProxyHandler is needed per/bean-deployment.
- {@link org.openejb.core.ivm.EjbObjectProxyHandler} (subclass of {@link org.openejb.core.ivm.BaseEjbProxyHandler})
- Instantiated and sent along with a Proxy to serve as an EJBObject to a local client/bean in the same VM.
- Handles method invocations by copying the arguments and passing them directly to the container.
- Thread-Based, one EjbHomeProxyHandler is needed for each EJBObject created.
Package Specification
OpenEJB Specification
Related Documentation
@see org.openejb.core.ContainerSystem
@see org.openejb.core.ContainerManager
@see org.openejb.core.Container
@see org.openejb.core.DeploymentInfo