You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by jv...@apache.org on 2001/12/08 16:17:17 UTC

cvs commit: jakarta-turbine-fulcrum/src/core/java/org/apache/fulcrum BaseServiceBroker.java

jvanzyl     01/12/08 07:17:17

  Modified:    src/core/java/org/apache/fulcrum BaseServiceBroker.java
  Log:
  - applying patch by Kelvin Tan that fixes the defective shutdown mechanism
    in the base service broker.
  
  Revision  Changes    Path
  1.11      +16 -5     jakarta-turbine-fulcrum/src/core/java/org/apache/fulcrum/BaseServiceBroker.java
  
  Index: BaseServiceBroker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-fulcrum/src/core/java/org/apache/fulcrum/BaseServiceBroker.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- BaseServiceBroker.java	2001/10/02 15:09:11	1.10
  +++ BaseServiceBroker.java	2001/12/08 15:17:16	1.11
  @@ -93,7 +93,7 @@
    * @author <a href="mailto:krzewski@e-point.pl">Rafal Krzewski</a>
    * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
    * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
  - * @version $Id: BaseServiceBroker.java,v 1.10 2001/10/02 15:09:11 dlr Exp $
  + * @version $Id: BaseServiceBroker.java,v 1.11 2001/12/08 15:17:16 jvanzyl Exp $
    */
   public abstract class BaseServiceBroker 
       implements ServiceBroker
  @@ -563,11 +563,22 @@
        */
       public synchronized void shutdownService(String name)
       {
  -        String className = (String) mapping.get(name);
  -
  -        if (className != null)
  +        try
           {
  -            shutdownClass(className);
  +            Service service = getServiceInstance(name);
  +            if (service.isInitialized())
  +            {
  +                service.shutdown();
  +                ((BaseService) service).setInit(false);
  +            }
  +        }
  +        catch (InstantiationException e)
  +        {
  +            // Shutdown of a nonexistent class was requested.
  +            // This does not hurt anything, so we log the error and continue.
  +            error(new ServiceException(
  +                "Shutdown of a nonexistent service " + name +
  +                    " was requested", e));
           }
       }
   
  
  
  

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