User: mulder  
  Date: 01/02/07 21:08:19

  Modified:    src/main/org/jboss/resource RARMetaData.java
  Log:
  Handle the description and license tags.
  Make config-property/config-property-value optional (some properties just
     have to be set at deployment)
  
  Revision  Changes    Path
  1.2       +46 -11    jbosscx/src/main/org/jboss/resource/RARMetaData.java
  
  Index: RARMetaData.java
  ===================================================================
  RCS file: /products/cvs/ejboss/jbosscx/src/main/org/jboss/resource/RARMetaData.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RARMetaData.java  2001/02/06 06:54:40     1.1
  +++ RARMetaData.java  2001/02/08 05:08:19     1.2
  @@ -26,14 +26,14 @@
    *
    *   @see RARDeployer
    *   @author Toby Allsopp ([EMAIL PROTECTED])
  - *   @version $Revision: 1.1 $
  + *   @version $Revision: 1.2 $
    */
   public class RARMetaData
      //   extends Y
      implements XmlLoadable
   {
      // Constants -----------------------------------------------------
  -    
  +
      // Attributes ----------------------------------------------------
   
      private Log log;
  @@ -41,7 +41,7 @@
      private ClassLoader classLoader;
   
      private String displayName;
  -    
  +
      private String managedConnectionFactoryClass;
      private String connectionFactoryInterface;
      private String connectionFactoryImplClass;
  @@ -61,9 +61,9 @@
      private boolean reauthenticationSupport;
   
      // Static --------------------------------------------------------
  -   
  +
      // Constructors --------------------------------------------------
  -   
  +
      // Public --------------------------------------------------------
   
      /**
  @@ -125,11 +125,11 @@
      }
   
      // Y overrides ---------------------------------------------------
  -   
  +
      // Package protected ---------------------------------------------
  -    
  +
      // Protected -----------------------------------------------------
  -    
  +
      // Private -------------------------------------------------------
   
      private void invokeChildren(Element element) throws DeploymentException
  @@ -172,7 +172,7 @@
            }
         }
      }
  -    
  +
      private Method elementToMethod(Element element)
      {
         String tag = element.getTagName();
  @@ -299,19 +299,54 @@
                                                   "config-property-name");
            Element typeE= MetaData.getUniqueChild(element,
                                                   "config-property-type");
  -         Element valueE= MetaData.getUniqueChild(element,
  +         Element valueE= MetaData.getOptionalChild(element,
                                                    "config-property-value");
   
            Property p = new Property();
            p.name = getElementContent(nameE);
            p.type = getElementContent(typeE);
  -         p.value = getElementContent(valueE);
  +         if(valueE != null) {
  +            p.value = getElementContent(valueE);
  +         }
            properties.put(p.name, p);
         }
         catch (org.jboss.ejb.DeploymentException de)
         {
            throw new DeploymentException(de.getMessage(), de.getCause());
         }
  +   }
  +
  +   private void setLicense(Element element)
  +      throws DeploymentException
  +   {
  +      try
  +      {
  +         Element requiredE = MetaData.getUniqueChild(element,
  +                                                "license-required");
  +         Element descriptionE = MetaData.getOptionalChild(element,
  +                                                 "description");
  +         boolean required = new 
Boolean(getElementContent(requiredE).trim()).booleanValue();
  +         if(required) {
  +            log.warning("By using this resource adapter, you are accepting the");
  +            log.warning("following license.  If you object to the license, you");
  +            log.warning("must undeploy the resource adapter immediately.");
  +            log.warning(getElementContent(descriptionE).trim());
  +         } else {
  +            log.warning("This resource adapter has license terms that you may");
  +            log.warning("want to be aware of, though you are not required to");
  +            log.warning("accept them in order to use the adapter.");
  +         }
  +      }
  +      catch (org.jboss.ejb.DeploymentException de)
  +      {
  +         throw new DeploymentException(de.getMessage(), de.getCause());
  +      }
  +   }
  +
  +   private void setDescription(Element element)
  +      throws DeploymentException
  +   {
  +      log.warning("Loading "+getElementContent(element).trim());
      }
   
      private void setAuthMechanism(Element element) throws DeploymentException
  
  
  

Reply via email to