Show Table of Contents
21.3.2. Container Plug-in Framework
The JBoss EJB container uses a framework pattern that allows one to change implementations of various aspects of the container behavior. The container itself does not perform any significant work other than connecting the various behavioral components together. Implementations of the behavioral components are referred to as plugins, because you can plug in a new implementation by changing a container configuration. Examples of plug-in behavior you may want to change include persistence management, object pooling, object caching, container invokers and interceptors. There are four subclasses of the
org.jboss.ejb.Container class, each one implementing a particular bean type:
- org.jboss.ejb.EntityContainer: handles
javax.ejb.EntityBeantypes - org.jboss.ejb.StatelessSessionContainer: handles Stateless
javax.ejb.SessionBeantypes - org.jboss.ejb.StatefulSessionContainer: handles Stateful
javax.ejb.SessionBeantypes - org.jboss.ejb.MessageDrivenContainer handles
javax.ejb.MessageDrivenBeantypes
The EJB containers delegate much of their behavior to components known as container plug-ins. The interfaces that make up the container plugin points include the following:
- org.jboss.ejb.ContainerPlugin
- org.jboss.ejb.ContainerInvoker
- org.jboss.ejb.Interceptor
- org.jboss.ejb.InstancePool
- org.jboss.ejb.InstanceCache
- org.jboss.ejb.EntityPersistanceManager
- org.jboss.ejb.EntityPersistanceStore
- org.jboss.ejb.StatefulSessionPersistenceManager
The container's main responsibility is to manage its plug-ins. This means ensuring that the plug-ins have all the information they need to implement their functionality.
21.3.2.1. org.jboss.ejb.ContainerPlugin
The
ContainerPlugin interface is the parent interface of all container plug-in interfaces. It provides a callback that allows a container to provide each of its plug-ins a pointer to the container the plug-in is working on behalf of. The ContainerPlugin interface is given below.
Example 21.4. The org.jboss.ejb.ContainerPlugin interface
public interface ContainerPlugin
extends Service, AllowedOperationsFlags
{
/** co
* This callback is set by the container so that the plugin
* may access its container
*
* @param con the container which owns the plugin
*/
public void setContainer(Container con);
}

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.