org.objectweb.jonas_ejb.container
Class JContainer

java.lang.Object
  |
  +--org.objectweb.jonas_ejb.container.JContainer
All Implemented Interfaces:
Container

public class JContainer
extends java.lang.Object
implements Container

This class represents an EJB container. A container is where an enterprise Bean object lives. All beans from a same ejb-jar file are installed in a single container. For each EJB installed, the container provides a factory and makes it available in the JNDI name space. The JContainer basically manages a set of BeanFactory objects.


Field Summary
 java.lang.String fileName
           
 java.lang.String myname
           
 JStatefulPool statefulSessionPool
           
 
Constructor Summary
JContainer(java.lang.String name, java.lang.String file, java.lang.ClassLoader ld)
          constructor
 
Method Summary
 BeanFactory addBean(BeanDesc dd)
          Adds beans in container.
protected  void checkSecurity(java.lang.String methodSignature)
          Check Security.
 int getBeanNb()
           
 java.lang.ClassLoader getClassLoader()
          Returns the classloader used for this Container
 org.enhydra.naming.ContainerNaming getContainerNaming()
          return the ContainerNaming object used internally by all the EJB Container classes.
 java.util.Set getDataSourceDependence(java.lang.String dsName)
          Management method used by the EJBServiceImpl MBean.
 int getEntityBMPNb()
           
 int getEntityCMPNb()
           
 java.lang.String getFileName()
          Return the file name of the container (.xml or .jar)
 java.util.Set getJmsConnectionFactoryDependence(java.lang.String cfName)
          Management method used by the EJBServiceImpl MBean.
 java.util.Set getJmsDestinationDependence(java.lang.String destName)
          Management method used by the EJBServiceImpl MBean.
 JmsManager getJmsManager()
          return the JmsManager object used internally by all the EJB Container classes.
 int getMessageDrivenNb()
           
 java.security.Guard getMethodGuard()
          Get the MethodGuard
 java.lang.String getName()
          Return the name of the container
 PrincipalFactory getPrincipalFactory()
          Get the PrincipalFactory
 java.security.Guard getRoleGuard()
          Get the RoleGuard
 int getStatefulSessionNb()
           
 int getStatelessSessionNb()
           
 long getSwapTime()
           
 javax.transaction.TransactionManager getTransactionManager()
          return the Transaction Manager used internally by all the EJB Container classes.
 java.lang.String[] listBeanNames()
          Return an array of bean names
 void registerBF(BeanFactory bf)
          register a BeanFactory
 void registerEJB(JEntitySwitch ejb)
          register an Entity that must be passivated
 void remove()
          Remove the JOnAS container.
 void setBeanEnvironment(javax.naming.Context ctx, BeanDesc dd)
          Set the bean environment args ctx Context for this bean args dd Bean Deployment Descriptor throws NamingException if could not rebind objects
 void setContainerNaming(org.enhydra.naming.ContainerNaming naming)
          set the ContainerNaming object Called by the EJB Server when starting the service.
 void setEjbDescriptor(DeploymentDesc ejbdesc)
          Set EjbDescriptor.
 void setJmsManager(JmsManager jms)
          set the JmsManager object Called by the EJB Server when starting ths service.
 void setMethodGuard(java.security.Guard methodGuard)
          Set a MethodGuard
 void setPrincipalFactory(PrincipalFactory pf)
          Set the PrincipalFactory
 void setRoleGuard(java.security.Guard roleGuard)
          Set the RoleGuard
 void setSwapTime(int t)
          Take into account the swapping time for the bean.
 void setThreadPoolSize(int sz)
          set the Thread pool size.
 void setTransactionManager(javax.transaction.TransactionManager tm)
          set the Transaction Manager.
 void syncAll(boolean passivate)
          Try to passivate all entity bean instances
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myname

public java.lang.String myname

fileName

public java.lang.String fileName

statefulSessionPool

public JStatefulPool statefulSessionPool
Constructor Detail

JContainer

public JContainer(java.lang.String name,
                  java.lang.String file,
                  java.lang.ClassLoader ld)
constructor
Method Detail

listBeanNames

public java.lang.String[] listBeanNames()
Return an array of bean names
Specified by:
listBeanNames in interface Container

getName

public java.lang.String getName()
Return the name of the container
Specified by:
getName in interface Container

getFileName

public java.lang.String getFileName()
Return the file name of the container (.xml or .jar)
Specified by:
getFileName in interface Container

setMethodGuard

public void setMethodGuard(java.security.Guard methodGuard)
Set a MethodGuard
Specified by:
setMethodGuard in interface Container

getMethodGuard

public java.security.Guard getMethodGuard()
Get the MethodGuard
Specified by:
getMethodGuard in interface Container

setRoleGuard

public void setRoleGuard(java.security.Guard roleGuard)
Set the RoleGuard
Specified by:
setRoleGuard in interface Container

getRoleGuard

public java.security.Guard getRoleGuard()
Get the RoleGuard
Specified by:
getRoleGuard in interface Container

getClassLoader

public java.lang.ClassLoader getClassLoader()
Returns the classloader used for this Container
Specified by:
getClassLoader in interface Container

setPrincipalFactory

public void setPrincipalFactory(PrincipalFactory pf)
Set the PrincipalFactory
Specified by:
setPrincipalFactory in interface Container

getPrincipalFactory

public PrincipalFactory getPrincipalFactory()
Get the PrincipalFactory
Specified by:
getPrincipalFactory in interface Container

setContainerNaming

public void setContainerNaming(org.enhydra.naming.ContainerNaming naming)
set the ContainerNaming object Called by the EJB Server when starting the service.
Specified by:
setContainerNaming in interface Container

getContainerNaming

public org.enhydra.naming.ContainerNaming getContainerNaming()
return the ContainerNaming object used internally by all the EJB Container classes.
Specified by:
getContainerNaming in interface Container

setThreadPoolSize

public void setThreadPoolSize(int sz)
set the Thread pool size.
Specified by:
setThreadPoolSize in interface Container
Following copied from interface: org.objectweb.jonas_ejb.container.Container
Parameters:
sz - number of threads in the pool.

syncAll

public void syncAll(boolean passivate)
Try to passivate all entity bean instances
Specified by:
syncAll in interface Container

setTransactionManager

public void setTransactionManager(javax.transaction.TransactionManager tm)
set the Transaction Manager. Called by the EJB Server when starting the service.
Specified by:
setTransactionManager in interface Container

getTransactionManager

public javax.transaction.TransactionManager getTransactionManager()
return the Transaction Manager used internally by all the EJB Container classes.
Specified by:
getTransactionManager in interface Container

setJmsManager

public void setJmsManager(JmsManager jms)
set the JmsManager object Called by the EJB Server when starting ths service.
Specified by:
setJmsManager in interface Container

getJmsManager

public JmsManager getJmsManager()
return the JmsManager object used internally by all the EJB Container classes.
Specified by:
getJmsManager in interface Container

remove

public void remove()
Remove the JOnAS container.
Specified by:
remove in interface Container

setEjbDescriptor

public void setEjbDescriptor(DeploymentDesc ejbdesc)
Set EjbDescriptor. Needed for ejb-link in ejb-ref and ejb-local-ref. LATER: May be better to replace addBean by this.

addBean

public BeanFactory addBean(BeanDesc dd)
Adds beans in container. This method is not part of JContainer interface, although it is used by EJBServer, because we don't want to get all BeanDesc classes (jonas_ejb.deployment.api)
Parameters:
desc - The Bean Deployment Descriptor

getBeanNb

public int getBeanNb()
Returns:
total Number of Beans

getEntityBMPNb

public int getEntityBMPNb()
Returns:
int Number of BMP type currently in this container

getEntityCMPNb

public int getEntityCMPNb()
Returns:
int Number of CMP type currently in this container

getStatefulSessionNb

public int getStatefulSessionNb()
Returns:
int Number of SBF type currently in this container

getStatelessSessionNb

public int getStatelessSessionNb()
Returns:
int Number of SBL type currently in this container

getMessageDrivenNb

public int getMessageDrivenNb()
Returns:
int Number of MDB type currently in this container

getSwapTime

public long getSwapTime()
Returns:
passivation time out for this container

getDataSourceDependence

public java.util.Set getDataSourceDependence(java.lang.String dsName)
Management method used by the EJBServiceImpl MBean. Determine which are the ejbs using a given data source.
Parameters:
dsName - JNDI name of the data source

getJmsDestinationDependence

public java.util.Set getJmsDestinationDependence(java.lang.String destName)
Management method used by the EJBServiceImpl MBean. Determine which are the beans using a JMS destination.
Parameters:
destName - JNDI name of a JMS destination

getJmsConnectionFactoryDependence

public java.util.Set getJmsConnectionFactoryDependence(java.lang.String cfName)
Management method used by the EJBServiceImpl MBean. Determine which are the ejbs using a JMS Connection Factory.
Parameters:
cfName - JNDI name of a JMS Connection Factory.

registerEJB

public void registerEJB(JEntitySwitch ejb)
register an Entity that must be passivated

registerBF

public void registerBF(BeanFactory bf)
register a BeanFactory

setSwapTime

public void setSwapTime(int t)
Take into account the swapping time for the bean.

setBeanEnvironment

public void setBeanEnvironment(javax.naming.Context ctx,
                               BeanDesc dd)
                        throws javax.naming.NamingException
Set the bean environment args ctx Context for this bean args dd Bean Deployment Descriptor throws NamingException if could not rebind objects

checkSecurity

protected void checkSecurity(java.lang.String methodSignature)
Check Security. No control for Message Driven Beans