User: user57  
  Date: 02/02/11 21:05:48

  Modified:    src/main/org/jboss/system ServerConfig.java
                        ServerConfigMBean.java
  Log:
   o exposing two more local file config properties: tempDir and
     stateDataDir (for tmp & db).  These appear to be the only other
     local file resources we have at the moment (both of which are
     currently generated from homeDir).
  
  Revision  Changes    Path
  1.3       +64 -14    jboss/src/main/org/jboss/system/ServerConfig.java
  
  Index: ServerConfig.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/system/ServerConfig.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ServerConfig.java 11 Feb 2002 23:01:37 -0000      1.2
  +++ ServerConfig.java 12 Feb 2002 05:05:47 -0000      1.3
  @@ -22,13 +22,19 @@
    *    Should use nested version when JDK 1.4 is standardized.
    *      
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jason Dillon</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public class ServerConfig
      implements ServerConfigMBean
   {
      /** The local home directory for the server. */
      private File homeDir;
  +
  +   /** The directory for server temporay files. */
  +   private File tempDir;
  +
  +   /** The directory for local state data files. */
  +   private File stateDataDir;
      
      /** The JMX domain for the base MBean server. */
      private String domain = "jboss";
  @@ -88,12 +94,23 @@
      public String getDomain() {
         return domain;
      }
  +
  +   public void setConfigName(final String name) {
  +      if (name == null)
  +         throw new IllegalArgumentException("name is null");
  +      
  +      configName = name;
  +   }
      
  +   public String getConfigName() {
  +      return configName;
  +   }
  +
      public void setHomeDir(final File dir) {
         if (dir == null)
            throw new IllegalArgumentException("dir is null");
  -      
  -      // check if this is really a directory ?
  +
  +      // FIXME: check if this is really a directory      
         
         homeDir = dir;
      }
  @@ -101,6 +118,50 @@
      public File getHomeDir() {
         return homeDir;
      }
  +
  +   public void setTempDir(final File dir) {
  +      if (dir == null)
  +         throw new IllegalArgumentException("dir is null");
  +      
  +      // FIXME: check if this is really a directory
  +      // FIXME: check if this is writable
  +      tempDir = dir;
  +   }
  +   
  +   /**
  +    * Get the directory where temporary files will be stored.
  +    *
  +    * @return    The directory where the server stores temporary files.
  +    */
  +   public File getTempDir() {
  +      if (tempDir == null) {
  +         tempDir = new File(homeDir, "tmp");
  +      }
  +      
  +      return tempDir;
  +   }
  +
  +   public void setStateDataDir(final File dir) {
  +      if (dir == null)
  +         throw new IllegalArgumentException("dir is null");
  +      
  +      // FIXME: check if this is really a directory
  +      // FIXME: check if this is writable
  +      stateDataDir = dir;
  +   }
  +
  +   /**
  +    * Get the directory where local state data will be stored.
  +    *
  +    * @return    The directory where the server stores local state data.
  +    */
  +   public File getStateDataDir() {
  +      if (stateDataDir == null) {
  +         stateDataDir = new File(homeDir, "db");
  +      }
  +
  +      return stateDataDir;
  +   }
      
      public void setInstallURL(final URL url) {
         if (url == null)
  @@ -134,17 +195,6 @@
         return libraryURL;
      }
   
  -   public void setConfigName(final String name) {
  -      if (name == null)
  -         throw new IllegalArgumentException("name is null");
  -      
  -      configName = name;
  -   }
  -   
  -   public String getConfigName() {
  -      return configName;
  -   }
  -   
      public void setConfigURL(final URL url) {
         if (url == null)
            throw new IllegalArgumentException("url is null");
  
  
  
  1.2       +58 -4     jboss/src/main/org/jboss/system/ServerConfigMBean.java
  
  Index: ServerConfigMBean.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/system/ServerConfigMBean.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServerConfigMBean.java    11 Feb 2002 23:01:37 -0000      1.1
  +++ ServerConfigMBean.java    12 Feb 2002 05:05:47 -0000      1.2
  @@ -14,24 +14,78 @@
    * The JMX MBean interface for the <tt>ServerConfig</tt> component.
    *      
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jason Dillon</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public interface ServerConfigMBean
   {
  +   /**
  +    * Get the JMX domain for which the system is bound under.
  +    *
  +    * @return    JMX domain name.
  +    */
      String getDomain();
   
  +   /**
  +    * Get the configuration name of the server.
  +    *
  +    * @return    The configuration name of the server.
  +    */
  +   String getConfigName();
  +
  +   /**
  +    * Get the local home directory which the server is running from.
  +    *
  +    * @return    The local server home directory.
  +    */
      File getHomeDir();
  -   
  +
  +   /**
  +    * Get the directory where temporary files will be stored.
  +    *
  +    * @return    The directory where the server stores temporary files.
  +    */
  +   File getTempDir();
  +
  +   /**
  +    * Get the directory where local state data will be stored.
  +    *
  +    * @return    The directory where the server stores local state data.
  +    */
  +   File getStateDataDir();
  +   
  +   /**
  +    * Get the installation URL for the server.
  +    *
  +    * @return    The installation URL for the server.
  +    */
      URL getInstallURL();
      
  +   /**
  +    * Get the library URL for the server.
  +    *
  +    * @return    The library URL for the server.
  +    */
      URL getLibraryURL();
      
  -   String getConfigName();
  -   
  +   /**
  +    * Get the configuration URL for the server.
  +    *
  +    * @return    The configuration URL for the server.
  +    */
      URL getConfigURL();
      
  +   /**
  +    * Get the patch URL for the server.
  +    *
  +    * @return    The patch URL for the server.
  +    */
      URL getPatchURL();
      
  +   /**
  +    * Get the spine URL for the server.
  +    *
  +    * @return    The spine URL for the server.
  +    */
      URL getSpineURL();
   
      /**
  
  
  

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

Reply via email to