User: patriot1burke Date: 01/09/03 18:52:06 Modified: src/main/org/jboss/metadata Tag: Branch_2_4 ConfigurationMetaData.java BeanMetaData.java Log: backmerge Revision Changes Path No revision No revision 1.14.2.1 +7 -1 jboss/src/main/org/jboss/metadata/ConfigurationMetaData.java Index: ConfigurationMetaData.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/metadata/ConfigurationMetaData.java,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -u -r1.14 -r1.14.2.1 --- ConfigurationMetaData.java 2001/06/13 04:52:33 1.14 +++ ConfigurationMetaData.java 2001/09/04 01:52:06 1.14.2.1 @@ -13,7 +13,7 @@ /** The configuration information for an EJB container. * @author <a href="mailto:[EMAIL PROTECTED]">Sebastien Alborini</a> * @author [EMAIL PROTECTED] - * @version $Revision: 1.14 $ + * @version $Revision: 1.14.2.1 $ */ public class ConfigurationMetaData extends MetaData { @@ -37,6 +37,7 @@ public static final String[] commitOptionStrings = { "A", "B", "C", "D"}; // Attributes ---------------------------------------------------- + private String lockClass = "org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock"; private String name; private String containerInvoker; private String instancePool; @@ -83,6 +84,8 @@ public String getTransactionManager() { return transactionManager; } + public String getLockClass() {return lockClass;} + public Element getContainerInvokerConf() { return containerInvokerConf; } public Element getContainerPoolConf() { return containerPoolConf; } public Element getContainerCacheConf() { return containerCacheConf; } @@ -121,6 +124,9 @@ // set the transaction manager transactionManager = getElementContent(getOptionalChild(element, "transaction-manager"), transactionManager); + + // set the lock class + lockClass = getElementContent(getOptionalChild(element, "locking-policy"), lockClass); // set the security domain securityDomain = getElementContent(getOptionalChild(element, "security-domain"), securityDomain); 1.23.2.1 +397 -370 jboss/src/main/org/jboss/metadata/BeanMetaData.java Index: BeanMetaData.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/metadata/BeanMetaData.java,v retrieving revision 1.23 retrieving revision 1.23.2.1 diff -u -r1.23 -r1.23.2.1 --- BeanMetaData.java 2001/06/15 14:19:06 1.23 +++ BeanMetaData.java 2001/09/04 01:52:06 1.23.2.1 @@ -1,5 +1,5 @@ /* - * JBoss, the OpenSource EJB server + * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. @@ -13,7 +13,6 @@ import java.util.Set; import java.util.Collection; - import org.w3c.dom.Element; import org.w3c.dom.NodeList; @@ -22,423 +21,451 @@ import org.jboss.security.NobodyPrincipal; import org.jboss.security.SimplePrincipal; -/** A common meta data class for the entity, message-driven and session beans. - * - * @author <a href="mailto:[EMAIL PROTECTED]">Sebastien Alborini</a> - * @author Peter Antman ([EMAIL PROTECTED]) - * @author Daniel OConnor ([EMAIL PROTECTED]) - * @author [EMAIL PROTECTED] - * @version $Revision: 1.23 $ +/** + * A common meta data class for the entity, message-driven and session beans. + * + * @author <a href="mailto:[EMAIL PROTECTED]">Sebastien Alborini</a> + * @author <a href="mailto:[EMAIL PROTECTED]">Peter Antman</a>. + * @author <a href="mailto:[EMAIL PROTECTED]">Daniel OConnor</a> + * @author <a href="mailto:[EMAIL PROTECTED]">Scott Stark</a>. + * @author <a href="mailto:[EMAIL PROTECTED]">Ole Husgaard</a> + * @version $Revision: 1.23.2.1 $ */ -public abstract class BeanMetaData extends MetaData { - // Constants ----------------------------------------------------- - public static final char SESSION_TYPE = 'S'; - public static final char ENTITY_TYPE = 'E'; - public static final char MDB_TYPE = 'M'; +public abstract class BeanMetaData + extends MetaData +{ + // Constants ----------------------------------------------------- + + public static final char SESSION_TYPE = 'S'; + public static final char ENTITY_TYPE = 'E'; + public static final char MDB_TYPE = 'M'; - // Attributes ---------------------------------------------------- - private ApplicationMetaData application; + // Attributes ---------------------------------------------------- + private ApplicationMetaData application; - // from ejb-jar.xml - /** The ejb-name element specifies an enterprise bean’s name. This name is - assigned by the ejb-jar file producer to name the enterprise bean in - the ejb-jar file’s deployment descriptor. The name must be unique - among the names of the enterprise beans in the same ejb-jar file. - */ - private String ejbName; - /** The home element contains the fully-qualified name of the enterprise - bean’s home interface. */ - private String homeClass; - /** The remote element contains the fully-qualified name of the enterprise - bean’s remote interface. */ - private String remoteClass; - /** The local-home element contains the fully-qualified name of the enterprise - bean’s local home interface. */ - private String localHomeClass; - /** The local element contains the fully-qualified name of the enterprise - bean’s local interface */ - private String localClass; - /** The ejb-class element contains the fully-qualified name of the enter-prise - bean’s class. */ - private String ejbClass; - /** The type of bean: ENTITY_TYPE, SESSION_TYPE, MDB_TYPE */ - protected char beanType; - - /** The The env-entry element(s) contains the declaration of an enterprise - bean’s environment entry */ - private ArrayList environmentEntries = new ArrayList(); - /** The The ejb-ref element(s) for the declaration of a reference to an - enterprise bean’s home */ - private HashMap ejbReferences = new HashMap(); - /** The ejb-local-ref element(s) info */ - private HashMap ejbLocalReferences = new HashMap(); - /** The security-role-ref element(s) info */ - private ArrayList securityRoleReferences = new ArrayList(); - /** The security-idemtity element info */ - private SecurityIdentityMetaData securityIdentity = null; - /** The resource-ref element(s) info */ - private HashMap resourceReferences = new HashMap(); - /** The resource-env-ref element(s) info */ - private HashMap resourceEnvReferences = new HashMap(); - /** The assembly-descriptor/method-permission element(s) info */ - private ArrayList permissionMethods = new ArrayList(); - /** The assembly-descriptor/container-transaction element(s) info */ - private ArrayList transactionMethods = new ArrayList(); - /** The assembly-descriptor/exclude-list method(s) */ - private ArrayList excludedMethods = new ArrayList(); - - // from jboss.xml - /** The JNDI name under with the home interface should be bound */ - private String jndiName; - protected String configurationName; - private ConfigurationMetaData configuration; - private String securityProxy; + // from ejb-jar.xml + /** The ejb-name element specifies an enterprise bean’s name. This name is + assigned by the ejb-jar file producer to name the enterprise bean in + the ejb-jar file’s deployment descriptor. The name must be unique + among the names of the enterprise beans in the same ejb-jar file. + */ + private String ejbName; + /** The home element contains the fully-qualified name of the enterprise + bean’s home interface. */ + private String homeClass; + /** The remote element contains the fully-qualified name of the enterprise + bean’s remote interface. */ + private String remoteClass; + /** The local-home element contains the fully-qualified name of the enterprise + bean’s local home interface. */ + private String localHomeClass; + /** The local element contains the fully-qualified name of the enterprise + bean’s local interface */ + private String localClass; + /** The ejb-class element contains the fully-qualified name of the enter-prise + bean’s class. */ + private String ejbClass; + /** The type of bean: ENTITY_TYPE, SESSION_TYPE, MDB_TYPE */ + protected char beanType; + /** Is this bean's transactions managed by the container? */ + protected boolean containerManagedTx = true; + + /** The The env-entry element(s) contains the declaration of an enterprise + bean’s environment entry */ + private ArrayList environmentEntries = new ArrayList(); + /** The The ejb-ref element(s) for the declaration of a reference to an + enterprise bean’s home */ + private HashMap ejbReferences = new HashMap(); + /** The ejb-local-ref element(s) info */ + private HashMap ejbLocalReferences = new HashMap(); + /** The security-role-ref element(s) info */ + private ArrayList securityRoleReferences = new ArrayList(); + /** The security-idemtity element info */ + private SecurityIdentityMetaData securityIdentity = null; + /** The resource-ref element(s) info */ + private HashMap resourceReferences = new HashMap(); + /** The resource-env-ref element(s) info */ + private HashMap resourceEnvReferences = new HashMap(); + /** The assembly-descriptor/method-permission element(s) info */ + private ArrayList permissionMethods = new ArrayList(); + /** The assembly-descriptor/container-transaction element(s) info */ + private ArrayList transactionMethods = new ArrayList(); + /** The assembly-descriptor/exclude-list method(s) */ + private ArrayList excludedMethods = new ArrayList(); + + // from jboss.xml + + /** The JNDI name under with the home interface should be bound */ + private String jndiName; + + /** The JNDI name under with the local home interface should be bound */ + private String localJndiName; + protected String configurationName; + private ConfigurationMetaData configuration; + private String securityProxy; - // Static -------------------------------------------------------- + // Static -------------------------------------------------------- - // Constructors -------------------------------------------------- - public BeanMetaData(ApplicationMetaData app, char beanType) - { - application = app; - this.beanType = beanType; - } + // Constructors -------------------------------------------------- + public BeanMetaData(ApplicationMetaData app, char beanType) + { + application = app; + this.beanType = beanType; + } - // Public -------------------------------------------------------- - public boolean isSession() { return beanType == SESSION_TYPE; } + // Public -------------------------------------------------------- + public boolean isSession() { return beanType == SESSION_TYPE; } - public boolean isMessageDriven() { return beanType == MDB_TYPE; } + public boolean isMessageDriven() { return beanType == MDB_TYPE; } - public boolean isEntity() { return beanType == ENTITY_TYPE; } + public boolean isEntity() { return beanType == ENTITY_TYPE; } - public String getHome() { return homeClass; } + public String getHome() { return homeClass; } - public String getRemote() { return remoteClass; } + public String getRemote() { return remoteClass; } - public String getLocalHome() { return localHomeClass; } + public String getLocalHome() { return localHomeClass; } - public String getLocal() { return localClass; } + public String getLocal() { return localClass; } - public String getEjbClass() { return ejbClass; } + public String getEjbClass() { return ejbClass; } - public String getEjbName() { return ejbName; } + public String getEjbName() { return ejbName; } + + public boolean isContainerManagedTx() { return containerManagedTx; } + + public boolean isBeanManagedTx() { return !containerManagedTx; } - public Iterator getEjbReferences() { return ejbReferences.values().iterator(); } + public Iterator getEjbReferences() { return ejbReferences.values().iterator(); } - public Iterator getEjbLocalReferences() { return ejbLocalReferences.values().iterator(); } + public Iterator getEjbLocalReferences() { return ejbLocalReferences.values().iterator(); } - public EjbRefMetaData getEjbRefByName(String name) { - return (EjbRefMetaData)ejbReferences.get(name); - } - - public EjbLocalRefMetaData getEjbLocalRefByName(String name) { - return (EjbLocalRefMetaData)ejbLocalReferences.get(name); - } + public EjbRefMetaData getEjbRefByName(String name) + { + return (EjbRefMetaData)ejbReferences.get(name); + } + + public EjbLocalRefMetaData getEjbLocalRefByName(String name) + { + return (EjbLocalRefMetaData)ejbLocalReferences.get(name); + } - public Iterator getEnvironmentEntries() { return environmentEntries.iterator(); } - - public Iterator getSecurityRoleReferences() { return securityRoleReferences.iterator(); } + public Iterator getEnvironmentEntries() { return environmentEntries.iterator(); } - public Iterator getResourceReferences() { return resourceReferences.values().iterator(); } - public Iterator getResourceEnvReferences() { return resourceEnvReferences.values().iterator(); } - - public String getJndiName() { - // jndiName may be set in jboss.xml - if (jndiName == null) { - jndiName = ejbName; - } - return jndiName; - } - - public String getConfigurationName() { - if (configurationName == null) { - configurationName = getDefaultConfigurationName(); - } - return configurationName; - } - + public Iterator getSecurityRoleReferences() { return securityRoleReferences.iterator(); } - public ConfigurationMetaData getContainerConfiguration() { - if (configuration == null) { - configuration = application.getConfigurationMetaDataByName(getConfigurationName()); - } - return configuration; - } - - public String getSecurityProxy() { return securityProxy; } - public SecurityIdentityMetaData getSecurityIdentityMetaData() - { - return securityIdentity; - } - - public ApplicationMetaData getApplicationMetaData() { return application; } - - public abstract String getDefaultConfigurationName(); - - public Iterator getTransactionMethods() { return transactionMethods.iterator(); } - - public Iterator getPermissionMethods() { return permissionMethods.iterator(); } - public Iterator getExcludedMethods() { return excludedMethods.iterator(); } - - - public void addTransactionMethod(MethodMetaData method) { - transactionMethods.add(method); - } - - public void addPermissionMethod(MethodMetaData method) - { - // Insert unchecked methods into the front of the list to speed up their validation - if( method.isUnchecked() ) - permissionMethods.add(0, method); - else - permissionMethods.add(method); - } - public void addExcludedMethod(MethodMetaData method) { - excludedMethods.add(method); - } + public Iterator getResourceReferences() { return resourceReferences.values().iterator(); } + public Iterator getResourceEnvReferences() { return resourceEnvReferences.values().iterator(); } - public byte getMethodTransactionType(String methodName, Class[] params, boolean remote) { - - // default value - byte result = TX_UNKNOWN; - - Iterator iterator = getTransactionMethods(); - while (iterator.hasNext()) { - MethodMetaData m = (MethodMetaData)iterator.next(); - if (m.patternMatches(methodName, params, remote)) { - result = m.getTransactionType(); + public String getJndiName() + { + // jndiName may be set in jboss.xml + if (jndiName == null) { + jndiName = ejbName; + } + return jndiName; + } + + /** + * Gets the JNDI name under with the local home interface should be bound. + * The default is local/<ejbName> + */ + public String getLocalJndiName() { + if (localJndiName == null) { + localJndiName = "local/" + ejbName; + } + return localJndiName; + } + + public String getConfigurationName() + { + if (configurationName == null) { + configurationName = getDefaultConfigurationName(); + } + return configurationName; + } + + public ConfigurationMetaData getContainerConfiguration() + { + if (configuration == null) { + configuration = application.getConfigurationMetaDataByName(getConfigurationName()); + } + return configuration; + } + + public String getSecurityProxy() { return securityProxy; } + public SecurityIdentityMetaData getSecurityIdentityMetaData() + { + return securityIdentity; + } + + public ApplicationMetaData getApplicationMetaData() { return application; } + + public abstract String getDefaultConfigurationName(); + + public Iterator getTransactionMethods() { return transactionMethods.iterator(); } + + public Iterator getPermissionMethods() { return permissionMethods.iterator(); } + public Iterator getExcludedMethods() { return excludedMethods.iterator(); } + + + public void addTransactionMethod(MethodMetaData method) + { + transactionMethods.add(method); + } + + public void addPermissionMethod(MethodMetaData method) + { + // Insert unchecked methods into the front of the list to speed up their validation + if( method.isUnchecked() ) + permissionMethods.add(0, method); + else + permissionMethods.add(method); + } + + public void addExcludedMethod(MethodMetaData method) + { + excludedMethods.add(method); + } + + public byte getMethodTransactionType(String methodName, Class[] params, + boolean remote) + { + // default value + byte result = TX_UNKNOWN; + + Iterator iterator = getTransactionMethods(); + while (iterator.hasNext()) { + MethodMetaData m = (MethodMetaData)iterator.next(); + if (m.patternMatches(methodName, params, remote)) { + result = m.getTransactionType(); - // if it is an exact match, break, if it is the wildcard continue to look for a finer match - if (!"*".equals(m.getMethodName())) break; - } - } - - return result; - } - - /** A somewhat tedious method that builds a Set<Principal> of the roles - that have been assigned permission to execute the indicated method. The - work performed is tedious because of the wildcard style of declaring - method permission allowed in the ejb-jar.xml descriptor. This method is - called by the Container.getMethodPermissions() when it fails to find the - prebuilt set of method roles in its cache. - @return The Set<Principal> for the application domain roles that - caller principal's are to be validated against. - @see org.jboss.ejb.Container#getMethodPermissions(Method, boolean) + // if it is an exact match, break, if it is the wildcard continue to look for a finer match + if (!"*".equals(m.getMethodName())) break; + } + } + + return result; + } + + /** + * A somewhat tedious method that builds a Set<Principal> of the roles + * that have been assigned permission to execute the indicated method. The + * work performed is tedious because of the wildcard style of declaring + * method permission allowed in the ejb-jar.xml descriptor. This method is + * called by the Container.getMethodPermissions() when it fails to find the + * prebuilt set of method roles in its cache. + * + * @return The Set<Principal> for the application domain roles that + * caller principal's are to be validated against. + * @see org.jboss.ejb.Container#getMethodPermissions(Method, boolean) */ - public Set getMethodPermissions(String methodName, Class[] params, boolean remote) - { - Set result = new HashSet(); - // First check the excluded method list as this takes priority over all other assignments - Iterator iterator = getExcludedMethods(); - while( iterator.hasNext() ) - { - MethodMetaData m = (MethodMetaData) iterator.next(); - if( m.patternMatches(methodName, params, remote) ) - { - /* No one is allowed to execute this method so add a role that - fails to equate to any Principal or Principal name and return. - We don't return null to differentiate between an explicit - assignment of no access and no assignment information. - */ - result.add(NobodyPrincipal.NOBODY_PRINCIPAL); - return result; + public Set getMethodPermissions(String methodName, Class[] params, + boolean remote) + { + Set result = new HashSet(); + // First check the excluded method list as this takes priority over all other assignments + Iterator iterator = getExcludedMethods(); + while (iterator.hasNext()) { + MethodMetaData m = (MethodMetaData) iterator.next(); + if (m.patternMatches(methodName, params, remote)) { + /* No one is allowed to execute this method so add a role that + fails to equate to any Principal or Principal name and return. + We don't return null to differentiate between an explicit + assignment of no access and no assignment information. + */ + result.add(NobodyPrincipal.NOBODY_PRINCIPAL); + return result; + } + } + + // Check the permissioned methods list + iterator = getPermissionMethods(); + while (iterator.hasNext()) { + MethodMetaData m = (MethodMetaData) iterator.next(); + if (m.patternMatches(methodName, params, remote)) { + /* If this is an unchecked method anyone can access it so + set the result set to a role that equates to any Principal or + Principal name and return. + */ + if (m.isUnchecked()) { + result.clear(); + result.add(AnybodyPrincipal.ANYBODY_PRINCIPAL); + break; } - } - - // Check the permissioned methods list - iterator = getPermissionMethods(); - while( iterator.hasNext() ) - { - MethodMetaData m = (MethodMetaData) iterator.next(); - if( m.patternMatches(methodName, params, remote) ) + // Else, add all roles + else { - /* If this is an unchecked method anyone can access it so - set the result set to a role that equates to any Principal or - Principal name and return. - */ - if( m.isUnchecked() ) - { - result.clear(); - result.add(AnybodyPrincipal.ANYBODY_PRINCIPAL); - break; - } - // Else, add all roles - else - { - Iterator rolesIterator = m.getRoles().iterator(); - while( rolesIterator.hasNext() ) - { - String roleName = (String) rolesIterator.next(); - result.add(new SimplePrincipal(roleName)); - } - } + Iterator rolesIterator = m.getRoles().iterator(); + while (rolesIterator.hasNext()) { + String roleName = (String) rolesIterator.next(); + result.add(new SimplePrincipal(roleName)); + } } - } - - // If no permissions were assigned to the method return null to indicate no access - if( result.isEmpty() ) - result = null; - return result; - } + } + } - public void importEjbJarXml(Element element) throws DeploymentException { - - // set the ejb-name - ejbName = getElementContent(getUniqueChild(element, "ejb-name")); - - // set the classes - // Not for MessageDriven - if( isMessageDriven() == false ) - { - homeClass = getElementContent(getOptionalChild(element, "home")); - remoteClass = getElementContent(getOptionalChild(element, "remote")); - localHomeClass = getElementContent(getOptionalChild(element, "local-home")); - localClass = getElementContent(getOptionalChild(element, "local")); - } - ejbClass = getElementContent(getUniqueChild(element, "ejb-class")); + // If no permissions were assigned to the method return null to indicate no access + if (result.isEmpty()) + result = null; + return result; + } + + public void importEjbJarXml(Element element) throws DeploymentException + { + // set the ejb-name + ejbName = getElementContent(getUniqueChild(element, "ejb-name")); + + // set the classes + // Not for MessageDriven + if (isMessageDriven() == false) { + homeClass = getElementContent(getOptionalChild(element, "home")); + remoteClass = getElementContent(getOptionalChild(element, "remote")); + localHomeClass = getElementContent(getOptionalChild(element, "local-home")); + localClass = getElementContent(getOptionalChild(element, "local")); + } + ejbClass = getElementContent(getUniqueChild(element, "ejb-class")); - // set the environment entries - Iterator iterator = getChildrenByTagName(element, "env-entry"); + // set the environment entries + Iterator iterator = getChildrenByTagName(element, "env-entry"); - while (iterator.hasNext()) { - Element envEntry = (Element)iterator.next(); + while (iterator.hasNext()) { + Element envEntry = (Element)iterator.next(); - EnvEntryMetaData envEntryMetaData = new EnvEntryMetaData(); - envEntryMetaData.importEjbJarXml(envEntry); + EnvEntryMetaData envEntryMetaData = new EnvEntryMetaData(); + envEntryMetaData.importEjbJarXml(envEntry); - environmentEntries.add(envEntryMetaData); - } + environmentEntries.add(envEntryMetaData); + } - // set the ejb references - iterator = getChildrenByTagName(element, "ejb-ref"); + // set the ejb references + iterator = getChildrenByTagName(element, "ejb-ref"); - while (iterator.hasNext()) { - Element ejbRef = (Element) iterator.next(); + while (iterator.hasNext()) { + Element ejbRef = (Element) iterator.next(); - EjbRefMetaData ejbRefMetaData = new EjbRefMetaData(); - ejbRefMetaData.importEjbJarXml(ejbRef); + EjbRefMetaData ejbRefMetaData = new EjbRefMetaData(); + ejbRefMetaData.importEjbJarXml(ejbRef); - ejbReferences.put(ejbRefMetaData.getName(), ejbRefMetaData); - } + ejbReferences.put(ejbRefMetaData.getName(), ejbRefMetaData); + } - // set the ejb local references - iterator = getChildrenByTagName(element, "ejb-local-ref"); + // set the ejb local references + iterator = getChildrenByTagName(element, "ejb-local-ref"); - while (iterator.hasNext()) { - Element ejbLocalRef = (Element) iterator.next(); + while (iterator.hasNext()) { + Element ejbLocalRef = (Element) iterator.next(); - EjbLocalRefMetaData ejbLocalRefMetaData = new EjbLocalRefMetaData(); - ejbLocalRefMetaData.importEjbJarXml(ejbLocalRef); + EjbLocalRefMetaData ejbLocalRefMetaData = new EjbLocalRefMetaData(); + ejbLocalRefMetaData.importEjbJarXml(ejbLocalRef); - ejbLocalReferences.put(ejbLocalRefMetaData.getName(), - ejbLocalRefMetaData); - } + ejbLocalReferences.put(ejbLocalRefMetaData.getName(), + ejbLocalRefMetaData); + } - // set the security roles references - iterator = getChildrenByTagName(element, "security-role-ref"); + // set the security roles references + iterator = getChildrenByTagName(element, "security-role-ref"); - while (iterator.hasNext()) { - Element secRoleRef = (Element) iterator.next(); + while (iterator.hasNext()) { + Element secRoleRef = (Element) iterator.next(); - SecurityRoleRefMetaData securityRoleRefMetaData = new SecurityRoleRefMetaData(); - securityRoleRefMetaData.importEjbJarXml(secRoleRef); + SecurityRoleRefMetaData securityRoleRefMetaData = new SecurityRoleRefMetaData(); + securityRoleRefMetaData.importEjbJarXml(secRoleRef); - securityRoleReferences.add(securityRoleRefMetaData); - } + securityRoleReferences.add(securityRoleRefMetaData); + } - // The security-identity element - Element securityIdentityElement = getOptionalChild(element, "security-identity"); - if( securityIdentityElement != null ) - { - securityIdentity = new SecurityIdentityMetaData(); - securityIdentity.importEjbJarXml(securityIdentityElement); - } + // The security-identity element + Element securityIdentityElement = getOptionalChild(element, "security-identity"); + if (securityIdentityElement != null) { + securityIdentity = new SecurityIdentityMetaData(); + securityIdentity.importEjbJarXml(securityIdentityElement); + } - // set the resource references - iterator = getChildrenByTagName(element, "resource-ref"); + // set the resource references + iterator = getChildrenByTagName(element, "resource-ref"); - while (iterator.hasNext()) { - Element resourceRef = (Element) iterator.next(); + while (iterator.hasNext()) { + Element resourceRef = (Element) iterator.next(); - ResourceRefMetaData resourceRefMetaData = new ResourceRefMetaData(); - resourceRefMetaData.importEjbJarXml(resourceRef); + ResourceRefMetaData resourceRefMetaData = new ResourceRefMetaData(); + resourceRefMetaData.importEjbJarXml(resourceRef); - resourceReferences.put(resourceRefMetaData.getRefName(), resourceRefMetaData); - } - - // Parse the resource-env-ref elements - iterator = getChildrenByTagName(element, "resource-env-ref"); - while( iterator.hasNext() ) - { - Element resourceRef = (Element) iterator.next(); - ResourceEnvRefMetaData refMetaData = new ResourceEnvRefMetaData(); - refMetaData.importEjbJarXml(resourceRef); - resourceEnvReferences.put(refMetaData.getRefName(), refMetaData); - } - } + resourceReferences.put(resourceRefMetaData.getRefName(), resourceRefMetaData); + } - public void importJbossXml(Element element) throws DeploymentException { - // we must not set defaults here, this might never be called - - // set the jndi name, (optional) - jndiName = getElementContent(getOptionalChild(element, "jndi-name")); - - // set the configuration (optional) - configurationName = getElementContent(getOptionalChild(element, "configuration-name")); - if (configurationName != null && getApplicationMetaData().getConfigurationMetaDataByName(configurationName) == null) { - throw new DeploymentException("configuration '" + configurationName + "' not found in standardjboss.xml or jboss.xml"); - } - - // Get the security proxy - securityProxy = getElementContent(getOptionalChild(element, "security-proxy"), securityProxy); - - // update the resource references (optional) - Iterator iterator = getChildrenByTagName(element, "resource-ref"); - while (iterator.hasNext()) { - Element resourceRef = (Element)iterator.next(); - String resRefName = getElementContent(getUniqueChild(resourceRef, "res-ref-name")); - ResourceRefMetaData resourceRefMetaData = (ResourceRefMetaData)resourceReferences.get(resRefName); + // Parse the resource-env-ref elements + iterator = getChildrenByTagName(element, "resource-env-ref"); + while (iterator.hasNext()) { + Element resourceRef = (Element) iterator.next(); + ResourceEnvRefMetaData refMetaData = new ResourceEnvRefMetaData(); + refMetaData.importEjbJarXml(resourceRef); + resourceEnvReferences.put(refMetaData.getRefName(), refMetaData); + } + } + + public void importJbossXml(Element element) throws DeploymentException + { + // we must not set defaults here, this might never be called + + // set the jndi name, (optional) + jndiName = getElementContent(getOptionalChild(element, "jndi-name")); + + // set the JNDI name under with the local home interface should be bound (optional) + localJndiName = getElementContent(getOptionalChild(element, "local-jndi-name")); + + // set the configuration (optional) + configurationName = getElementContent(getOptionalChild(element, "configuration-name")); + if (configurationName != null && getApplicationMetaData().getConfigurationMetaDataByName(configurationName) == null) { + throw new DeploymentException("configuration '" + configurationName + "' not found in standardjboss.xml or jboss.xml"); + } + + // Get the security proxy + securityProxy = getElementContent(getOptionalChild(element, "security-proxy"), securityProxy); + + // update the resource references (optional) + Iterator iterator = getChildrenByTagName(element, "resource-ref"); + while (iterator.hasNext()) { + Element resourceRef = (Element)iterator.next(); + String resRefName = getElementContent(getUniqueChild(resourceRef, "res-ref-name")); + ResourceRefMetaData resourceRefMetaData = (ResourceRefMetaData)resourceReferences.get(resRefName); - if (resourceRefMetaData == null) { - throw new DeploymentException("resource-ref " + resRefName + " found in jboss.xml but not in ejb-jar.xml"); - } - resourceRefMetaData.importJbossXml(resourceRef); - } - - // Set the resource-env-ref deployed jndi names - iterator = getChildrenByTagName(element, "resource-env-ref"); - while( iterator.hasNext() ) - { - Element resourceRef = (Element) iterator.next(); - String resRefName = getElementContent(getUniqueChild(resourceRef, "resource-env-ref-name")); - ResourceEnvRefMetaData refMetaData = (ResourceEnvRefMetaData) resourceEnvReferences.get(resRefName); - if( refMetaData == null) - { - throw new DeploymentException("resource-env-ref " + resRefName + " found in jboss.xml but not in ejb-jar.xml"); - } - refMetaData.importJbossXml(resourceRef); - } - - // set the external ejb-references (optional) - iterator = getChildrenByTagName(element, "ejb-ref"); - while (iterator.hasNext()) { - Element ejbRef = (Element)iterator.next(); - String ejbRefName = getElementContent(getUniqueChild(ejbRef, "ejb-ref-name")); - EjbRefMetaData ejbRefMetaData = getEjbRefByName(ejbRefName); - if (ejbRefMetaData == null) { - throw new DeploymentException("ejb-ref " + ejbRefName + " found in jboss.xml but not in ejb-jar.xml"); - } - ejbRefMetaData.importJbossXml(ejbRef); - } - } - - - - // Package protected --------------------------------------------- - - // Protected ----------------------------------------------------- - - // Private ------------------------------------------------------- + if (resourceRefMetaData == null) { + throw new DeploymentException("resource-ref " + resRefName + " found in jboss.xml but not in ejb-jar.xml"); + } + resourceRefMetaData.importJbossXml(resourceRef); + } + + // Set the resource-env-ref deployed jndi names + iterator = getChildrenByTagName(element, "resource-env-ref"); + while (iterator.hasNext()) { + Element resourceRef = (Element) iterator.next(); + String resRefName = getElementContent(getUniqueChild(resourceRef, "resource-env-ref-name")); + ResourceEnvRefMetaData refMetaData = (ResourceEnvRefMetaData) resourceEnvReferences.get(resRefName); + if (refMetaData == null) { + throw new DeploymentException("resource-env-ref " + resRefName + " found in jboss.xml but not in ejb-jar.xml"); + } + refMetaData.importJbossXml(resourceRef); + } + + // set the external ejb-references (optional) + iterator = getChildrenByTagName(element, "ejb-ref"); + while (iterator.hasNext()) { + Element ejbRef = (Element)iterator.next(); + String ejbRefName = getElementContent(getUniqueChild(ejbRef, "ejb-ref-name")); + EjbRefMetaData ejbRefMetaData = getEjbRefByName(ejbRefName); + if (ejbRefMetaData == null) { + throw new DeploymentException("ejb-ref " + ejbRefName + " found in jboss.xml but not in ejb-jar.xml"); + } + ejbRefMetaData.importJbossXml(ejbRef); + } + } + + // Package protected --------------------------------------------- + + // Protected ----------------------------------------------------- + + // Private ------------------------------------------------------- - // Inner classes ------------------------------------------------- + // Inner classes ------------------------------------------------- } _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development