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

1. 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.

2. 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

1. The Reference Implementation (RI) Server

1. {@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.

2. The IntraVM Server

1. {@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.

2. {@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

- OpenEJB website
- OpenEJB Datasheet
- Not subscribed to the mailing list? Subscribe me!

@see org.openejb.core.ContainerSystem @see org.openejb.core.ContainerManager @see org.openejb.core.Container @see org.openejb.core.DeploymentInfo