User: starksm 
  Date: 02/04/04 20:18:23

  Modified:    catalina/src/main/org/jboss/web/catalina Tag: Branch_2_4
                        EmbeddedCatalinaServiceSX.java
                        EmbeddedCatalinaServiceSXMBean.java
  Log:
  Add a CatalinaHome attribute for the catalina.home and catalina.base
  System property values for use with non-standard catalina distribution
  directory structures
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.7   +28 -22    
contrib/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSX.java
  
  Index: EmbeddedCatalinaServiceSX.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/contrib/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSX.java,v
  retrieving revision 1.2.2.6
  retrieving revision 1.2.2.7
  diff -u -r1.2.2.6 -r1.2.2.7
  --- EmbeddedCatalinaServiceSX.java    4 Apr 2002 08:22:28 -0000       1.2.2.6
  +++ EmbeddedCatalinaServiceSX.java    5 Apr 2002 04:18:23 -0000       1.2.2.7
  @@ -57,16 +57,19 @@
   import org.apache.catalina.startup.Embedded;
   
   /** An implementation of the AbstractWebContainer for the Jakarta Tomcat
  - 4.0 servlet container. This uses the Embedded as the integration class. It
  - does not parse the catalina server.xml.
  + 4.0 servlet container. This uses the org.apache.catalina.startup.Embedded as
  + the integration class. It does not parse the catalina server.xml in the
  + catalina distribution. Rather, it parses a subset of the server.xml syntax
  + and obtains this configuration information from the Config attribute.
    
    @see org.jboss.web.AbstractWebContainer
    @see org.apache.catalina.startup.Embedded
    
    @author [EMAIL PROTECTED]
  - @version $Revision: 1.2.2.6 $
  + @version $Revision: 1.2.2.7 $
    */
  -public class EmbeddedCatalinaServiceSX extends AbstractWebContainer implements 
EmbeddedCatalinaServiceSXMBean
  +public class EmbeddedCatalinaServiceSX extends AbstractWebContainer
  +   implements EmbeddedCatalinaServiceSXMBean
   {
      // Constants -----------------------------------------------------
      public static final String NAME = "EmbeddedCatalinaSX";
  @@ -75,8 +78,8 @@
      private EmbeddedCatalina catalina;
      /** The catalina debug level */
      private int debugLevel;
  -   /** The JNDI name of the SecurityDomain implementation binding */
  -   private String securityDomain;
  +   /** The value to use for the catalina.home and catalina.base System properties */
  +   private String catalinaHome;
      /** Any extended configuration information specified via a config
       element in the mbean definition.
       */
  @@ -91,14 +94,14 @@
         return NAME;
      }
   
  -    public String getSecurityDomain()
  -    {
  -       return this.securityDomain;
  -    }
  -    public void setSecurityDomain(String securityDomain)
  -    {
  -       this.securityDomain = securityDomain;
  -    }
  +   public String getCatalinaHome()
  +   {
  +      return this.catalinaHome;
  +   }
  +   public void setCatalinaHome(String catalinaHome)
  +   {
  +      this.catalinaHome = catalinaHome;
  +   }
   
       /** This method is invoked to import an arbitrary XML configuration tree.
        Subclasses should override this method if they support such a configuration
  @@ -134,14 +137,17 @@
         try
         {
            // Set the catalina.home property from the Embedded class location
  -         ProtectionDomain pd = Embedded.class.getProtectionDomain();
  -         URL catalinaHome = pd.getCodeSource().getLocation();
  -         String homePath = catalinaHome.getFile();
  -         File homeDir = new File(homePath, "../../..");
  -         homePath = homeDir.getCanonicalPath();
  -         log.debug("Setting catalina.home to: " + homePath);
  -         System.setProperty("catalina.home", homePath);
  -         System.setProperty("catalina.base", homePath);
  +         if( catalinaHome == null )
  +         {
  +            ProtectionDomain pd = Embedded.class.getProtectionDomain();
  +            URL catalinaHome = pd.getCodeSource().getLocation();
  +            String homePath = catalinaHome.getFile();
  +            File homeDir = new File(homePath, "../../..");
  +            catalinaHome = homeDir.getCanonicalPath();
  +         }
  +         log.debug("Setting catalina.home to: " + catalinaHome);
  +         System.setProperty("catalina.home", catalinaHome);
  +         System.setProperty("catalina.base", catalinaHome);
            initCatalina(cl);
            catalina.start();
         }
  
  
  
  1.1.2.6   +11 -10    
contrib/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSXMBean.java
  
  Index: EmbeddedCatalinaServiceSXMBean.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/contrib/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSXMBean.java,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- EmbeddedCatalinaServiceSXMBean.java       4 Apr 2002 08:22:28 -0000       1.1.2.5
  +++ EmbeddedCatalinaServiceSXMBean.java       5 Apr 2002 04:18:23 -0000       1.1.2.6
  @@ -15,21 +15,22 @@
   /** Management interface for the embedded Catalina service.
    *
    * @author [EMAIL PROTECTED]
  - * @version $Revision: 1.1.2.5 $
  + * @version $Revision: 1.1.2.6 $
    */
   public interface EmbeddedCatalinaServiceSXMBean extends AbstractWebContainerMBean
   {
  -
  -   /** @return the JNDI name of the SecurityDomain instance to
  -    use with JSSE.
  +   /** Get the value to use for the catalina.home and catalina.base System
  +    properties. If not specified this will be determined based on the
  +    location of the jar containing the org.apache.catalina.startup.Embedded
  +    class assuming a standard catalina distribution structure.
       */
  -   public String getSecurityDomain();
  -   /** Set the JNDI name of the SecurityDomain instance to
  -    use with JSSE.
  -    * @param securityDomain the JNDI name of the SecurityDomain
  -    instance to use with JSSE.
  +    public String getCatalinaHome();
  +   /** Set the value to use for the catalina.home and catalina.base System
  +    properties. If not specified this will be determined based on the
  +    location of the jar containing the org.apache.catalina.startup.Embedded
  +    class assuming a standard catalina distribution structure.
       */
  -   public void setSecurityDomain(String securityDomain);
  +    public void setCatalinaHome(String catalinaHome);
   
      /** Override the AbstractWebContainerMBean to provide support for extended
       configuration using constructs from the standard server.xml to configure
  
  
  

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

Reply via email to