org.objectweb.jonas_ejb.deployment.api
Class BeanDesc

java.lang.Object
  extended byorg.objectweb.jonas_lib.deployment.api.DescriptionGroupDesc
      extended byorg.objectweb.jonas_lib.deployment.api.JndiEnvRefsGroupDesc
          extended byorg.objectweb.jonas_ejb.deployment.api.BeanDesc
All Implemented Interfaces:
DescriptionGroup, JndiEnvRefsGroup
Direct Known Subclasses:
EntityDesc, MessageDrivenDesc, SessionDesc

public abstract class BeanDesc
extends JndiEnvRefsGroupDesc

Class to hold meta-information related to any enterprise-beans

Author:
Christophe Ney [cney@batisseurs.com], Helene Joanin, Philippe Coq Contributor(s): Florent Benoit & Ludovic Bert : ejb_link Jeff Mesnil

Field Summary
protected static int BEAN_TRANSACTION_TYPE
           
protected  int cacheMax
           
protected static int CONTAINER_TRANSACTION_TYPE
           
protected  DeploymentDesc deploymentDesc
           
protected  java.lang.String derivedBeanName
           
protected  java.util.Properties ejb10EnvProps
           
protected  java.lang.Class ejbClass
           
protected  java.lang.String ejbName
           
protected  java.lang.String fullDerivedBeanName
           
protected  java.lang.Class home
           
protected  java.lang.String jndiLocalName
           
protected  java.lang.String jndiName
           
protected  java.lang.Class local
           
protected  java.lang.Class localhome
           
protected  org.objectweb.util.monolog.api.Logger logger
           
protected  int poolMin
           
protected  java.lang.Class remote
           
protected  java.util.List securityRoleRefDescList
          List of SecurityRoleRefDesc for JACC
protected static java.lang.String[] TRANS
           
 
Fields inherited from class org.objectweb.jonas_lib.deployment.api.DescriptionGroupDesc
description, displayName, largeIcon, smallIcon
 
Constructor Summary
BeanDesc(java.lang.ClassLoader classLoader, CommonEjb ejb, JonasCommonEjb jonasEjb, AssemblyDescriptor asd, java.lang.String fileName)
          constructor to be used by parent node
 
Method Summary
protected  MethodDesc addMethodDesc(java.lang.reflect.Method meth)
          add a new method descriptor to the bean
 void check()
          Check that the bean descriptor is valid
 void checkRemoteException(java.lang.reflect.Method m, boolean shouldThrow)
          Check if method throws RemoteException
protected abstract  void checkTxAttribute(MethodDesc md)
          check that trans-attribute is valid for bean
 void checkValidTypesForRmi(java.lang.reflect.Method m)
          Check if argument and return types are valid types for RMI-IIOP.
 int getCacheMax()
           
 DeploymentDesc getDeploymentDesc()
          get the parent deployment descriptor
 java.lang.String getDerivedBeanName()
          returns the name of the derived class of the bean
 java.util.Properties getEjb10Environment()
          Get bean's EJB 1.0 environment properties
 java.lang.Class getEjbClass()
          Get bean's class.
 java.lang.String getEjbName()
          Get the enterprise bean's name.
 java.lang.String getFullDerivedBeanName()
          returns the full name of the derived class of the bean
 java.lang.String getFullWrpHandleName()
          returns the full name of the Handle class for the bean
 java.lang.String getFullWrpHomeName()
          returns the full name of the wrapper home class for the bean
 java.lang.String getFullWrpLocalHomeName()
          returns the full name of the wrapper local home class for the bean
 java.lang.String getFullWrpLocalName()
          returns the full name of the wrapper class for the bean
 java.lang.String getFullWrpRemoteName()
          returns the full name of the wrapper class for the bean
 java.lang.Class getHomeClass()
          Get bean's home interface.
protected  java.lang.String getIdentifierFromEjbName(java.lang.String ejbName)
          Build a valid java identifier from the ejb name
 java.lang.String getJndiLocalName()
          Get the name to associate with the enterprise Bean in the JNDI name space for local access (inside the same JOnAS Server)
 java.lang.String getJndiName()
          Get the name to associate with the enterprise Bean in the JNDI name space.
 java.lang.Class getLocalClass()
          Get bean's local interface.
 java.lang.Class getLocalHomeClass()
          Get bean's local home interface.
 MethodDesc getMethodDesc(int index)
          get a MethodDesc from its index
 MethodDesc getMethodDesc(java.lang.reflect.Method method)
          Deprecated. use getMethodDescIterator or getMethodDesc(int index) instead
 java.util.Iterator getMethodDescIterator()
          get an iterator for all MethodDesc of the bean
 int getPoolMin()
           
 java.lang.Class getRemoteClass()
          Get bean's remote interface.
 java.lang.String getRunAsRole()
           
 java.util.List getSecurityRoleRefDescList()
          Gets the security-role-ref of the beans can access to the EJBRoleRefPermission and role-link
 java.lang.String getWrpHandleName()
          returns the name of the Handle class for the bean
 java.lang.String getWrpHomeName()
          returns the name of the wrapper home class for the bean
 java.lang.String getWrpLocalHomeName()
          returns the name of the wrapper local home class for the bean
 java.lang.String getWrpLocalName()
          returns the name of the wrapper class for the bean
 java.lang.String getWrpRemoteName()
          returns the name of the wrapper class for the bean
protected  MethodDesc newMethodDescInstance(java.lang.reflect.Method meth, int index)
          MethodDesc constructor factory method to ovewrite
 void setDeploymentDesc(DeploymentDesc deploymentDesc)
          set the parent deployment descriptor
 java.lang.String toString()
          String representation of the object for test purpose
protected  void verifyRoleName(AssemblyDescriptor asd)
          check that there are always corresponding role-name element in security-role and method-permission elements
 
Methods inherited from class org.objectweb.jonas_lib.deployment.api.JndiEnvRefsGroupDesc
getEjbLocalRefDesc, getEjbRefDesc, getEnvEntryDesc, getResourceEnvRefDesc, getResourceRefDesc, getServiceRefDesc
 
Methods inherited from class org.objectweb.jonas_lib.deployment.api.DescriptionGroupDesc
getDescription, getDisplayName, getLargeIcon, getSAXMsg, getSmallIcon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BEAN_TRANSACTION_TYPE

protected static final int BEAN_TRANSACTION_TYPE
See Also:
Constant Field Values

CONTAINER_TRANSACTION_TYPE

protected static final int CONTAINER_TRANSACTION_TYPE
See Also:
Constant Field Values

TRANS

protected static final java.lang.String[] TRANS

ejbName

protected java.lang.String ejbName

jndiName

protected java.lang.String jndiName

jndiLocalName

protected java.lang.String jndiLocalName

home

protected java.lang.Class home

remote

protected java.lang.Class remote

localhome

protected java.lang.Class localhome

local

protected java.lang.Class local

ejbClass

protected java.lang.Class ejbClass

ejb10EnvProps

protected java.util.Properties ejb10EnvProps

logger

protected org.objectweb.util.monolog.api.Logger logger

securityRoleRefDescList

protected java.util.List securityRoleRefDescList
List of SecurityRoleRefDesc for JACC


deploymentDesc

protected DeploymentDesc deploymentDesc

fullDerivedBeanName

protected java.lang.String fullDerivedBeanName

derivedBeanName

protected java.lang.String derivedBeanName

poolMin

protected int poolMin

cacheMax

protected int cacheMax
Constructor Detail

BeanDesc

public BeanDesc(java.lang.ClassLoader classLoader,
                CommonEjb ejb,
                JonasCommonEjb jonasEjb,
                AssemblyDescriptor asd,
                java.lang.String fileName)
         throws DeploymentDescException
constructor to be used by parent node

Method Detail

getIdentifierFromEjbName

protected java.lang.String getIdentifierFromEjbName(java.lang.String ejbName)
Build a valid java identifier from the ejb name


checkRemoteException

public void checkRemoteException(java.lang.reflect.Method m,
                                 boolean shouldThrow)
                          throws DeploymentDescException
Check if method throws RemoteException

Throws:
DeploymentDescException - thrown for non-valid method

checkValidTypesForRmi

public void checkValidTypesForRmi(java.lang.reflect.Method m)
Check if argument and return types are valid types for RMI-IIOP. (Primitive types, remote objects, or non-remote objects that implement the java.io.Serializable interface) Only a warning is logging if it's not the case.


check

public void check()
           throws DeploymentDescException
Check that the bean descriptor is valid

Throws:
DeploymentDescException - thrown for non-valid bean

checkTxAttribute

protected abstract void checkTxAttribute(MethodDesc md)
                                  throws DeploymentDescException
check that trans-attribute is valid for bean

Throws:
DeploymentDescException

verifyRoleName

protected void verifyRoleName(AssemblyDescriptor asd)
                       throws DeploymentDescException
check that there are always corresponding role-name element in security-role and method-permission elements

Throws:
DeploymentDescException

getEjbName

public java.lang.String getEjbName()
Get the enterprise bean's name.

Returns:
Name of the bean

getJndiName

public java.lang.String getJndiName()
Get the name to associate with the enterprise Bean in the JNDI name space. Invoking this method is disallowed for message driven bean. (This information is JOnAS specific). Used by Server

Returns:
Jndi name of the bean

getJndiLocalName

public java.lang.String getJndiLocalName()
Get the name to associate with the enterprise Bean in the JNDI name space for local access (inside the same JOnAS Server)

Returns:
Jndi local name of the bean

getHomeClass

public java.lang.Class getHomeClass()
Get bean's home interface. Invoking this method is disallowed for message driven bean. Used by GenIC and Server

Returns:
Class for the home interface or null

getRemoteClass

public java.lang.Class getRemoteClass()
Get bean's remote interface. Invoking this method is disallowed for message driven bean. Used by GenIC and Server

Returns:
Class for the remote interface or null

getLocalHomeClass

public java.lang.Class getLocalHomeClass()
Get bean's local home interface. Invoking this method is disallowed for message driven bean. Used by GenIC and Server

Returns:
Class for the home interface or null

getLocalClass

public java.lang.Class getLocalClass()
Get bean's local interface. Invoking this method is disallowed for message driven bean. Used by GenIC and Server

Returns:
Class for the Local interface or null

getEjbClass

public java.lang.Class getEjbClass()
Get bean's class. Used by GenIC and Server

Returns:
Class for the bean

getEjb10Environment

public java.util.Properties getEjb10Environment()
Get bean's EJB 1.0 environment properties


getMethodDesc

public MethodDesc getMethodDesc(java.lang.reflect.Method method)
Deprecated. use getMethodDescIterator or getMethodDesc(int index) instead

Get descriptor attached to a given method. Used by GenIC

Parameters:
method - Method from the Home/Remote/MessageListener interface
Returns:
The method descriptor (never returns null)

getMethodDescIterator

public java.util.Iterator getMethodDescIterator()
get an iterator for all MethodDesc of the bean


getMethodDesc

public MethodDesc getMethodDesc(int index)
get a MethodDesc from its index


getSecurityRoleRefDescList

public java.util.List getSecurityRoleRefDescList()
Gets the security-role-ref of the beans can access to the EJBRoleRefPermission and role-link

Returns:
the security-role-ref of the beans

getPoolMin

public int getPoolMin()
Returns:
min size of the pool

getCacheMax

public int getCacheMax()
Returns:
max size of the cache

getRunAsRole

public java.lang.String getRunAsRole()
Returns:
the run-as role name

toString

public java.lang.String toString()
String representation of the object for test purpose

Specified by:
toString in interface DescriptionGroup
Specified by:
toString in class DescriptionGroupDesc
Returns:
String representation of this object

newMethodDescInstance

protected MethodDesc newMethodDescInstance(java.lang.reflect.Method meth,
                                           int index)
MethodDesc constructor factory method to ovewrite


addMethodDesc

protected MethodDesc addMethodDesc(java.lang.reflect.Method meth)
add a new method descriptor to the bean


getFullWrpRemoteName

public java.lang.String getFullWrpRemoteName()
returns the full name of the wrapper class for the bean


getFullWrpLocalName

public java.lang.String getFullWrpLocalName()
returns the full name of the wrapper class for the bean


getWrpRemoteName

public java.lang.String getWrpRemoteName()
returns the name of the wrapper class for the bean


getWrpLocalName

public java.lang.String getWrpLocalName()
returns the name of the wrapper class for the bean


getFullWrpHandleName

public java.lang.String getFullWrpHandleName()
returns the full name of the Handle class for the bean


getWrpHandleName

public java.lang.String getWrpHandleName()
returns the name of the Handle class for the bean


getFullWrpHomeName

public java.lang.String getFullWrpHomeName()
returns the full name of the wrapper home class for the bean


getFullWrpLocalHomeName

public java.lang.String getFullWrpLocalHomeName()
returns the full name of the wrapper local home class for the bean


getWrpHomeName

public java.lang.String getWrpHomeName()
returns the name of the wrapper home class for the bean


getWrpLocalHomeName

public java.lang.String getWrpLocalHomeName()
returns the name of the wrapper local home class for the bean


getFullDerivedBeanName

public java.lang.String getFullDerivedBeanName()
returns the full name of the derived class of the bean


getDerivedBeanName

public java.lang.String getDerivedBeanName()
returns the name of the derived class of the bean


getDeploymentDesc

public DeploymentDesc getDeploymentDesc()
get the parent deployment descriptor


setDeploymentDesc

public void setDeploymentDesc(DeploymentDesc deploymentDesc)
set the parent deployment descriptor