Save This Page
Home » jboss-5.0.0.CR1-src » org » jboss » ejb » [javadoc | source]
org.jboss.ejb
abstract public class: Container [javadoc | source]
java.lang.Object
   org.jboss.mx.util.JBossNotificationBroadcasterSupport
      org.jboss.system.ServiceMBeanSupport
         org.jboss.ejb.Container

All Implemented Interfaces:
    ContainerMBean, AllowedOperationsFlags, org.jboss.kernel.spi.dependency.KernelControllerContextAware, ServiceMBean, MBeanRegistration, NotificationEmitter

Direct Known Subclasses:
    StatefulSessionContainer, SessionContainer, StatelessSessionContainer, MessageDrivenContainer, EntityContainer

This is the base class for all EJB-containers in JBoss. A Container functions as the central hub of all metadata and plugins. Through this the container plugins can get hold of the other plugins and any metadata they need.

The EJBDeployer creates instances of subclasses of this class and calls the appropriate initialization methods.

A Container does not perform any significant work, but instead delegates to the plugins to provide for all kinds of algorithmic functionality.

Nested Class Summary:
abstract protected class  Container.AbstractContainerInterceptor  The base class for container interceptors.

All container interceptors perform the same basic functionality and only differ slightly. 

class  Container.MBeanServerAction  Perform the MBeanServer.invoke op in a PrivilegedExceptionAction if running with a security manager. 
Field Summary
public static final  String BASE_EJB_CONTAINER_NAME     
public static final  ObjectName ORB_NAME     
public static final  ObjectName EJB_CONTAINER_QUERY_NAME     
protected static final  Method EJBOBJECT_REMOVE     
protected static final  Method EJB_TIMEOUT    A reference to javax.ejb.TimedObject#ejbTimeout
protected  EjbModule ejbModule    This is the application that this container is a part of 
protected  ClassLoader classLoader    This is the classloader of this container. All classes and resources that the bean uses will be loaded from here. By doing this we make the bean re-deployable 
protected  ClassLoader webClassLoader    The class loader for remote dynamic classloading 
protected  BeanMetaData metaData    This is the new metadata. it includes information from both ejb-jar and jboss.xml the metadata for the application can be accessed trough metaData.getApplicationMetaData() 
protected  Class beanClass    This is the EnterpriseBean class 
protected  Class homeInterface    This is the Home interface class 
protected  Class remoteInterface    This is the Remote interface class 
protected  Class localHomeInterface    The local home interface class 
protected  Class localInterface    The local inteface class 
protected  TransactionManager tm    This is the TransactionManager 
protected  String securityContextClassName    The Security Context FQN 
protected  String defaultSecurityDomain    Security Domain to fall back on 
protected  ISecurityManagement securityManagement    SecurityManagement Instance - holder of all security managers 
protected  PolicyRegistration policyRegistration    PolicyRegistration - Holds Authorization Policies 
protected  AuthenticationManager sm    This is the SecurityManager 
protected  RealmMapping rm    This is the realm mapping 
protected  Object securityProxy    The custom security proxy used by the SecurityInterceptor 
protected  BeanLockManager lockManager    This is the bean lock manager that is to be used 
protected  LocalProxyFactory localProxyFactory    ??? 
protected  Map marshalledInvocationMapping    Maps for MarshalledInvocation mapping 
protected  HashMap proxyFactories    HashMap for the invoker bindings 
protected  ThreadLocal proxyFactoryTL    The Proxy factory is set in the Invocation. This TL is used for methods that do not have access to the Invocation. 
protected  long createCount    The number of create invocations that have been made 
protected  long removeCount    The number of create invocations that have been made 
protected  InvocationStatistics invokeStats    Time statistics for the invoke(Invocation) methods 
protected  String jaccContextID    The JACC context id for the container 
protected  boolean isJaccEnabled    Flag to denote whether a JACC configuration has been fitted for authorization 
protected  EJBTimerService timerService     
Fields inherited from org.jboss.system.ServiceMBeanSupport:
SERVICE_CONTROLLER_SIG,  log,  server,  serviceName
Method from org.jboss.ejb.Container Summary:
addInterceptor,   addProxyFactory,   cleanENC,   createBeanClassInstance,   createContainerInterceptor,   createService,   destroyService,   getBeanClass,   getBeanMetaData,   getClassLoader,   getCreateCount,   getDefaultSecurityDomain,   getDeploymentInfo,   getDeploymentUnit,   getEjbModule,   getEnvContext,   getHomeClass,   getInvokeStats,   getJaccContextID,   getJmxName,   getLocalClass,   getLocalHomeClass,   getLockManager,   getMessageDestination,   getMethodPermissions,   getPolicyRegistration,   getProxyFactory,   getRealmMapping,   getRemoteClass,   getRemoveCount,   getSecurityContextClassName,   getSecurityManagement,   getSecurityManager,   getSecurityProxy,   getTimerService,   getTimerService,   getTransactionManager,   getWebClassLoader,   internalInvoke,   internalInvokeHome,   invoke,   isCallByValue,   isJaccEnabled,   lookupProxyFactory,   popENC,   pushENC,   removeTimerService,   restoreTimers,   setBeanMetaData,   setClassLoader,   setDefaultSecurityDomain,   setDeploymentInfo,   setDeploymentUnit,   setEjbModule,   setJaccContextID,   setJaccEnabled,   setLockManager,   setPolicyRegistration,   setProxyFactory,   setRealmMapping,   setSecurityContextClassName,   setSecurityManagement,   setSecurityManager,   setSecurityProxy,   setTimerService,   setTransactionManager,   setWebClassLoader,   startService,   stopService
Methods from org.jboss.system.ServiceMBeanSupport:
create,   createService,   destroy,   destroyService,   getDeploymentInfo,   getLog,   getName,   getNextNotificationSequenceNumber,   getObjectName,   getServer,   getServiceName,   getState,   getStateString,   jbossInternalCreate,   jbossInternalDescription,   jbossInternalDestroy,   jbossInternalLifecycle,   jbossInternalStart,   jbossInternalStop,   pojoChange,   pojoCreate,   pojoDestroy,   pojoStart,   pojoStop,   postDeregister,   postRegister,   preDeregister,   preRegister,   setKernelControllerContext,   start,   startService,   stop,   stopService,   unsetKernelControllerContext
Methods from org.jboss.mx.util.JBossNotificationBroadcasterSupport:
addNotificationListener,   getNotificationInfo,   handleNotification,   nextNotificationSequenceNumber,   removeNotificationListener,   removeNotificationListener,   sendNotification
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jboss.ejb.Container Detail:
 abstract public  void addInterceptor(Interceptor in)
 public  void addProxyFactory(String invokerBinding,
    EJBProxyFactory factory) 
 public  void cleanENC() 
    cleanup ENC on shutdown
 public Object createBeanClassInstance() throws Exception 
    Returns a new instance of the bean class or a subclass of the bean class. This factory style method is speciffically used by a container to supply an implementation of the abstract accessors in EJB2.0, but could be usefull in other situations. This method should ALWAYS be used instead of getBeanClass().newInstance();
 abstract Interceptor createContainerInterceptor()
 protected  void createService() throws Exception 
    The EJBDeployer calls this method. The EJBDeployer has set all the plugins and interceptors that this bean requires and now proceeds to initialize the chain. The method looks for the standard classes in the URL, sets up the naming environment of the bean. The concrete container classes should override this method to introduce implementation specific initialization behaviour.
 protected  void destroyService() throws Exception 
    A default implementation of destroying the container service (no-op). The concrete container classes should override this method to introduce implementation specific destroy behaviour.
 public Class getBeanClass() 
    Returns the bean class instance of this container.
 public BeanMetaData getBeanMetaData() 
    Returns the metadata of this container.
 public ClassLoader getClassLoader() 
    Returns the classloader for this container.
 public long getCreateCount() 
    Gets the number of create invocations that have been made
 public String getDefaultSecurityDomain() 
 public final DeploymentInfo getDeploymentInfo() 
Deprecated! use - DeploymentUnit accessors

    Gets the DeploymentInfo for this Container
 public final VFSDeploymentUnit getDeploymentUnit() 
 public EjbModule getEjbModule() 
    Gets the application deployment unit for this container. All the bean containers within the same application unit share the same instance.
 public Context getEnvContext() throws NamingException 
    Get the components environment context
 public Class getHomeClass() 
    this actually should be called remotehome, but for interface compliance purposes we keep it like that
 public InvocationStatistics getInvokeStats() 
    Gets the invocation statistics collection
 public String getJaccContextID() 
 public ObjectName getJmxName() 
    Build a JMX name using the pattern jboss.j2ee:service=EJB,jndiName=[jndiName] where the [jndiName] is either the bean remote home JNDI binding, or the local home JNDI binding if the bean has no remote interfaces.
 public Class getLocalClass() 
 public Class getLocalHomeClass() 
 public BeanLockManager getLockManager() 
 public MessageDestinationMetaData getMessageDestination(String link) 
 public Set getMethodPermissions(Method m,
    InvocationType iface) 
    Returns the permissions for a method. (a set of roles)
 public PolicyRegistration getPolicyRegistration() 
 public EJBProxyFactory getProxyFactory() 
 public RealmMapping getRealmMapping() 
 public Class getRemoteClass() 
 public long getRemoveCount() 
    Gets the number of remove invocations that have been made
 public String getSecurityContextClassName() 
 public ISecurityManagement getSecurityManagement() 
 public AuthenticationManager getSecurityManager() 
 public Object getSecurityProxy() 
 public EJBTimerService getTimerService() 
 public TimerService getTimerService(Object pKey) throws IllegalStateException 
    Creates the single Timer Service for this container if not already created
 public TransactionManager getTransactionManager() 
    Returns this container's transaction manager.
 public ClassLoader getWebClassLoader() 
    Get the class loader for dynamic class loading via http.
 abstract public Object internalInvoke(Invocation mi) throws Exception
    This method is called when a method call comes in on an EJBObject. The Container forwards this call to the interceptor chain for further processing.
 abstract public Object internalInvokeHome(Invocation mi) throws Exception
    This method is called when a method call comes in on the Home object. The Container forwards this call to the interceptor chain for further processing.
 public Object invoke(Invocation mi) throws Exception 
    The detached invoker operation.
 public boolean isCallByValue() 
    Whether the bean is call by value
 public boolean isJaccEnabled() 
    Get the flag whether JACC is enabled
 public EJBProxyFactory lookupProxyFactory(String binding) 
 public  void popENC() 
 public  void pushENC() 
    push the ENC onto the stack so that java:comp works
 public  void removeTimerService(Object pKey) throws IllegalStateException 
    Removes Timer Service for this container
 protected  void restoreTimers() 
    Restore any timers previously persisted for this container
 public  void setBeanMetaData(BeanMetaData metaData) 
    Sets the meta data for this container. The meta data consists of the properties found in the XML descriptors.
 public  void setClassLoader(ClassLoader cl) 
    Sets the class loader for this container. All the classes and resources used by the bean in this container will use this classloader.
 public  void setDefaultSecurityDomain(String defaultSecurityDomain) 
 public final  void setDeploymentInfo(DeploymentInfo di) 
Deprecated! use - DeploymentUnit accessors

    Sets the DeploymentInfo of this Container
 public final  void setDeploymentUnit(VFSDeploymentUnit di) 
 public  void setEjbModule(EjbModule app) 
    Sets the application deployment unit for this container. All the bean containers within the same application unit share the same instance.
 public  void setJaccContextID(String id) 
 public  void setJaccEnabled(boolean isJaccEnabled) 
    Set the flag that JACC is enabled
 public  void setLockManager(BeanLockManager lockManager) 
 public  void setPolicyRegistration(PolicyRegistration policyRegistration) 
 public  void setProxyFactory(Object factory) 
 public  void setRealmMapping(RealmMapping rm) 
 public  void setSecurityContextClassName(String securityContextClassName) 
 public  void setSecurityManagement(ISecurityManagement securityManagement) 
 public  void setSecurityManager(AuthenticationManager sm) 
 public  void setSecurityProxy(Object proxy) 
 public  void setTimerService(EJBTimerService timerService) 
 public  void setTransactionManager(TransactionManager tm) 
    Sets a transaction manager for this container.
 public  void setWebClassLoader(ClassLoader webClassLoader) 
    Set the class loader for dynamic class loading via http.
 protected  void startService() throws Exception 
    A default implementation of starting the container service. The container registers it's dynamic MBean interface in the JMX base. The concrete container classes should override this method to introduce implementation specific start behaviour. todo implement the service lifecycle methods in an xmbean interceptor so non lifecycle managed ops are blocked when mbean is not started.
 protected  void stopService() throws Exception 
    A default implementation of stopping the container service (no-op). The concrete container classes should override this method to introduce implementation specific stop behaviour.