User: thedug  
  Date: 01/06/01 00:50:23

  Modified:    src/main/org/jboss/metadata ConfigurationMetaData.java
  Log:
  Added support for reading <optiond-refresh-rate> from jboss.xml
  Also added accessor methods for this value (getOptionDRefreshRate)
  
  Revision  Changes    Path
  1.13      +21 -5     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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ConfigurationMetaData.java        2001/06/01 00:00:22     1.12
  +++ ConfigurationMetaData.java        2001/06/01 07:50:22     1.13
  @@ -15,7 +15,7 @@
    *
    *   @see <related>
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Sebastien Alborini</a>
  - *   @version $Revision: 1.12 $
  + *   @version $Revision: 1.13 $
    */
   public class ConfigurationMetaData extends MetaData {
   
  @@ -34,7 +34,7 @@
        public static final byte A_COMMIT_OPTION = 0;
        public static final byte B_COMMIT_OPTION = 1;
        public static final byte C_COMMIT_OPTION = 2;
  -     /** D_COMMIT_OPTION is a lazy load option. It synchronizes every 30 seconds */
  +     /** D_COMMIT_OPTION is a lazy load option. By default it synchronizes every 30 
seconds */
        public static final byte D_COMMIT_OPTION = 3;
        public static final String[] commitOptionStrings = { "A", "B", "C", "D"};
   
  @@ -46,6 +46,7 @@
       private String persistenceManager;
       private String transactionManager;
       private byte commitOption;
  +    private long optionDRefreshRate = 30000;
       private boolean callLogging;
       private boolean readOnlyGetMethods;
   
  @@ -82,8 +83,8 @@
   
        public String getTransactionManager() { return transactionManager; }
   
  -    public Element getContainerInvokerConf() { return containerInvokerConf; }
  -     public Element getContainerPoolConf() { return containerPoolConf; }
  +        public Element getContainerInvokerConf() { return containerInvokerConf; }
  +        public Element getContainerPoolConf() { return containerPoolConf; }
        public Element getContainerCacheConf() { return containerCacheConf; }
        public Element getContainerInterceptorsConf() { return 
containerInterceptorsConf; }
   
  @@ -91,6 +92,8 @@
   
        public byte getCommitOption() { return commitOption; }
   
  +        public long getOptionDRefreshRate() { return optionDRefreshRate; }
  +
        public boolean getReadOnlyGetMethods() { return readOnlyGetMethods; }
   
        public void importJbossXml(Element element) throws DeploymentException {
  @@ -125,11 +128,15 @@
                // set the role mapping manager
                roleMappingManager = getElementContent(getOptionalChild(element, 
"role-mapping-manager"), roleMappingManager);
   
  -    // set the commit option
  +                // set the commit option
                String commit = getElementContent(getOptionalChild(element, 
"commit-option"), commitOptionToString(commitOption));
   
                commitOption = stringToCommitOption(commit);
   
  +                //get the refresh rate for option D
  +             String refresh = getElementContent(getOptionalChild(element, 
"optiond-refresh-rate"), Long.toString(optionDRefreshRate));
  +             optionDRefreshRate = stringToRefreshRate(refresh);
  +
                // the classes which can understand the following are dynamically 
loaded during deployment :
                // We save the Elements for them to use later
   
  @@ -177,6 +184,15 @@
                    return i;
   
            throw new DeploymentException("Invalid commit option: '" + commitOption + 
"'");
  +     }
  +
  +        private static long stringToRefreshRate(String refreshRate) throws 
DeploymentException {
  +         try{
  +             return Long.parseLong(refreshRate);
  +         } catch ( Exception e){
  +             throw new DeploymentException("Invalid optiond-refresh-rate \"" + 
refreshRate + "\". Should be a number"); 
  +         }
  +
        }
   
       // Inner classes -------------------------------------------------
  
  
  

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

Reply via email to