You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by qu...@apache.org on 2003/01/04 05:24:46 UTC

cvs commit: jakarta-turbine-2/src/java/org/apache/turbine/services/xmlrpc TurbineXmlRpcService.java

quintonm    2003/01/03 20:24:45

  Modified:    src/java/org/apache/turbine/services TurbineBaseService.java
               src/java/org/apache/turbine/services/component
                        TurbineComponentService.java
               src/java/org/apache/turbine/services/intake
                        TurbineIntakeService.java
               src/java/org/apache/turbine/services/jsp
                        TurbineJspService.java
               src/java/org/apache/turbine/services/schedule
                        TurbineNonPersistentSchedulerService.java
                        TurbineSchedulerService.java
               src/java/org/apache/turbine/services/security
                        BaseSecurityService.java
               src/java/org/apache/turbine/services/servlet
                        TurbineServletService.java
               src/java/org/apache/turbine/services/velocity
                        TurbineVelocityService.java
               src/java/org/apache/turbine/services/xmlrpc
                        TurbineXmlRpcService.java
  Log:
  TurbineBaseService - deprecated init(ServetConfig)
  
  All others -
     Moved code from the init(ServletConfig) method into the init() method.  The init(ServletConfig)
     method now calls init()
  
  Revision  Changes    Path
  1.2       +8 -7      jakarta-turbine-2/src/java/org/apache/turbine/services/TurbineBaseService.java
  
  Index: TurbineBaseService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/TurbineBaseService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TurbineBaseService.java	16 Aug 2001 05:08:47 -0000	1.1
  +++ TurbineBaseService.java	4 Jan 2003 04:24:44 -0000	1.2
  @@ -25,13 +25,13 @@
    *    Alternately, this acknowledgment may appear in the software itself,
    *    if and wherever such third-party acknowledgments normally appear.
    *
  - * 4. The names "Apache" and "Apache Software Foundation" and 
  - *    "Apache Turbine" must not be used to endorse or promote products 
  - *    derived from this software without prior written permission. For 
  + * 4. The names "Apache" and "Apache Software Foundation" and
  + *    "Apache Turbine" must not be used to endorse or promote products
  + *    derived from this software without prior written permission. For
    *    written permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  - *    "Apache Turbine", nor may "Apache" appear in their name, without 
  + *    "Apache Turbine", nor may "Apache" appear in their name, without
    *    prior written permission of the Apache Software Foundation.
    *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  @@ -97,7 +97,7 @@
        * initialization and pass them to apropriate init() methods.
        *
        * @param data An Object to use for initialization activities.
  -     * @exception InitializationException, if initialization of this
  +     * @exception InitializationException if initialization of this
        * class was not successful.
        */
       public void init( Object data )
  @@ -118,8 +118,9 @@
        *
        * @param config A ServletConfing to use for initialization
        * activities.
  -     * @exception InitializationException, if initialization of this
  +     * @exception InitializationException if initialization of this
        * class was not successful.
  +     * @deprecated Use init() instead
        */
       public void init( ServletConfig config )
           throws InitializationException
  
  
  
  1.8       +17 -17    jakarta-turbine-2/src/java/org/apache/turbine/services/component/TurbineComponentService.java
  
  Index: TurbineComponentService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/component/TurbineComponentService.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TurbineComponentService.java	4 Jan 2003 03:56:33 -0000	1.7
  +++ TurbineComponentService.java	4 Jan 2003 04:24:45 -0000	1.8
  @@ -113,22 +113,7 @@
       public void init()
           throws InitializationException
       {
  -        ServletConfig conf = Turbine.getTurbineServletConfig();
  -        init(conf);
  -    }
  -
  -    /**
  -     * Inits the service using servlet parameters to obtain path to the
  -     * configuration file. Change relatives paths.
  -     *
  -     * @param config The ServletConfiguration from Turbine
  -     *
  -     * @throws InitializationException Something went wrong when starting up.
  -     * @deprecated use init() instead.
  -     */
  -    public void init(ServletConfig config)
  -        throws InitializationException
  -    {
  +        ServletConfig config = Turbine.getTurbineServletConfig();
           Configuration loaderConf = new BaseConfiguration();
   
           String [] names = getConfiguration().getStringArray(NAME);
  @@ -173,6 +158,21 @@
               log.error("Component Service failed: ", e);
               throw new InitializationException("ComponentService failed: ", e);
           }
  +    }
  +
  +    /**
  +     * Inits the service using servlet parameters to obtain path to the
  +     * configuration file. Change relatives paths.
  +     *
  +     * @param config The ServletConfiguration from Turbine
  +     *
  +     * @throws InitializationException Something went wrong when starting up.
  +     * @deprecated use init() instead.
  +     */
  +    public void init(ServletConfig config)
  +        throws InitializationException
  +    {
  +        init();
       }
   
       /**
  
  
  
  1.8       +14 -14    jakarta-turbine-2/src/java/org/apache/turbine/services/intake/TurbineIntakeService.java
  
  Index: TurbineIntakeService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/intake/TurbineIntakeService.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TurbineIntakeService.java	3 Jan 2003 07:20:43 -0000	1.7
  +++ TurbineIntakeService.java	4 Jan 2003 04:24:45 -0000	1.8
  @@ -142,19 +142,7 @@
       public void init()
               throws InitializationException
       {
  -        ServletConfig conf = Turbine.getTurbineServletConfig();
  -        init(conf);
  -    }
  -
  -    /**
  -     * Called the first time the Service is used.
  -     *
  -     * @param config A ServletConfig.
  -     * @deprecated use init() instead.
  -     */
  -    public void init(ServletConfig config)
  -            throws InitializationException
  -    {
  +        ServletConfig config = Turbine.getTurbineServletConfig();
           Vector defaultXmlPathes = new Vector();
           defaultXmlPathes.add(XML_PATH_DEFAULT);
   
  @@ -326,6 +314,18 @@
               throw new InitializationException(
                       "TurbineIntakeService failed to initialize", e);
           }
  +    }
  +
  +    /**
  +     * Called the first time the Service is used.
  +     *
  +     * @param config A ServletConfig.
  +     * @deprecated use init() instead.
  +     */
  +    public void init(ServletConfig config)
  +            throws InitializationException
  +    {
  +        init();
       }
   
       /**
  
  
  
  1.7       +21 -22    jakarta-turbine-2/src/java/org/apache/turbine/services/jsp/TurbineJspService.java
  
  Index: TurbineJspService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/jsp/TurbineJspService.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TurbineJspService.java	23 Dec 2002 22:52:27 -0000	1.6
  +++ TurbineJspService.java	4 Jan 2003 04:24:45 -0000	1.7
  @@ -97,12 +97,21 @@
        *
        * @throws InitializationException Something went wrong in the init
        *         stage
  -     */ 
  +     */
       public void init()
           throws InitializationException
       {
  -        ServletConfig conf = Turbine.getTurbineServletConfig();
  -        init(conf);
  +        try
  +        {
  +            initJsp();
  +            registerConfiguration("jsp");
  +            setInit(true);
  +        }
  +        catch (Exception e)
  +        {
  +            throw new InitializationException(
  +                "TurbineJspService failed to initialize", e);
  +        }
       }
   
       /**
  @@ -115,24 +124,14 @@
        */
       public void init(ServletConfig config) throws InitializationException
       {
  -        try
  -        {
  -            initJsp();
  -            registerConfiguration("jsp");
  -            setInit(true);
  -        }
  -        catch (Exception e)
  -        {
  -            throw new InitializationException(
  -                "TurbineJspService failed to initialize", e);
  -        }
  +        init();
       }
   
       /**
        * Adds some convenience objects to the request.  For example an instance
        * of JspLink which can be used to generate links to other templates.
        *
  -     * @param RunData the turbine rundata object
  +     * @param data the turbine rundata object
        */
       public void addDefaultObjects(RunData data)
       {
  @@ -153,8 +152,8 @@
       /**
        * Process the request
        *
  -     * @param RunData
  -     * @param String the filename of the template.
  +     * @param data
  +     * @param filename the filename of the template.
        * @throws TurbineException Any exception trown while processing will be
        *         wrapped into a TurbineException and rethrown.
        */
  @@ -167,9 +166,9 @@
       /**
        * Process the request
        *
  -     * @param RunData
  -     * @param String the filename of the template.
  -     * @param boolean whether to perform a forward or include.
  +     * @param data
  +     * @param filename the filename of the template.
  +     * @param isForward whether to perform a forward or include.
        * @throws TurbineException Any exception trown while processing will be
        *         wrapped into a TurbineException and rethrown.
        */
  @@ -270,7 +269,7 @@
        * so we will use the utility methods provided by
        * the template service to do the searching.
        *
  -     * @param String template
  +     * @param template
        * @return boolean
        */
       public boolean templateExists(String template)
  @@ -283,7 +282,7 @@
        * required by <a href="http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContext.html#getRequestDispatcher(java.lang.String)">
        * javax.servlet.RequestDispatcher</a>
        *
  -     * @param String template
  +     * @param template
        * @return String
        */
   
  
  
  
  1.6       +15 -20    jakarta-turbine-2/src/java/org/apache/turbine/services/schedule/TurbineNonPersistentSchedulerService.java
  
  Index: TurbineNonPersistentSchedulerService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/schedule/TurbineNonPersistentSchedulerService.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TurbineNonPersistentSchedulerService.java	4 Jan 2003 03:56:33 -0000	1.5
  +++ TurbineNonPersistentSchedulerService.java	4 Jan 2003 04:24:45 -0000	1.6
  @@ -117,28 +117,8 @@
        * Initializes the SchedulerService.
        * This is a zero parameter variant which queries the Turbine Servlet
        * for its config.
  -     *
  -     * @throws InitializationException Something went wrong in the init
  -     *         stage
        */
       public void init()
  -        throws InitializationException
  -    {
  -        ServletConfig conf = Turbine.getTurbineServletConfig();
  -        init(conf);
  -    }
  -
  -    /**
  -     * Called the first time the Service is used.<br>
  -     *
  -     * Load all the jobs from cold storage.  Add jobs to the queue
  -     * (sorted in ascending order by runtime) and start the scheduler
  -     * thread.
  -     *
  -     * @param config A ServletConfig.
  -     * @deprecated use init() instead.
  -     */
  -    public void init(ServletConfig config)
       {
           if ( getInit() )
           {
  @@ -200,6 +180,21 @@
           {
               log.error ( "Cannot initialize TurbineNonPersistentSchedulerService!: " + e );
           }
  +    }
  +
  +    /**
  +     * Called the first time the Service is used.<br>
  +     *
  +     * Load all the jobs from cold storage.  Add jobs to the queue
  +     * (sorted in ascending order by runtime) and start the scheduler
  +     * thread.
  +     *
  +     * @param config A ServletConfig.
  +     * @deprecated use init() instead.
  +     */
  +    public void init(ServletConfig config)
  +    {
  +        init();
       }
   
       /**
  
  
  
  1.6       +17 -18    jakarta-turbine-2/src/java/org/apache/turbine/services/schedule/TurbineSchedulerService.java
  
  Index: TurbineSchedulerService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/schedule/TurbineSchedulerService.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TurbineSchedulerService.java	4 Jan 2003 03:56:33 -0000	1.5
  +++ TurbineSchedulerService.java	4 Jan 2003 04:24:45 -0000	1.6
  @@ -113,23 +113,6 @@
       public void init()
           throws InitializationException
       {
  -        ServletConfig conf = Turbine.getTurbineServletConfig();
  -        init(conf);
  -    }
  -
  -    /**
  -     * Called the first time the Service is used.<br>
  -     *
  -     * Load all the jobs from cold storage.  Add jobs to the queue
  -     * (sorted in ascending order by runtime) and start the scheduler
  -     * thread.
  -     *
  -     * @param config A ServletConfig.
  -     * @deprecated use init() instead.
  -     */
  -    public void init(ServletConfig config)
  -        throws InitializationException
  -    {
           try
           {
               // START SCHEDULER HERE
  @@ -159,6 +142,22 @@
           {
               throw new InitializationException("TurbineSchedulerService failed to initialize", e);
           }
  +    }
  +
  +    /**
  +     * Called the first time the Service is used.<br>
  +     *
  +     * Load all the jobs from cold storage.  Add jobs to the queue
  +     * (sorted in ascending order by runtime) and start the scheduler
  +     * thread.
  +     *
  +     * @param config A ServletConfig.
  +     * @deprecated use init() instead.
  +     */
  +    public void init(ServletConfig config)
  +        throws InitializationException
  +    {
  +        init();
       }
   
       /**
  
  
  
  1.8       +13 -14    jakarta-turbine-2/src/java/org/apache/turbine/services/security/BaseSecurityService.java
  
  Index: BaseSecurityService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/security/BaseSecurityService.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- BaseSecurityService.java	4 Jan 2003 03:56:33 -0000	1.7
  +++ BaseSecurityService.java	4 Jan 2003 04:24:45 -0000	1.8
  @@ -189,19 +189,6 @@
       public void init()
           throws InitializationException
       {
  -        ServletConfig conf = Turbine.getTurbineServletConfig();
  -        init(conf);
  -    }
  -
  -    /**
  -     * Initializes the SecurityService, locating the apropriate UserManager
  -     *
  -     * @param config a ServletConfig, to enforce early initialization
  -     * @deprecated use init() instead.
  -     */
  -    public void init(ServletConfig config)
  -        throws InitializationException
  -    {
           String userManagerClassName = getProperties().getProperty(
               SecurityService.USER_MANAGER_KEY,
               SecurityService.USER_MANAGER_DEFAULT);
  @@ -231,6 +218,18 @@
               throw new InitializationException(
                   "BaseSecurityService.init: Failed to instantiate UserManager", e);
           }
  +    }
  +
  +    /**
  +     * Initializes the SecurityService, locating the apropriate UserManager
  +     *
  +     * @param config a ServletConfig, to enforce early initialization
  +     * @deprecated use init() instead.
  +     */
  +    public void init(ServletConfig config)
  +        throws InitializationException
  +    {
  +        init();
       }
   
       /**
  
  
  
  1.7       +14 -19    jakarta-turbine-2/src/java/org/apache/turbine/services/servlet/TurbineServletService.java
  
  Index: TurbineServletService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/servlet/TurbineServletService.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TurbineServletService.java	4 Jan 2003 03:56:34 -0000	1.6
  +++ TurbineServletService.java	4 Jan 2003 04:24:45 -0000	1.7
  @@ -93,29 +93,12 @@
        * Load all configured components and initialize them. This is
        * a zero parameter variant which queries the Turbine Servlet
        * for its config.
  -     *
  -     * @throws InitializationException Something went wrong in the init
  -     *         stage
        */
       public void init()
  -        throws InitializationException
  -    {
  -        ServletConfig conf = Turbine.getTurbineServletConfig();
  -        init(conf);
  -    }
  -
  -    /**
  -     * Called during Turbine.init()
  -     *
  -     * @param servletConfig A ServletConfig.
  -     *
  -     * @deprecated use init() instead.
  -     */
  -    public void init(ServletConfig servletConfig)
       {
  +        this.servletConfig = Turbine.getTurbineServletConfig();
           try
           {
  -            this.servletConfig = servletConfig;
               this.servletContext = servletConfig.getServletContext();
   
               log.debug("[TurbineServletService] Initializing with ServletConfig");
  @@ -126,6 +109,18 @@
               log.error (e);
           }
           setInit(true);
  +    }
  +
  +    /**
  +     * Called during Turbine.init()
  +     *
  +     * @param servletConfig A ServletConfig.
  +     *
  +     * @deprecated use init() instead.
  +     */
  +    public void init(ServletConfig servletConfig)
  +    {
  +        init();
       }
   
       /**
  
  
  
  1.12      +18 -19    jakarta-turbine-2/src/java/org/apache/turbine/services/velocity/TurbineVelocityService.java
  
  Index: TurbineVelocityService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/velocity/TurbineVelocityService.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- TurbineVelocityService.java	23 Dec 2002 22:52:27 -0000	1.11
  +++ TurbineVelocityService.java	4 Jan 2003 04:24:45 -0000	1.12
  @@ -166,24 +166,8 @@
        *
        * @throws InitializationException Something went wrong in the init
        *         stage
  -     */ 
  -    public void init()
  -        throws InitializationException
  -    {
  -        ServletConfig conf = Turbine.getTurbineServletConfig();
  -        init(conf);
  -    }
  -
  -    /**
  -     * Inits the service using servlet parameters to obtain path to the
  -     * configuration file.
  -     *
  -     * @param config The ServletConfiguration from Turbine
  -     *
  -     * @throws InitializationException Something went wrong when starting up.
  -     * @deprecated use init() instead.
        */
  -    public void init(ServletConfig config)
  +    public void init()
           throws InitializationException
       {
           try
  @@ -229,6 +213,21 @@
       }
   
       /**
  +     * Inits the service using servlet parameters to obtain path to the
  +     * configuration file.
  +     *
  +     * @param config The ServletConfiguration from Turbine
  +     *
  +     * @throws InitializationException Something went wrong when starting up.
  +     * @deprecated use init() instead.
  +     */
  +    public void init(ServletConfig config)
  +        throws InitializationException
  +    {
  +        init();
  +    }
  +
  +    /**
        * Create a Context object that also contains the globalContext.
        *
        * @return A Context object.
  @@ -569,7 +568,7 @@
            */
           Configuration configuration = getConfiguration();
   
  -        configuration.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS, 
  +        configuration.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS,
                                     SimpleLog4JLogSystem.class.getName());
           configuration.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM + ".log4j.category",
                                     "velocity");
  
  
  
  1.11      +11 -12    jakarta-turbine-2/src/java/org/apache/turbine/services/xmlrpc/TurbineXmlRpcService.java
  
  Index: TurbineXmlRpcService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/xmlrpc/TurbineXmlRpcService.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TurbineXmlRpcService.java	4 Jan 2003 03:56:34 -0000	1.10
  +++ TurbineXmlRpcService.java	4 Jan 2003 04:24:45 -0000	1.11
  @@ -143,17 +143,6 @@
       public void init()
           throws InitializationException
       {
  -        ServletConfig conf = Turbine.getTurbineServletConfig();
  -        init(conf);
  -    }
  -
  -    /**
  -     * This function initializes the XmlRpcService.
  -     *
  -     * @deprecated Use init() instead.
  -     */
  -    public void init(ServletConfig config) throws InitializationException
  -    {
           try
           {
               server = new XmlRpcServer();
  @@ -287,6 +276,16 @@
           }
   
           setInit(true);
  +    }
  +
  +    /**
  +     * This function initializes the XmlRpcService.
  +     *
  +     * @deprecated Use init() instead.
  +     */
  +    public void init(ServletConfig config) throws InitializationException
  +    {
  +        init();
       }
   
       /**
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>