org.ow2.jonas.lib.ejb21
Interface Container

All Known Implementing Classes:
JContainer

public interface Container

A Container is what a JOnAS Server can see of a JOnAS EJB Container. It holds all beans coming from the same ejbjar file. There is no possibility to add or remove dynamically beans in a Container since it is build with all its beans. JMX can use this interface, but no specific JMX classes should be inside the Container. Its management is done outside jonas_ejb.

Author:
Philippe Coq, Jeff Mesnil (security), Christophe Ney (PrincipalFactory), Philippe Durieux (add missing methods), Benjamin Bonnet (max size for thread pool), Florent Benoit : JACC

Method Summary
 BeanFactory getBeanFactory(String beanName)
          Get the bean factory for the given bean.
 ClassLoader getClassLoader()
           
 JComponentContextFactory getComponentContextFactory()
           
 JNamingManager getContainerNaming()
           
 String getContextId()
          Gets the context ID of this container (for jacc).
 String getEarFileName()
          get the name of the ear application containing this container.
 String getExternalFileName()
           
 String getFileName()
           
 String getJavaEEApplicationName()
          Gets the Java EE Application Name of this container.
 JmsManager getJmsManager()
           
 String getName()
           
 PermissionManager getPermissionManager()
          Gets the permission manager.
 PrincipalFactory getPrincipalFactory()
           
 TransactionManager getTransactionManager()
           
 String[] listBeanNames()
           
 void remove()
          Remove the JOnAS container and unregister all beans.
 void setComponentContextFactory(JComponentContextFactory factory)
          Set the JComponentContextFactory instance.
 void setContainerNaming(JNamingManager naming)
          Set the JNamingManager object.
 void setEarFileName(String fileName)
          set the name of the ear application containing this container.
 void setJavaEEApplicationName(String javaEEApplicationName)
          Sets the Java EE Application Name of this container.
 void setJmsManager(JmsManager jms)
          set the JmsManager object.
 void setPermissionManager(PermissionManager permissionManager)
          Set the permission manager object.
 void setPrincipalFactory(PrincipalFactory pf)
          Set the PrincipalFactory.
 void setSecurity(boolean b)
          Set the security flag to enable or disable security.
 void setTransactionManager(TransactionManager tm)
          set the Transaction Manager.
 void syncAll(boolean alwaysStore, boolean passivate)
          Synchronize all entity beans.
 

Method Detail

listBeanNames

String[] listBeanNames()
Returns:
List of beans hosted in this Container

getName

String getName()
Returns:
name of this Container

getFileName

String getFileName()
Returns:
the file name of the container (.xml or .jar)

getExternalFileName

String getExternalFileName()
Returns:
the external(user) file name of the container

getClassLoader

ClassLoader getClassLoader()
Returns:
the classloader used for this Container

setPrincipalFactory

void setPrincipalFactory(PrincipalFactory pf)
Set the PrincipalFactory. This factory can be JOnAS Server dependant. The Container makes no assumption on how to get the Principal.

Parameters:
pf - the PrincipalFactory

getPrincipalFactory

PrincipalFactory getPrincipalFactory()
Returns:
the PrincipalFactory of the Container

setContainerNaming

void setContainerNaming(JNamingManager naming)
Set the JNamingManager object.

Parameters:
naming - the JNamingManager object

getContainerNaming

JNamingManager getContainerNaming()
Returns:
the JNamingManager object.

setComponentContextFactory

void setComponentContextFactory(JComponentContextFactory factory)
Set the JComponentContextFactory instance.

Parameters:
factory - the JComponentContextFactory instance

getComponentContextFactory

JComponentContextFactory getComponentContextFactory()
Returns:
the JComponentContextFactory object.

syncAll

void syncAll(boolean alwaysStore,
             boolean passivate)
Synchronize all entity beans.

Parameters:
alwaysStore - if true store even if passivationTimeout not reached
passivate - true if bean instances will be released after having been written on storage.

setTransactionManager

void setTransactionManager(TransactionManager tm)
set the Transaction Manager.

Parameters:
tm - the Transaction Manager.

getTransactionManager

TransactionManager getTransactionManager()
Returns:
the Transaction Manager

setJmsManager

void setJmsManager(JmsManager jms)
set the JmsManager object.

Parameters:
jms - the JmsManager

getJmsManager

JmsManager getJmsManager()
Returns:
the JmsManager object

setEarFileName

void setEarFileName(String fileName)
set the name of the ear application containing this container.

Parameters:
fileName - the name of the ear application containing this container.

getEarFileName

String getEarFileName()
get the name of the ear application containing this container.

Returns:
the name of the ear application containing this container.

remove

void remove()
Remove the JOnAS container and unregister all beans.


setSecurity

void setSecurity(boolean b)
Set the security flag to enable or disable security.

Parameters:
b - true or false to enable/disable security

setPermissionManager

void setPermissionManager(PermissionManager permissionManager)
Set the permission manager object.

Parameters:
permissionManager - permission manager object

getPermissionManager

PermissionManager getPermissionManager()
Gets the permission manager.

Returns:
the permission manager

getContextId

String getContextId()
Gets the context ID of this container (for jacc).

Returns:
contextID used for JACC

getBeanFactory

BeanFactory getBeanFactory(String beanName)
Get the bean factory for the given bean.

Parameters:
beanName - the name of the bean
Returns:
the bean factory for this bean

getJavaEEApplicationName

String getJavaEEApplicationName()
Gets the Java EE Application Name of this container.

Returns:
the Java EE Application name if there is one

setJavaEEApplicationName

void setJavaEEApplicationName(String javaEEApplicationName)
Sets the Java EE Application Name of this container.

Parameters:
javaEEApplicationName - the Java EE Application name


Copyright © 2010 OW2 Consortium. All Rights Reserved.