org.openejb.assembler
Class CoreDeploymentInfo

java.lang.Object
  extended byorg.openejb.assembler.CoreDeploymentInfo
All Implemented Interfaces:
DeploymentInfo

public class CoreDeploymentInfo
extends Object
implements 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.

Version:
$Revision: 444692 $ $Date: 2004-04-16 04:34:09 +0200 (Fri, 16 Apr 2004) $

Field Summary
 
Fields inherited from interface org.openejb.assembler.DeploymentInfo
AC_CREATE_EJBHOME, TX_MANDITORY, TX_NEVER, TX_NOT_SUPPORTED, TX_REQUIRED, TX_REQUIRES_NEW, TX_SUPPORTS
 
Constructor Summary
CoreDeploymentInfo()
           
CoreDeploymentInfo(String did, Class homeClass, Class remoteClass, Class beanClass, Class pkClass, byte componentType)
           
 
Method Summary
 void addSecurityRoleReference(String securityRoleReference, String[] physicalRoles)
           
 void appendMethodPermissions(Method m, String[] roleNames)
           
 Class getBeanClass()
          Gets the bean's class definition.
 int getComponentType()
          Gets the type of this bean component.
 Container getContainer()
          Gets the id of the container this deployed bean is in.
 String getDeploymentID()
          Gets the id of this bean deployment.
 javax.ejb.EJBHome getEJBHome()
           
 Class getHomeInterface()
          Gets the home interface for the bean deployment.
 Context getJndiEnc()
           
 Class getPrimaryKeyClass()
          Gets the Class type of the primary key for this bean deployment.
 Class getRemoteInterface()
          Gets the remote interface for the bean deployment.
 byte getTransactionAttribute(Method method)
          Gets the transaction attribute that must be applied to this method when executing.
 boolean isBeanManagedTransaction()
          Returns true if this bean deployment has chosen bean-managed transaction demarcation.
 boolean isReentrant()
          Useful for Container-Managed Persistence (CMP) Entity beans.
 void setBeanManagedTransaction(boolean value)
           
 void setContainer(Container cont)
           
 void setIsReentrant(boolean reentrant)
           
 void setJndiEnc(Context cntx)
           
 void setMethodTransactionAttribute(Method method, String transAttribute)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoreDeploymentInfo

public CoreDeploymentInfo()

CoreDeploymentInfo

public CoreDeploymentInfo(String did,
                          Class homeClass,
                          Class remoteClass,
                          Class beanClass,
                          Class pkClass,
                          byte componentType)
Method Detail

setContainer

public void setContainer(Container cont)

getComponentType

public int getComponentType()
Description copied from interface: DeploymentInfo
Gets the type of this bean component. Will return a STATEFUL, STATELESS, BMP_ENTITY or CMP_ENTITY.

Specified by:
getComponentType in interface DeploymentInfo
Returns:
Returns STATEFUL, STATELESS, BMP_ENTITY or CMP_ENTITY.

getTransactionAttribute

public byte getTransactionAttribute(Method method)
Description copied from interface: DeploymentInfo
Gets the transaction attribute that must be applied to this method when executing. The type can be anyone of TX_NEVER, TX_NOT_SUPPORTED, TX_SUPPORTS, TX_MANDITORY, TX_REQUIRED, TX_REQUIRES_NEW,

Specified by:
getTransactionAttribute in interface DeploymentInfo
Parameters:
method - the bean's method for which transaction attribute information is needed
Returns:
the transaction constant that states the method's transaction attribute
See Also:
DeploymentInfo.TX_NEVER, DeploymentInfo.TX_NOT_SUPPORTED, DeploymentInfo.TX_SUPPORTS, DeploymentInfo.TX_MANDITORY, DeploymentInfo.TX_REQUIRED, DeploymentInfo.TX_REQUIRES_NEW

getContainer

public Container getContainer()
Description copied from interface: DeploymentInfo
Gets the id of the container this deployed bean is in.

Specified by:
getContainer in interface DeploymentInfo
Returns:
the id of the deployment's container.
See Also:
Container.getContainerID()

getDeploymentID

public String getDeploymentID()
Description copied from interface: DeploymentInfo
Gets the id of this bean deployment.

Specified by:
getDeploymentID in interface DeploymentInfo
Returns:
the id of of this bean deployment

isBeanManagedTransaction

public boolean isBeanManagedTransaction()
Description copied from interface: DeploymentInfo
Returns true if this bean deployment has chosen bean-managed transaction demarcation. Returns false if the continer will be managing the bean's transactions.

Specified by:
isBeanManagedTransaction in interface DeploymentInfo
Returns:
Returns true if this bean deployment is managing its own transactions.

getHomeInterface

public Class getHomeInterface()
Description copied from interface: DeploymentInfo
Gets the home interface for the bean deployment. Used primarily by Servers integrating OpenEJB into their platform. Aids in implementing the bean's home interface.

Specified by:
getHomeInterface in interface DeploymentInfo
Returns:
a Class object of the bean's home interface
See Also:
EJBHome

getRemoteInterface

public Class getRemoteInterface()
Description copied from interface: DeploymentInfo
Gets the remote interface for the bean deployment. Used primarily by Servers integrating OpenEJB into their platform. Aids in implementing the bean's remote interface.

Specified by:
getRemoteInterface in interface DeploymentInfo
Returns:
a Class object of the bean's remote interface
See Also:
EJBObject

getBeanClass

public Class getBeanClass()
Description copied from interface: DeploymentInfo
Gets the bean's class definition. Used primarily by containers to instantiate new instances of a bean.

Specified by:
getBeanClass in interface DeploymentInfo
Returns:
a Class object of the bean's class definition
See Also:
EnterpriseBean

getPrimaryKeyClass

public Class getPrimaryKeyClass()
Description copied from interface: DeploymentInfo
Gets the Class type of the primary key for this bean deployment. Returns null if the bean is a type that does not need a primary key.

Specified by:
getPrimaryKeyClass in interface DeploymentInfo
Returns:
the Class type of the bean's primary key or null if the bean doesn't need a primary key

getEJBHome

public javax.ejb.EJBHome getEJBHome()

setBeanManagedTransaction

public void setBeanManagedTransaction(boolean value)

setJndiEnc

public void setJndiEnc(Context cntx)

getJndiEnc

public Context getJndiEnc()

isReentrant

public boolean isReentrant()
Description copied from interface: DeploymentInfo
Useful for Container-Managed Persistence (CMP) Entity beans. Returns true if entity allows reentrant. Session bean types will always return false;

Specified by:
isReentrant in interface DeploymentInfo
Returns:
true if entity bean allows reentrant access

setIsReentrant

public void setIsReentrant(boolean reentrant)

appendMethodPermissions

public void appendMethodPermissions(Method m,
                                    String[] roleNames)

addSecurityRoleReference

public void addSecurityRoleReference(String securityRoleReference,
                                     String[] physicalRoles)

setMethodTransactionAttribute

public void setMethodTransactionAttribute(Method method,
                                          String transAttribute)


Copyright © 1999-2006 OpenEJB. All Rights Reserved.