juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svi...@apache.org
Subject cvs commit: ws-juddi/src/java/org/apache/juddi/registry RegistryServlet.java
Date Tue, 22 Jun 2004 18:59:50 GMT
sviens      2004/06/22 11:59:50

  Modified:    webapp/WEB-INF web.xml
               src/java/org/apache/juddi/registry RegistryServlet.java
  Log:
  Moved name and location of the juddi.properties file from a static final to an <init-param>
element in web.xml
  
  Revision  Changes    Path
  1.3       +4 -0      ws-juddi/webapp/WEB-INF/web.xml
  
  Index: web.xml
  ===================================================================
  RCS file: /home/cvs/ws-juddi/webapp/WEB-INF/web.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- web.xml	7 Jun 2004 01:07:16 -0000	1.2
  +++ web.xml	22 Jun 2004 18:59:50 -0000	1.3
  @@ -19,6 +19,10 @@
       <servlet-name>jUDDIRegistryServlet</servlet-name>
       <display-name>jUDDI Registry Servlet</display-name>
       <servlet-class>org.apache.juddi.registry.RegistryServlet</servlet-class>
  +    <init-param>
  +      <param-name>juddi.propertiesFile</param-name>
  +      <param-value>/WEB-INF/juddi.properties</param-value>
  +    </init-param>
       <load-on-startup>1</load-on-startup>
     </servlet>
   
  
  
  
  1.6       +15 -6     ws-juddi/src/java/org/apache/juddi/registry/RegistryServlet.java
  
  Index: RegistryServlet.java
  ===================================================================
  RCS file: /home/cvs/ws-juddi/src/java/org/apache/juddi/registry/RegistryServlet.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RegistryServlet.java	16 Jun 2004 16:02:52 -0000	1.5
  +++ RegistryServlet.java	22 Jun 2004 18:59:50 -0000	1.6
  @@ -34,9 +34,13 @@
    */
   public class RegistryServlet extends HttpServlet
   {
  -  // xml config file name.
  -  private static final String PROPERTY_FILE = "/WEB-INF/juddi.properties";
  -
  +  // config file property name (used to look up the juddi property file name).
  +  private static final String CONFIG_FILE_PROPERTY_NAME = "juddi.propertiesFile";
  +  
  +  // default config file name. 
  +  private static final String DEFAULT_PROPERTY_FILE = "/WEB-INF/juddi.properties";
  +  
  +  
     // private reference to the webapp's logger.
     private static Log log = LogFactory.getLog(RegistryServlet.class);
     
  @@ -58,13 +62,18 @@
       try
       {      
         log.info("jUDDI Starting: Loading resources and initializing subsystems.");
  +        
  +      // determine the name of the juddi property file to use from web.xml
  +      String propFile = config.getInitParameter(CONFIG_FILE_PROPERTY_NAME);
  +      if ((propFile == null) || (propFile.trim().length() == 0))
  +        propFile = DEFAULT_PROPERTY_FILE;
         
         InputStream is = 
  -      	getServletContext().getResourceAsStream(PROPERTY_FILE);
  +      	getServletContext().getResourceAsStream(propFile);
       	
         if (is != null)
         {
  -        log.info("Resources loaded from: "+PROPERTY_FILE);
  +        log.info("Resources loaded from: "+propFile);
   
           // Load jUDDI configuration from the 
           // juddi.properties file found in the 
  @@ -74,7 +83,7 @@
         }
         else
         {
  -        log.warn("Could not locate jUDDI properties '" + PROPERTY_FILE + 
  +        log.warn("Could not locate jUDDI properties '" + propFile + 
           		"'. Using defaults.");
   
           // A juddi.properties file doesn't exist
  
  
  

Mime
View raw message