org.ow2.jonas.deployment.ejb
Class DeploymentDesc

java.lang.Object
  extended by org.ow2.jonas.deployment.common.DescriptionGroupDesc
      extended by org.ow2.jonas.deployment.ejb.DeploymentDesc
All Implemented Interfaces:
IDescriptionGroupDesc
Direct Known Subclasses:
DeploymentDescEjb1_1, DeploymentDescEjb2

public abstract class DeploymentDesc
extends DescriptionGroupDesc

Class to hold meta-information related to the deployment of an ejb-jar

Author:
Christophe Ney [cney@batisseurs.com] : Initial developer, Helene Joanin, Philippe Durieux, Markus Karg (Novell port), Philippe Coq

Field Summary
protected  AssemblyDescriptor asd
          Assembly descriptor
protected  HashMap beanDesc
          Set of enterprise beans deployment descriptors
protected  String ejbClientJar
          Deployment desc's file name (jar or directory)
protected  String fileName
          Deployment desc's file name (jar or directory)
protected  JLinkedList jonasMDList
          List of JonasMessageDestinations
protected  org.objectweb.util.monolog.api.Logger logger
          Logger
protected  String specVersion
          Ejb spec version
 
Fields inherited from class org.ow2.jonas.deployment.common.DescriptionGroupDesc
description, displayName, largeIcon, smallIcon
 
Constructor Summary
DeploymentDesc(ClassLoader classLoader, EjbJar ejbJar, JonasEjbJar jonasEjbJar, org.objectweb.util.monolog.api.Logger l, String fileName)
          Build the Meta-Information from the XML data binding trees containing the EJB and JOnAS deployment descriptors.
 
Method Summary
 EntityCmp2Desc asn2BeanDesc(String asn)
          Get bean descriptor given its abstract schema name
 BeanDesc[] getBeanDesc()
          Get descriptors for all beans contained in jar file
 BeanDesc getBeanDesc(String ejbName)
          Get bean descriptor given its name
 Iterator getBeanDescIterator()
          Get an Iterator on the Bean Desc list
 BeanDesc getBeanDescWithLocalInterface(String itfLocalName)
          Get bean descriptor given its interface local name
 String getDisplayName()
          Get the display name
 String getEjbClientJar()
          Get the ejb-client-jar name
 ExcludeListDesc getExcludeListDesc()
          Get the exclude list of the assembly descriptor
 JonasMessageDestination getJonasMessageDestination(String mdLink)
          Get the JOnAS message destination for the given name
 String getJOnASXmlContent()
          Return the content of the jonas-web.xml file
 org.objectweb.util.monolog.api.Logger getLogger()
          get the current logger
 boolean getMessageDestination(String mdLink)
          Find the JOnAS message destination for the given name
 List getMethodPermissionsDescList()
          Get the list of the methodPermissionDesc objects which represent method-permission elements in assembly-descriptor
 Boolean getMonitoringEnabled()
           
 String[] getRolesForRunAsPrincipal(String principalName)
          Gets the Mapping for run-as principal
 Integer getWarningThreshold()
           
 String getXmlContent()
          Return the content of the web.xml file
protected abstract  BeanDesc newEntityBeanDesc(ClassLoader cl, Entity ent, AssemblyDescriptor asd, JonasEntity j, JLinkedList jMDRList)
          In case of beans with old CMP1 persistance, we need to instanciate the old class, as if we were in an old Deployment Descriptor.
 void setJOnASXmlContent(String jonasXmlContent)
           
 void setLogger(org.objectweb.util.monolog.api.Logger logger)
          set the current logger
 void setXmlContent(String xmlContent)
           
 String toString()
          String representation of the object for test purpose
 
Methods inherited from class org.ow2.jonas.deployment.common.DescriptionGroupDesc
getDescription, getLargeIcon, getSAXMsg, getSmallIcon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

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


specVersion

protected String specVersion
Ejb spec version


beanDesc

protected HashMap beanDesc
Set of enterprise beans deployment descriptors


asd

protected AssemblyDescriptor asd
Assembly descriptor


fileName

protected String fileName
Deployment desc's file name (jar or directory)


ejbClientJar

protected String ejbClientJar
Deployment desc's file name (jar or directory)


jonasMDList

protected JLinkedList jonasMDList
List of JonasMessageDestinations

Constructor Detail

DeploymentDesc

public DeploymentDesc(ClassLoader classLoader,
                      EjbJar ejbJar,
                      JonasEjbJar jonasEjbJar,
                      org.objectweb.util.monolog.api.Logger l,
                      String fileName)
               throws DeploymentDescException
Build the Meta-Information from the XML data binding trees containing the EJB and JOnAS deployment descriptors.

Parameters:
classLoader - The Class Loader to be used
ejbJar - The EjbJar information, from standard deployment descriptor.
jonasEjbJar - The JonasEjbJar information, from JOnAS specific deployment descriptor.
l - The logger to be used for tracing
fileName - deployment desc's jar or directory name
Throws:
DeploymentDescException - Cannot deploy bean
Method Detail

getBeanDescIterator

public Iterator getBeanDescIterator()
Get an Iterator on the Bean Desc list

Returns:
Iterator on BeanDesc

getBeanDesc

public BeanDesc[] getBeanDesc()
Get descriptors for all beans contained in jar file

Returns:
Array of bean's descriptors

getRolesForRunAsPrincipal

public String[] getRolesForRunAsPrincipal(String principalName)
Gets the Mapping for run-as principal

Parameters:
principalName - name of the run-as principal
Returns:
array of roles

getBeanDesc

public BeanDesc getBeanDesc(String ejbName)
Get bean descriptor given its name

Parameters:
ejbName - the name of the bean in the Deployment Descriptor
Returns:
bean descriptor given its name

asn2BeanDesc

public EntityCmp2Desc asn2BeanDesc(String asn)
Get bean descriptor given its abstract schema name

Parameters:
asn - Abstract Schema Name
Returns:
null if it doesn't exist.

getMethodPermissionsDescList

public List getMethodPermissionsDescList()
Get the list of the methodPermissionDesc objects which represent method-permission elements in assembly-descriptor

Returns:
the list of methodPermissionDesc objects

getExcludeListDesc

public ExcludeListDesc getExcludeListDesc()
Get the exclude list of the assembly descriptor

Returns:
the exclude list of the assembly descriptor

getBeanDescWithLocalInterface

public BeanDesc getBeanDescWithLocalInterface(String itfLocalName)
Get bean descriptor given its interface local name

Parameters:
itfLocalName - local interface name
Returns:
null if it doesn't exist.

getMessageDestination

public boolean getMessageDestination(String mdLink)
Find the JOnAS message destination for the given name

Parameters:
mdLink - the name of the message destination link in the Deployment Descriptor
Returns:
boolean if link was found

getJonasMessageDestination

public JonasMessageDestination getJonasMessageDestination(String mdLink)
Get the JOnAS message destination for the given name

Parameters:
mdLink - the name of the message destination link in the Deployment Descriptor
Returns:
the jonas message destination given the name

newEntityBeanDesc

protected abstract BeanDesc newEntityBeanDesc(ClassLoader cl,
                                              Entity ent,
                                              AssemblyDescriptor asd,
                                              JonasEntity j,
                                              JLinkedList jMDRList)
                                       throws DeploymentDescException
In case of beans with old CMP1 persistance, we need to instanciate the old class, as if we were in an old Deployment Descriptor. Default is CMP2.x for entity beans with a EJB2.0 DD.

Parameters:
cl - The ClassLoader to be used
ent - Entity MetaInformation from XML files
asd - AssemblyDescriptor MetaInformation from XML files
j - JonasEntity MetaInformation from XML files
jMDRList - MessageDrivenRef list
Returns:
The Entity Bean Descriptor, for the good CMP version.
Throws:
DeploymentDescException - Cannot build Entity Descriptor

getDisplayName

public String getDisplayName()
Get the display name

Specified by:
getDisplayName in interface IDescriptionGroupDesc
Overrides:
getDisplayName in class DescriptionGroupDesc
Returns:
the Display name string, from the deployment descriptor.

getEjbClientJar

public String getEjbClientJar()
Get the ejb-client-jar name

Returns:
the ejb-client-jar string, from the deployment descriptor (may be null).

getLogger

public org.objectweb.util.monolog.api.Logger getLogger()
get the current logger

Returns:
the Logger

setLogger

public void setLogger(org.objectweb.util.monolog.api.Logger logger)
set the current logger

Parameters:
logger - the Logger

getXmlContent

public String getXmlContent()
Return the content of the web.xml file

Returns:
the content of the web.xml file

getJOnASXmlContent

public String getJOnASXmlContent()
Return the content of the jonas-web.xml file

Returns:
the content of the jonas-web.xml file

toString

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

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

setXmlContent

public void setXmlContent(String xmlContent)
Parameters:
xmlContent - XML Content

setJOnASXmlContent

public void setJOnASXmlContent(String jonasXmlContent)
Parameters:
jonasXmlContent - XML Content

getMonitoringEnabled

public Boolean getMonitoringEnabled()
Returns:
true if EJB monitoring is active for this EJB-JAR, null if nothing set.

getWarningThreshold

public Integer getWarningThreshold()
Returns:
Number of milliseconds after which methods will start warning for this EJB-JAR, null if nothing set.


Copyright © 2010 OW2 Consortium. All Rights Reserved.