|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openejb.core.DeploymentInfo
public class DeploymentInfo
Contains all the information needed by the container for a particular deployment. Some of this information is generic, but this class is largely becoming a dumping ground for information specific to individual containers. This class should be abstracted and subclassed in the individual container packages. The container should be required to provide its own DeploymentInfo implementation, possibly returning it to the assembler and OpenEJB in general via a new accessor method.
Field Summary |
---|
Fields inherited from interface org.openejb.DeploymentInfo |
---|
AC_CREATE_EJBHOME, BMP_ENTITY, CMP_ENTITY, MESSAGE_DRIVEN, STATEFUL, STATELESS, TX_MANDITORY, TX_NEVER, TX_NOT_SUPPORTED, TX_REQUIRED, TX_REQUIRES_NEW, TX_SUPPORTS |
Constructor Summary | |
---|---|
DeploymentInfo(DeploymentContext context,
java.lang.Class homeClass,
java.lang.Class remoteClass,
java.lang.Class localHomeClass,
java.lang.Class localClass,
java.lang.Class beanClass,
java.lang.Class pkClass,
byte componentType)
Constructs a DeploymentInfo object to represent the specified bean's deployment information. |
Method Summary | |
---|---|
void |
addQuery(java.lang.reflect.Method queryMethod,
java.lang.String queryString)
This method maps a query method (ejbFind) to a query string. |
void |
addSecurityRoleReference(java.lang.String securityRoleReference,
java.lang.String[] physicalRoles)
Adds a security-role-ref to physical role mapping. |
void |
appendMethodPermissions(java.lang.reflect.Method m,
java.lang.String[] roleNames)
Appends a Method and a list of authorized roles to the internal list of mehtod permissions. |
java.lang.Object |
convertIfLocalReference(java.lang.reflect.Method businessMethod,
java.lang.Object returnValue)
Business methods that return EJBHome or EJBObject references to local beans (beans in the same container system) must have the return value converted to a ProxyInfo object, so that the server can provide the client with a proper remote reference. |
protected java.lang.String |
extractHomeBeanMethodName(java.lang.String methodName)
|
java.lang.String[] |
getAuthorizedRoles(java.lang.reflect.Method method)
Gets the roles that are authorised to execute this method. |
java.lang.String[] |
getAuthorizedRoles(java.lang.String action)
|
java.lang.Class |
getBeanClass()
Gets the bean's class definition. |
java.lang.String[] |
getCmrFields()
Returns the names of the bean's container-managed fields. |
byte |
getComponentType()
Gets the type of this bean component. |
Container |
getContainer()
Gets the the container that this deployed bean is in. |
java.lang.reflect.Method |
getCreateMethod()
Used for stateless session beans only |
java.lang.Object |
getDeploymentID()
Gets the id of this bean deployment. |
javax.ejb.EJBContext |
getEJBContext()
Gets the EJBContext this container manager will expose to the
Container s it manages. |
javax.ejb.EJBHome |
getEJBHome()
Gets the EJBHome object of this bean deployment. |
javax.ejb.EJBLocalHome |
getEJBLocalHome()
|
java.lang.Class |
getHomeInterface()
Gets the home interface for the bean deployment. |
javax.naming.Context |
getJndiEnc()
Gets the JNDI namespace for the bean's environment. |
KeyGenerator |
getKeyGenerator()
|
java.lang.Class |
getLocalHomeInterface()
|
java.lang.Class |
getLocalInterface()
|
java.lang.reflect.Method |
getMatchingBeanMethod(java.lang.reflect.Method interfaceMethod)
Returns a method in the bean class that matches the method passed in. |
java.lang.reflect.Method |
getMatchingPostCreateMethod(java.lang.reflect.Method createMethod)
Used for entity beans only. |
java.lang.String[] |
getPhysicalRole(java.lang.String securityRoleReference)
Beans can test to see if the current principal is a member of a specified role using the method EJBContext.isPrincipalInRole(String roleName). |
java.lang.Class |
getPrimaryKeyClass()
Gets the Class type of the primary key for this bean deployment. |
java.lang.reflect.Field |
getPrimaryKeyField()
Gets the Field of the CMP entity bean class which corresponds to the simple primary key. |
java.lang.String |
getQuery(java.lang.reflect.Method queryMethod)
This method retrieves the query string associated with the query method. |
java.lang.Class |
getRemoteInterface()
Gets the remote interface for the bean deployment. |
byte |
getTransactionAttribute(java.lang.reflect.Method method)
Gets the transaction attribute that must be applied to this method when executing. |
TransactionPolicy |
getTransactionPolicy(java.lang.reflect.Method method)
|
boolean |
isBeanManagedTransaction()
Returns true if this bean deployment has chosen bean-managed transaction demarcation. |
boolean |
isReentrant()
Returns true if the bean deployment allows reenterace. |
void |
setBeanManagedTransaction(boolean value)
Sets this bean deployment to container-managed or bean-managed transaction demarcation. |
void |
setCmrFields(java.lang.String[] cmrFields)
|
void |
setContainer(Container cont)
Container must have its Container set explicitly by the Assembler to avoid a chicken and egg problem: Which is created first the container or the DeploymentInfo This assembler will invoke this method when needed. |
void |
setIsReentrant(boolean reentrant)
|
void |
setKeyGenerator(KeyGenerator keyGenerator)
|
void |
setMethodTransactionAttribute(java.lang.reflect.Method method,
java.lang.String transAttribute)
Sets the transaction attribute of the method in the bean's class. |
void |
setPrimKeyField(java.lang.String fieldName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DeploymentInfo(DeploymentContext context, java.lang.Class homeClass, java.lang.Class remoteClass, java.lang.Class localHomeClass, java.lang.Class localClass, java.lang.Class beanClass, java.lang.Class pkClass, byte componentType) throws SystemException
did
- the id of this bean deploymenthomeClass
- the bean's home interface definitionremoteClass
- the bean's remote interface definitionbeanClass
- the bean's class definitionpkClass
- the bean's primary key classcomponentType
- one of the component type constants defined in org.openejb.DeploymentInfo
SystemException
Container.getContainerID()
,
DeploymentInfo.STATEFUL
,
DeploymentInfo.STATELESS
,
DeploymentInfo.BMP_ENTITY
,
DeploymentInfo.CMP_ENTITY
Method Detail |
---|
public void setContainer(Container cont)
cont
- public byte getComponentType()
STATEFUL
,
STATELESS
,
BMP_ENTITY
or
CMP_ENTITY
.
getComponentType
in interface DeploymentInfo
STATEFUL
, STATELESS
, BMP_ENTITY
or CMP_ENTITY
.DeploymentInfo.STATEFUL
,
DeploymentInfo.STATELESS
,
DeploymentInfo.BMP_ENTITY
,
DeploymentInfo.CMP_ENTITY
,
DeploymentInfo.MESSAGE_DRIVEN
public byte getTransactionAttribute(java.lang.reflect.Method method)
TX_NEVER
,
TX_NOT_SUPPORTED
,
TX_SUPPORTS
,
TX_MANDITORY
,
TX_REQUIRED
,
TX_REQUIRES_NEW
,
getTransactionAttribute
in interface DeploymentInfo
method
- the bean's method for which transaction attribute information is needed
DeploymentInfo.TX_NEVER
,
DeploymentInfo.TX_NOT_SUPPORTED
,
DeploymentInfo.TX_SUPPORTS
,
DeploymentInfo.TX_MANDITORY
,
DeploymentInfo.TX_REQUIRED
,
DeploymentInfo.TX_REQUIRES_NEW
public TransactionPolicy getTransactionPolicy(java.lang.reflect.Method method)
public java.lang.String[] getAuthorizedRoles(java.lang.reflect.Method method)
getAuthorizedRoles
in interface DeploymentInfo
method
- the bean's method for which security information is needed
SecurityService.isCallerAuthorized(java.lang.Object, java.lang.String[])
public java.lang.String[] getAuthorizedRoles(java.lang.String action)
getAuthorizedRoles
in interface DeploymentInfo
public Container getContainer()
getContainer
in interface DeploymentInfo
Container.getContainerID()
public java.lang.Object getDeploymentID()
getDeploymentID
in interface DeploymentInfo
public boolean isBeanManagedTransaction()
isBeanManagedTransaction
in interface DeploymentInfo
public java.lang.Class getHomeInterface()
getHomeInterface
in interface DeploymentInfo
EJBHome
public java.lang.Class getRemoteInterface()
getRemoteInterface
in interface DeploymentInfo
EJBObject
public java.lang.Class getLocalHomeInterface()
getLocalHomeInterface
in interface DeploymentInfo
public java.lang.Class getLocalInterface()
getLocalInterface
in interface DeploymentInfo
public java.lang.Class getBeanClass()
getBeanClass
in interface DeploymentInfo
EnterpriseBean
public java.lang.Class getPrimaryKeyClass()
getPrimaryKeyClass
in interface DeploymentInfo
public javax.ejb.EJBHome getEJBHome()
EJBHome
object of this bean deployment.
EJBHome
public javax.ejb.EJBLocalHome getEJBLocalHome()
public void setBeanManagedTransaction(boolean value)
value
- true if this bean is managing transaction, false if the container should manage thempublic javax.naming.Context getJndiEnc()
Context
public boolean isReentrant()
isReentrant
in interface DeploymentInfo
public void setIsReentrant(boolean reentrant)
public java.lang.Object convertIfLocalReference(java.lang.reflect.Method businessMethod, java.lang.Object returnValue)
businessMethod
- returnValue
-
public java.lang.reflect.Method getMatchingBeanMethod(java.lang.reflect.Method interfaceMethod)
interfaceMethod
- the Method of the home or remote interface
public void appendMethodPermissions(java.lang.reflect.Method m, java.lang.String[] roleNames)
m
- the Method the roles map toroleNames
- the roles that are authorized to execute the specified methodMethod
public java.lang.String[] getPhysicalRole(java.lang.String securityRoleReference)
The org.openejb.core.CoreContext uses this method to obtain the physical role mapped to the logical role used by the bean.
securityRoleReference
- the role used by the bean code; the security-role-ref
addSecurityRoleReference(java.lang.String, java.lang.String[])
public void addSecurityRoleReference(java.lang.String securityRoleReference, java.lang.String[] physicalRoles)
securityRoleReference
- the role used by the bean code; the security-role-refphysicalRoles
- getPhysicalRole(String)
public javax.ejb.EJBContext getEJBContext()
EJBContext
this container manager will expose to the
Container
s it manages.
public void setMethodTransactionAttribute(java.lang.reflect.Method method, java.lang.String transAttribute)
method
- the Method the specified transaction attribute applies to.transAttribute
- one of "Supports", "RequiresNew", "Manditory", "NotSupported", "Required", or "Never".Method
protected java.lang.String extractHomeBeanMethodName(java.lang.String methodName)
public java.lang.reflect.Method getCreateMethod()
public java.lang.reflect.Method getMatchingPostCreateMethod(java.lang.reflect.Method createMethod)
createMethod
-
public java.lang.reflect.Field getPrimaryKeyField()
Useful for Container-Managed Persistence (CMP) Entity beans with Simple Primary Keys.
getPrimaryKeyField
in interface DeploymentInfo
public void setPrimKeyField(java.lang.String fieldName) throws java.lang.NoSuchFieldException
java.lang.NoSuchFieldException
public java.lang.String[] getCmrFields()
public void setCmrFields(java.lang.String[] cmrFields)
public KeyGenerator getKeyGenerator()
public void setKeyGenerator(KeyGenerator keyGenerator)
public void addQuery(java.lang.reflect.Method queryMethod, java.lang.String queryString)
Each query method, ejbFind or ejbSelect(EJB 2.0), can be mapped to query string which describes the behavior of the method. For example, with the Castor JDO CMP container for EJB 1.1, every ejbFind method for each Deployment maps to a specific OQL statement which Castor JDO uses to access the object cache.
queryMethod
- queryString
- public java.lang.String getQuery(java.lang.reflect.Method queryMethod)
Each query method, ejbFind or ejbSelect(EJB 2.0), can be mapped to query string which describes the behavior of the method. For example, with the Castor JDO CMP container for EJB 1.1, every ejbFind method for each Deployment maps to a specific OQL statement which Castor JDO uses to access the object cache.
queryMethod
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |