User: starksm 
  Date: 01/06/10 00:46:17

  Modified:    src/main/org/jboss/metadata ApplicationMetaData.java
                        BeanMetaData.java EntityMetaData.java
                        MessageDrivenMetaData.java MethodMetaData.java
                        ResourceRefMetaData.java
                        SecurityRoleRefMetaData.java SessionMetaData.java
  Added:       src/main/org/jboss/metadata ResourceEnvRefMetaData.java
                        SecurityIdentityMetaData.java
  Log:
  Add missing meta data types for new EJB2.0 elements
  Update existing meta data types for changes in EJB2.0
  
  Revision  Changes    Path
  1.16      +63 -11    jboss/src/main/org/jboss/metadata/ApplicationMetaData.java
  
  Index: ApplicationMetaData.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/metadata/ApplicationMetaData.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ApplicationMetaData.java  2001/04/17 19:52:21     1.15
  +++ ApplicationMetaData.java  2001/06/10 07:46:16     1.16
  @@ -28,7 +28,7 @@
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Sebastien Alborini</a>
    *   @author Peter Antman ([EMAIL PROTECTED])
    *   @author [EMAIL PROTECTED]
  - *   @version $Revision: 1.15 $
  + *   @version $Revision: 1.16 $
    */
   public class ApplicationMetaData extends MetaData {
       // Constants -----------------------------------------------------
  @@ -42,6 +42,7 @@
       private HashMap resources = new HashMap();
       private HashMap plugins = new HashMap();
       private String securityDomain;
  +    private boolean enforceEjbRestrictions;
       
       // Static --------------------------------------------------------
       
  @@ -98,6 +99,10 @@
       {
           return securityDomain;
       }
  +    public boolean getEnforceEjbRestrictions()
  +    {
  +        return enforceEjbRestrictions;
  +    }
   
       public void importEjbJarXml (Element element) throws DeploymentException {
          
  @@ -146,7 +151,8 @@
          // read the assembly descriptor (optional)
          Element assemblyDescriptor = getOptionalChild(element, 
"assembly-descriptor");
          
  -       if (assemblyDescriptor != null) {
  +       if (assemblyDescriptor != null)
  +       {
            
            // set the security roles (optional)
            iterator = getChildrenByTagName(assemblyDescriptor, "security-role");
  @@ -165,14 +171,25 @@
            try {
             while (iterator.hasNext()) {
                 Element methodPermission = (Element)iterator.next();
  -          
  -              // find the list of roles
  -              Set roles = new HashSet();
  -              Iterator rolesIterator = getChildrenByTagName(methodPermission, 
"role-name");
  -              while (rolesIterator.hasNext()) {
  -                 roles.add(getElementContent((Element)rolesIterator.next()));
  +              // Look for the unchecked element
  +              Element unchecked = getOptionalChild(methodPermission, "unchecked");
  +              boolean isUnchecked = false;
  +              Set roles = null;
  +              if( unchecked != null )
  +                  isUnchecked = true;
  +              else
  +              {
  +                  // Get the role-name elements
  +                  roles = new HashSet();
  +                  Iterator rolesIterator = getChildrenByTagName(methodPermission, 
"role-name");
  +                  while (rolesIterator.hasNext())
  +                  {
  +                     roles.add(getElementContent((Element)rolesIterator.next()));
  +                  }
  +                  if( roles.size() == 0 )
  +                      throw new DeploymentException("An unchecked element or one or 
more role-name elements must be specified in method-permission");
                 }
  -          
  +
                 // find the methods
                 Iterator methods = getChildrenByTagName(methodPermission, "method");
                 while (methods.hasNext()) {
  @@ -180,7 +197,10 @@
                    // load the method
                    MethodMetaData method = new MethodMetaData();
                    method.importEjbJarXml((Element)methods.next());
  -                       method.setRoles(roles);
  +                 if( isUnchecked )
  +                     method.setUnchecked();
  +                 else
  +                    method.setRoles(roles);
                    
                    // give the method to the right bean
                    BeanMetaData bean = getBeanByEjbName(method.getEjbName());
  @@ -240,15 +260,47 @@
            } catch (DeploymentException e) {
             throw new DeploymentException("Error in ejb-jar.xml, in 
container-transaction: " + e.getMessage());
            }
  +
  +            // Get the exclude-list methods
  +            Element excludeList = getOptionalChild(assemblyDescriptor, 
"exclude-list");
  +            if( excludeList != null )
  +            {
  +                iterator = getChildrenByTagName(excludeList, "method");
  +                while (iterator.hasNext())
  +                {
  +                    Element methodInf = (Element) iterator.next();
  +                    // load the method
  +                    MethodMetaData method = new MethodMetaData();
  +                    method.importEjbJarXml(methodInf);
  +                    method.setExcluded();
  +
  +                    // give the method to the right bean
  +                    BeanMetaData bean = getBeanByEjbName(method.getEjbName());
  +                    if (bean == null)
  +                    {
  +                        throw new DeploymentException("bean " + method.getEjbName() 
+ " doesn't exist");
  +                    }
  +                    bean.addExcludedMethod(method);
  +                }
  +            }
          }
       }
   
       
       
  -    public void importJbossXml(Element element) throws DeploymentException {
  +    public void importJbossXml(Element element) throws DeploymentException
  +    {
          Iterator iterator;
          
          // all the tags are optional
  +
  +       // Get the enforce-ejb-restrictions
  +       Element enforce = getOptionalChild(element, "enforce-ejb-restrictions");
  +       if( enforce != null )
  +       {
  +          String tmp = getElementContent(enforce);
  +          enforceEjbRestrictions = Boolean.valueOf(tmp).booleanValue();
  +       }
   
          // Get the security domain name
          Element securityDomainElement = getOptionalChild(element, "security-domain");
  
  
  
  1.20      +103 -28   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.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- BeanMetaData.java 2001/06/03 19:17:46     1.19
  +++ BeanMetaData.java 2001/06/10 07:46:16     1.20
  @@ -19,41 +19,73 @@
   
   import org.jboss.ejb.DeploymentException;
   
  -/**
  - *   <description> 
  - *      
  - *   @see <related>
  +/** 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])
  - *   @version $Revision: 1.19 $
  + *   @author [EMAIL PROTECTED]
  + *   @version $Revision: 1.20 $
    */
   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;
       
        // 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;
  -    protected boolean session;
  -    protected boolean messageDriven = false;
  -     
  -     private HashMap ejbReferences = new HashMap();
  -        private HashMap ejbLocalReferences = new HashMap();
  +    /** 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;
  @@ -62,16 +94,18 @@
        // Static --------------------------------------------------------
       
       // Constructors --------------------------------------------------
  -    public BeanMetaData(ApplicationMetaData app) {
  +    public BeanMetaData(ApplicationMetaData app, char beanType)
  +    {
                application = app;
  +        this.beanType = beanType;
        }
  -     
  +
       // Public --------------------------------------------------------
  -    public boolean isSession() { return session; }
  +    public boolean isSession() { return beanType == SESSION_TYPE; }
   
  -    public boolean isMessageDriven() { return messageDriven; }
  +    public boolean isMessageDriven() { return beanType == MDB_TYPE; }
   
  -     public boolean isEntity() { return !session && !messageDriven; }
  +     public boolean isEntity() { return beanType == ENTITY_TYPE; }
                                                
        public String getHome() { return homeClass; }
        
  @@ -87,7 +121,7 @@
        
        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);
  @@ -127,6 +161,10 @@
        }
   
       public String getSecurityProxy() { return securityProxy; }
  +    private SecurityIdentityMetaData getSecurityIdentityMetaData()
  +    {
  +        return securityIdentity;
  +    }
   
        public ApplicationMetaData getApplicationMetaData() { return application; }
        
  @@ -135,7 +173,8 @@
        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);
  @@ -144,7 +183,10 @@
        public void addPermissionMethod(MethodMetaData method) { 
                permissionMethods.add(method);
        }
  -     
  +     public void addExcludedMethod(MethodMetaData method) { 
  +             excludedMethods.add(method);
  +     }
  +
        public byte getMethodTransactionType(String methodName, Class[] params, 
boolean remote) {
                
                // default value
  @@ -190,11 +232,12 @@
   
                // set the classes
                // Not for MessageDriven
  -             if (!messageDriven) {
  -                 homeClass = getElementContent(getOptionalChild(element, "home"));
  -                 remoteClass = getElementContent(getOptionalChild(element, 
"remote"));
  -                    localHomeClass = getElementContent(getOptionalChild(element, 
"local-home"));
  -                    localClass = getElementContent(getOptionalChild(element, 
"local"));
  +             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"));
                
  @@ -246,7 +289,15 @@
                        
                        securityRoleReferences.add(securityRoleRefMetaData);
                }
  -                     
  +
  +        // 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");
                
  @@ -258,6 +309,16 @@
                        
                        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);
  +        }
        }
   
        public void importJbossXml(Element element) throws DeploymentException {
  @@ -287,7 +348,21 @@
               }
               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, "res-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()) {
  
  
  
  1.7       +4 -5      jboss/src/main/org/jboss/metadata/EntityMetaData.java
  
  Index: EntityMetaData.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/metadata/EntityMetaData.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- EntityMetaData.java       2001/01/26 20:29:13     1.6
  +++ EntityMetaData.java       2001/06/10 07:46:16     1.7
  @@ -12,12 +12,12 @@
   import org.w3c.dom.Element;
   import org.jboss.ejb.DeploymentException;
   
  -/**
  - *   <description> 
  +/** The meta data information specific to entity beans.
    *      
    *   @see <related>
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Sebastien Alborini</a>
  - *   @version $Revision: 1.6 $
  + *   @author [EMAIL PROTECTED]
  + *   @version $Revision: 1.7 $
    */
   public class EntityMetaData extends BeanMetaData {
       // Constants -----------------------------------------------------
  @@ -33,8 +33,7 @@
       
       // Constructors --------------------------------------------------
        public EntityMetaData(ApplicationMetaData app) {
  -             super(app);
  -             session = false;
  +             super(app, BeanMetaData.ENTITY_TYPE);
        }
   
       // Public --------------------------------------------------------
  
  
  
  1.7       +2 -4      jboss/src/main/org/jboss/metadata/MessageDrivenMetaData.java
  
  Index: MessageDrivenMetaData.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/metadata/MessageDrivenMetaData.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MessageDrivenMetaData.java        2001/05/29 21:46:14     1.6
  +++ MessageDrivenMetaData.java        2001/06/10 07:46:16     1.7
  @@ -22,7 +22,7 @@
   ' *   @author <a href="mailto:[EMAIL PROTECTED]";>Sebastien Alborini</a>
    *   @author Peter Antman ([EMAIL PROTECTED])
   
  - *   @version $Revision: 1.6 $
  + *   @version $Revision: 1.7 $
    */
   public class MessageDrivenMetaData extends BeanMetaData {
       // Constants -----------------------------------------------------
  @@ -47,9 +47,7 @@
       
       // Constructors --------------------------------------------------
       public MessageDrivenMetaData(ApplicationMetaData app) {
  -     super(app);
  -     messageDriven = true;
  -     session = false;
  +     super(app, BeanMetaData.MDB_TYPE);
        }
        
       // Public --------------------------------------------------------
  
  
  
  1.8       +109 -34   jboss/src/main/org/jboss/metadata/MethodMetaData.java
  
  Index: MethodMetaData.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/metadata/MethodMetaData.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MethodMetaData.java       2000/12/07 15:45:01     1.7
  +++ MethodMetaData.java       2001/06/10 07:46:16     1.8
  @@ -14,30 +14,93 @@
   
   import org.jboss.ejb.DeploymentException;
   
  -/**
  - *   <description> 
  - *      
  - *   @see <related>
  +/** The combination of the method-permission, container-transaction
  + 
  +<p>
  +The method-permission element specifies that one or more security
  +roles are allowed to invoke one or more enterprise bean methods. The
  +method-permission element consists of an optional description, a list
  +of security role names, or an indicator to specify that the methods
  +are not to be checked for authorization, and a list of method elements.
  +The security roles used in the method-permission element must be
  +defined in the security-role element of the deployment descriptor,
  +and the methods must be methods defined in the enterprise bean�s component
  +and/or home interfaces.
  +</p>
  +<p>
  +The container-transaction element specifies how the container must
  +manage transaction scopes for the enterprise bean�s method invocations.
  +The element consists of an optional description, a list of
  +method elements, and a transaction attribute. The transaction
  +attribute is to be applied to all the specified methods.
  +</p>
  +
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Sebastien Alborini</a>
  - *   @version $Revision: 1.7 $
  + *   @author [EMAIL PROTECTED]
  + *   @version $Revision: 1.8 $
    */
   public class MethodMetaData extends MetaData {
       // Constants -----------------------------------------------------
  -    
  +    public static final char HOME_METHOD = 'H';
  +    public static final char REMOTE_METHOD = 'R';
  +    public static final char LOCAL_HOME_METHOD = 'h';
  +    public static final char LOCAL_METHOD = 'L';
  +    private static final ArrayList EMPTY_PARAM_LIST = new ArrayList();
  +
       // Attributes ----------------------------------------------------
  +    /** The method-name element contains a name of an enterprise bean method,
  +    or the asterisk (*) character. The asterisk is used when the element
  +    denotes all the methods of an enterprise bean�s component and home
  +    interfaces.
  +    */
        private String methodName;
        private String ejbName;
  -     
  +
  +    /** The method-intf element allows a method element to differentiate
  +    between the methods with the same name and signature that are multiply
  +    defined across the home and component interfaces (e.g., in both an
  +    enterprise bean�s remote and local interfaces, or in both an enter-prise
  +    bean�s home and remote interfaces, etc.)
  +    The method-intf element must be one of the following:
  +    <method-intf>Home</method-intf>
  +    <method-intf>Remote</method-intf>
  +    <method-intf>LocalHome</method-intf>
  +    <method-intf>Local</method-intf>
  +     */
        private boolean intf = false;
  -     private boolean home;
  -    
  +    /** One of: HOME_METHOD, REMOTE_METHOD, LOCAL_HOME_METHOD, LOCAL_METHOD */
  +     private char methodType;
        private boolean param = false;
  -     private ArrayList paramList = new ArrayList();
  -
  +    /** The unchecked element specifies that a method is not checked for
  +    authorization by the container prior to invocation of the method.
  +    Used in: method-permission
  +     */
  +    private boolean unchecked = false;
  +    /** The exclude-list element defines a set of methods which the Assembler
  +    marks to be uncallable. It contains one or more methods. If the method
  +    permission relation contains methods that are in the exclude list, the
  +    Deployer should consider those methods to be uncallable.
  +     */
  +    private boolean excluded = false;
  +    /** The method-params element contains a list of the fully-qualified Java
  +    type names of the method parameters.
  +    */
  +     private ArrayList paramList = EMPTY_PARAM_LIST;
  +    /** The trans-attribute element specifies how the container must manage
  +    the transaction boundaries when delegating a method invocation to an
  +    enterprise bean�s business method.
  +    The value of trans-attribute must be one of the following:
  +    <trans-attribute>NotSupported</trans-attribute>
  +    <trans-attribute>Supports</trans-attribute>
  +    <trans-attribute>Required</trans-attribute>
  +    <trans-attribute>RequiresNew</trans-attribute>
  +    <trans-attribute>Mandatory</trans-attribute>
  +    <trans-attribute>Never</trans-attribute>
  +    */
        private byte transactionType;
  -     
  +    
        private Set permissions;
  -     
  +
       // Static --------------------------------------------------------
       
       // Constructors --------------------------------------------------
  @@ -50,9 +113,12 @@
        
        public String getEjbName() { return ejbName; }
        
  -     public boolean isHomeMethod() { return home; }
  -    public boolean isRemoteMethod() { return !home; }
  -    
  +     public boolean isHomeMethod() { return methodType == HOME_METHOD ; }
  +    public boolean isRemoteMethod() { return methodType == REMOTE_METHOD ; }
  +    public boolean isLocalHomeMethod() { return methodType == LOCAL_HOME_METHOD ; }
  +    public boolean isLocalMethod() { return methodType == LOCAL_METHOD ; }
  +    public boolean isUnchecked() { return unchecked; }
  +    public boolean isExcluded() { return excluded; }
        public boolean isIntfGiven() { return intf; }
        
       public boolean isParamGiven() { return param; }
  @@ -68,21 +134,22 @@
        public Set getRoles() { return permissions; }
        
        public void setRoles(Set perm) { permissions = perm; }
  -     
  -     
  +    public void setUnchecked() { unchecked = true; }
  +    public void setExcluded() { excluded = true; }
  +
        public boolean patternMatches(String name, Class[] arg, boolean remote) {
                return patternMatches(name, getClassNames(arg), remote);
        }
        
        public boolean patternMatches(String name, String[] arg, boolean remote) {
                
  -             // the wildcard matches everything
  -             if (getMethodName().equals("*"))
  -    {
  -                     if (isIntfGiven() && (isRemoteMethod() != remote))
  -        return false;
  -      return true;
  -    }
  +        // the wildcard matches everything
  +        if (getMethodName().equals("*"))
  +        {
  +            if (isIntfGiven() && (isRemoteMethod() != remote))
  +                return false;
  +            return true;
  +        }
   
                if (! getMethodName().equals(name)) {
                // different names -> no
  @@ -103,7 +170,9 @@
                }
        }
                        
  -     
  +     /**
  +     @param a method element
  +     */
       public void importEjbJarXml(Element element) throws DeploymentException {
                methodName = getElementContent(getUniqueChild(element, "method-name"));
                ejbName = getElementContent(getUniqueChild(element, "ejb-name"));
  @@ -111,19 +180,25 @@
                Element intfElement = getOptionalChild(element, "method-intf");
                if (intfElement != null) {
                        intf = true;
  -                     String homeRemote = getElementContent(intfElement);
  -                     if (homeRemote.equals("Home")) {
  -                             home = true;
  -                     } else if (homeRemote.equals("Remote")) {
  -                             home = false;
  +                     String methodIntf = getElementContent(intfElement);
  +                     if (methodIntf.equals("Home")) {
  +                             methodType = HOME_METHOD;
  +                     } else if (methodIntf.equals("Remote")) {
  +                             methodType = REMOTE_METHOD;
  +                     } else if (methodIntf.equals("LocalHome")) {
  +                             methodType = LOCAL_HOME_METHOD;
  +                     } else if (methodIntf.equals("Local")) {
  +                             methodType = LOCAL_METHOD;
                        } else {
  -                             throw new DeploymentException("method-intf tag should 
be 'Home' or 'Remote'");
  +                             throw new DeploymentException("method-intf tag should 
be one of: 'Home', 'Remote', 'LocalHome', 'Local'");
                        }
                }
  -             
  +
                Element paramsElement = getOptionalChild(element, "method-params");
  -         if (paramsElement != null) {
  +         if (paramsElement != null)
  +        {
                        param = true;
  +            paramList = new ArrayList();
                        Iterator paramsIterator = getChildrenByTagName(paramsElement, 
"method-param");
                        while (paramsIterator.hasNext()) {
                                
paramList.add(getElementContent((Element)paramsIterator.next()));
  
  
  
  1.5       +53 -17    jboss/src/main/org/jboss/metadata/ResourceRefMetaData.java
  
  Index: ResourceRefMetaData.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/metadata/ResourceRefMetaData.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ResourceRefMetaData.java  2001/05/11 04:52:02     1.4
  +++ ResourceRefMetaData.java  2001/06/10 07:46:16     1.5
  @@ -10,33 +10,66 @@
   
   import org.jboss.ejb.DeploymentException;
   
  -/**
  - *   <description> 
  - *      
  - *   @see <related>
  +/** The meta data information for a resource-ref element.
  +The resource-ref element contains a declaration of enterprise bean�s
  +reference to an external resource. It consists of an optional description,
  +the resource manager connection factory reference name, the
  +indication of the resource manager connection factory type expected
  +by the enterprise bean code, the type of authentication (Application
  +or Container), and an optional specification of the shareability of
  +connections obtained from the resource (Shareable or Unshareable).
  +Used in: entity, message-driven, and session
  +
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Sebastien Alborini</a>
  - *   @version $Revision: 1.4 $
  + *   @author [EMAIL PROTECTED]
  + *   @version $Revision: 1.5 $
    */
   public class ResourceRefMetaData extends MetaData {
       // Constants -----------------------------------------------------
  -    
  +
       // Attributes ----------------------------------------------------
  -    /** The ejb-jar.xml/../resource-ref/res-ref-name element used by the bean code 
*/
  +    /** The ejb-jar/../resource-ref/res-ref-name element used by the bean code.
  +     The res-ref-name element specifies the name of a resource manager con-nection
  +    factory reference. The name is a JNDI name relative to the
  +    java:comp/env context. The name must be unique within an enterprise
  +    bean.
  +    */
        private String refName;
  -    /** The jboss.xml/../resource-ref/resource-name value that maps to a 
resource-manager */
  +    /** The jboss/../resource-ref/resource-name value that maps to a 
resource-manager */
        private String name;
       /** The jndi name of the deployed resource, or the URL in the case of
        a java.net.URL resource type. This comes from either the:
  -     jboss.xml/../resource-ref/jndi-name element value or the
  -     jboss.xml/../resource-ref/res-url element value or the
  -     jboss.xml/../resource-manager/res-jndi-name element value
  -     jboss.xml/../resource-manager/res-url element value
  +     jboss/../resource-ref/jndi-name element value or the
  +     jboss/../resource-ref/res-url element value or the
  +     jboss/../resource-manager/res-jndi-name element value
  +     jboss/../resource-manager/res-url element value
  +     */
  +    private String jndiName;
  +    /** The ejb-jar/../resource-ref/res-type element.
  +     The res-type element specifies the Java class or interface of the data source
        */
  -     private String jndiName;
  -     /** The ejb-jar.xml/../resource-ref/res-type java classname of the resource */
       private String type;
  -    /** The ejb-jar.xml/../resource-ref/res-auth value */
  +    /** The ejb-jar/../resource-ref/res-auth value.
  +    The res-auth element specifies whether the enterprise bean code signs
  +    on programmatically to the resource manager, or whether the Container
  +    will sign on to the resource manager on behalf of the enterprise bean.
  +    In the latter case, the Container uses information that is supplied by
  +    the Deployer.
  +    The value of this element must be one of the two following:
  +    <res-auth>Application</res-auth>
  +    <res-auth>Container</res-auth>
  +     */
        private boolean containerAuth;
  +    /** The ejb-jar/../resource-ref/res-sharing-scope value
  +    The res-sharing-scope element specifies whether connections obtained
  +    through the given resource manager connection factory reference can
  +    be shared. The value of this element, if specified, must be one of the
  +    two following:
  +    <res-sharing-scope>Shareable</res-sharing-scope>
  +    <res-sharing-scope>Unshareable</res-sharing-scope>
  +    The default value is Shareable.
  +    */
  +     private boolean isShareable;
   
       // Static --------------------------------------------------------
       
  @@ -63,7 +96,7 @@
        public String getType() { return type; }
   
        public boolean isContainerAuth() { return containerAuth; }
  -
  +    public boolean isShareable() { return isShareable; }
   
       public void importEjbJarXml(Element element) throws DeploymentException {
                refName = getElementContent(getUniqueChild(element, "res-ref-name"));
  @@ -78,8 +111,11 @@
                } else {
                        throw new DeploymentException("res-auth tag should be 
'Container' or 'Application'");
                }
  +        // The res-sharing-scope element
  +        String sharing = getElementContent(getOptionalChild(element, 
"res-sharing-scope"), "Shareable");
  +        isShareable = sharing.equals("Shareable");
        }
  -     
  +
        public void importJbossXml(Element element) throws DeploymentException {
           // Look for the resource-ref/resource-name element
           Element child = getOptionalChild(element, "resource-name");
  
  
  
  1.3       +18 -13    jboss/src/main/org/jboss/metadata/SecurityRoleRefMetaData.java
  
  Index: SecurityRoleRefMetaData.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/metadata/SecurityRoleRefMetaData.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SecurityRoleRefMetaData.java      2000/12/07 15:45:01     1.2
  +++ SecurityRoleRefMetaData.java      2001/06/10 07:46:16     1.3
  @@ -10,12 +10,21 @@
   
   import org.jboss.ejb.DeploymentException;
   
  -/**
  - *   <description> 
  - *      
  - *   @see <related>
  +/** The metadata object for the security-role-ref element.
  +The security-role-ref element contains the declaration of a security
  +role reference in the enterprise bean�s code. The declaration con-sists
  +of an optional description, the security role name used in the
  +code, and an optional link to a defined security role.
  +The value of the role-name element must be the String used as the
  +parameter to the EJBContext.isCallerInRole(String roleName) method.
  +The value of the role-link element must be the name of one of the
  +security roles defined in the security-role elements.
  +
  +Used in: entity and session
  +
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Sebastien Alborini</a>
  - *   @version $Revision: 1.2 $
  + *   @author [EMAIL PROTECTED]
  + *   @version $Revision: 1.3 $
    */
   public class SecurityRoleRefMetaData extends MetaData {
       // Constants -----------------------------------------------------
  @@ -23,6 +32,7 @@
       // Attributes ----------------------------------------------------
        private String name;
       private String link;
  +    private String description;
        
       // Static --------------------------------------------------------
       
  @@ -35,17 +45,12 @@
        public String getName() { return name; }
        
        public String getLink() { return link; }
  +     public String getDescription() { return description; }
   
       public void importEjbJarXml(Element element) throws DeploymentException {
                name = getElementContent(getUniqueChild(element, "role-name"));
                link = getElementContent(getOptionalChild(element, "role-link"));
  +             description = getElementContent(getOptionalChild(element, 
"description"));
        }               
  -    
  -     // Package protected ---------------------------------------------
  -    
  -    // Protected -----------------------------------------------------
  -    
  -    // Private -------------------------------------------------------
  -    
  -    // Inner classes -------------------------------------------------
  +
   }
  
  
  
  1.5       +7 -8      jboss/src/main/org/jboss/metadata/SessionMetaData.java
  
  Index: SessionMetaData.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/metadata/SessionMetaData.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SessionMetaData.java      2000/12/07 15:45:01     1.4
  +++ SessionMetaData.java      2001/06/10 07:46:16     1.5
  @@ -11,12 +11,11 @@
   
   import org.jboss.ejb.DeploymentException;
   
  -/**
  - *   <description> 
  - *      
  - *   @see <related>
  +/** The meta data information specific to session beans.
  + *
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Sebastien Alborini</a>
  - *   @version $Revision: 1.4 $
  + *   @author [EMAIL PROTECTED]
  + *   @version $Revision: 1.5 $
    */
   public class SessionMetaData extends BeanMetaData {
       // Constants -----------------------------------------------------
  @@ -28,9 +27,9 @@
       // Static --------------------------------------------------------
       
       // Constructors --------------------------------------------------
  -    public SessionMetaData(ApplicationMetaData app) {
  -             super(app);
  -             session = true;
  +    public SessionMetaData(ApplicationMetaData app)
  +    {
  +             super(app, BeanMetaData.SESSION_TYPE);
        }
        
       // Public --------------------------------------------------------
  
  
  
  1.1                  jboss/src/main/org/jboss/metadata/ResourceEnvRefMetaData.java
  
  Index: ResourceEnvRefMetaData.java
  ===================================================================
  /*
   * JBoss, the OpenSource EJB server
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.metadata;
  
  import org.w3c.dom.Element;
  
  import org.jboss.ejb.DeploymentException;
  
  /** The meta data information for a resource-env-ref element.
  The resource-env-ref element contains a declaration of an enterprise
  bean�s reference to an administered object associated with a resource
  in the enterprise bean�s environment. It consists of an optional
  description, the resource environment reference name, and an indication
  of the resource environment reference type expected by the enterprise
  bean code.
  
  Used in: entity, message-driven and session
  
  Example:
  <resource-env-ref>
      <resource-env-ref-name>jms/StockQueue</resource-env-ref-name>
      <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
  </resource-env-ref>
  
  @author [EMAIL PROTECTED]
  @version $Revision: 1.1 $
  */
  public class ResourceEnvRefMetaData extends MetaData
  {
      /** The ejb-jar/../resource-env-ref/resource-env-ref-name element.
      The resource-env-ref-name element specifies the name of a resource
      environment reference; its value is the environment entry name used in
      the enterprise bean code. The name is a JNDI name relative to the
      java:comp/env context and must be unique within an enterprise bean.
      */
        private String refName;
      /** The jboss/../resource-env-ref/jndi-name element value. This is the
        jndi name of the deployed resource.
       */
      private String jndiName;
      /** The ejb-jar/../resource-env-ref/resource-env-ref-type java element.
       The res-type element specifies the Java class or interface of a resource
       environment reference
       */
      private String type;
        
        public String getRefName() { return refName; }
      public String getJndiName() { return jndiName; }
        public String getType() { return type; }
  
      /** Parse the ejb-jar child element
       @param element, the resource-env-ref element
       */
      public void importEjbJarXml(Element element) throws DeploymentException
      {
                refName = getElementContent(getUniqueChild(element, 
"resource-env-ref-name"));
                type = getElementContent(getUniqueChild(element, 
"resource-env-ref-type"));
        }
  
      /** Parse the jboss child element
       @param element, the resource-env-ref element
       */
        public void importJbossXml(Element element) throws DeploymentException
      {
          jndiName = getElementContent(getUniqueChild(element, "jndi-name"));
        }
  }
  
  
  
  1.1                  jboss/src/main/org/jboss/metadata/SecurityIdentityMetaData.java
  
  Index: SecurityIdentityMetaData.java
  ===================================================================
  /*
   * JBoss, the OpenSource EJB server
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.metadata;
  
  import org.w3c.dom.Element;
  
  import org.jboss.ejb.DeploymentException;
  
  /** The meta data object for the security-identity element.
  The security-identity element specifies whether the caller�s security
  identity is to be used for the execution of the methods of the enterprise
  bean or whether a specific run-as identity is to be used. It
  contains an optional description and a specification of the security
  identity to be used.
  
  Used in: session, entity, message-driven
  
  @author [EMAIL PROTECTED]
  @version $Revision: 1.1 $
  */
  public class SecurityIdentityMetaData extends MetaData
  {
      private String description;
      /** The use-caller-identity element specifies that the caller�s security
      identity be used as the security identity for the execution of the
      enterprise bean�s methods.
      */
      private boolean useCallerIdentity;
      /** The run-as/role-name element specifies the run-as security role name
      to be used for the execution of the methods of an enterprise bean.
      */
        private String runAsRoleName;
  
        public String getDescription()
      {
          return description;
      }
  
      public boolean getUseCallerIdentity()
      {
          return useCallerIdentity;
      }
      public String getRunAsRoleName()
      {
          return runAsRoleName;
      }
  
      /**
       @param element, the security-identity element from the ejb-jar
       */
      public void importEjbJarXml(Element element) throws DeploymentException
      {
                description = getElementContent(getOptionalChild(element, 
"description"));
          Element callerIdent = getOptionalChild(element, "use-caller-identity");
          Element runAs = getOptionalChild(element, "run-as");
          if( callerIdent == null && runAs == null )
              throw new DeploymentException("security-identity: either 
use-caller-identity or run-as must be specified");
          if( callerIdent != null && runAs != null )
              throw new DeploymentException("security-identity: only one of 
use-caller-identity or run-as can be specified");
          if( callerIdent != null )
          {
              useCallerIdentity = true;
          }
          else
          {
              runAsRoleName = getElementContent(getUniqueChild(runAs, "role-name"));
          }
        }
  
  }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to