User: starksm 
  Date: 01/03/26 23:23:06

  Modified:    src/main/org/jboss Main.java
  Log:
  Set a jboss.home system property if one does not exist for use in
  security policy files and other situations where the dist directory avoid
  harded coded paths.
  
  Update the SecurityInterceptor comments.
  
  Revision  Changes    Path
  1.30      +15 -2     jboss/src/main/org/jboss/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/Main.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- Main.java 2001/03/25 22:20:05     1.29
  +++ Main.java 2001/03/27 07:23:06     1.30
  @@ -32,13 +32,13 @@
    *   @see <related>
    *   @author Rickard �berg ([EMAIL PROTECTED])
    *   @author <a href="mailto:[EMAIL PROTECTED]">Daniel O'Connor</a>.
  - *   @version $Revision: 1.29 $
  + *   @version $Revision: 1.30 $
    */
   public class Main
   {
      // Constants -----------------------------------------------------
   
  -   String versionIdentifier = "2.1-BETA-Mar-24-2001";
  +   String versionIdentifier = "2.1-BETA-Mar-26-2001";
      // Attributes ----------------------------------------------------
   
      // Static --------------------------------------------------------
  @@ -67,6 +67,19 @@
         }
   
         System.getProperties().load(propertiesIn);
  +
  +      /* Set a jboss.home property from the location of the Main.class jar
  +         if the property does not exist.
  +      */
  +      if( System.getProperty("jboss.home") == null )
  +      {
  +          String path = 
Main.class.getProtectionDomain().getCodeSource().getLocation().getFile();
  +          File runJar = new File(path);
  +          // Home dir should be the parent of the dir containing run.jar
  +          File homeDir = new File(runJar.getParent(), "..");
  +          System.setProperty("jboss.home", homeDir.getCanonicalPath());
  +      }
  +      System.out.println("jboss.home = "+System.getProperty("jboss.home"));
   
         // Set security
         URL serverPolicy = 
Main.class.getClassLoader().getResource(confName+"/server.policy");
  
  
  

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

Reply via email to