commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject cvs commit: jakarta-commons/chain/src/java/org/apache/commons/chain/config ConfigRuleSet.java
Date Fri, 09 Jul 2004 00:03:25 GMT
craigmcc    2004/07/08 17:03:25

  Modified:    chain/src/java/org/apache/commons/chain/config
                        ConfigRuleSet.java
  Log:
  Allow a global default to be set for the o.a.c.c.Chain implementation class
  to be used when instantiating a new chain.
  
  Submitted by:  Manfred Wolff <wolff AT manfred-wolff.de>
  
  Revision  Changes    Path
  1.6       +25 -2     jakarta-commons/chain/src/java/org/apache/commons/chain/config/ConfigRuleSet.java
  
  Index: ConfigRuleSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/chain/src/java/org/apache/commons/chain/config/ConfigRuleSet.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ConfigRuleSet.java	25 Feb 2004 00:01:06 -0000	1.5
  +++ ConfigRuleSet.java	9 Jul 2004 00:03:25 -0000	1.6
  @@ -30,6 +30,10 @@
    * executing the <code>addRuleInstance()</code> method in order to influence
    * the rules that get added, with default values in square brackets:</p>
    * <ul>
  + * <li><strong>chainClass</strong> -- Fully qualified name of the implementation
  + *     class used to create new {@link Chain} instances.  If not specified, the
  + *     default value is <code>org.apache.commons.chain.impl.ChainBase</code>.
  + *     </li>
    * <li><strong>chainElement</strong> -- Name of the XML element representing
    *     the addition of a {@link Chain}.  A chain element has the same
    *     functionality as a command element, except that it defaults the
  @@ -61,6 +65,7 @@
       // ----------------------------------------------------- Instance Variables
   
   
  +    private String chainClass = "org.apache.commons.chain.impl.ChainBase";
       private String chainElement = "chain";
       private String classAttribute = "className";
       private String commandElement = "command";
  @@ -71,6 +76,24 @@
   
   
       /**
  +     * <p>Return the fully qualified {@link Chain} implementation class.</p>
  +     */
  +    public String getChainClass() {
  +        return (this.chainClass);
  +    }
  +
  +
  +    /**
  +     * <p>Set the fully qualified {@link Chain} implementation class.</p>
  +     *
  +     * @param chainClass The new {@link Chain} implementation class
  +     */
  +    public void setChainClass(String chainClass) {
  +        this.chainClass = chainClass;
  +    }
  +
  +
  +    /**
        * <p>Return the element name of a chain element.</p>
        */
       public String getChainElement() {
  @@ -158,7 +181,7 @@
   
           // Add rules for a chain element
           digester.addObjectCreate("*/" + getChainElement(),
  -                                 "org.apache.commons.chain.impl.ChainBase",
  +                                 getChainClass(),
                                    getClassAttribute());
           digester.addSetProperties("*/" + getChainElement());
           digester.addRule("*/" + getChainElement(),
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message