cvs commit: spice/components/netserve/src/java/org/jcomponent/netserve/connection/handlers AbstractRequestHandler.java

Peter Donald <[email protected]>
Newsgroups gmane.comp.java.spice.cvs
Message-ID <[email protected]>
donaldp     03/10/28 19:11:56

  Modified:    components/netserve/src/java/org/jcomponent/netserve/connection/handlers
                        AbstractRequestHandler.java
  Log:
  Mark object with flag indicating shutdown
  
  Revision  Changes    Path
  1.6       +25 -1     spice/components/netserve/src/java/org/jcomponent/netserve/connection/handlers/AbstractRequestHandler.java
  
  Index: AbstractRequestHandler.java
  ===================================================================
  RCS file: /cvsroot/spice/spice/components/netserve/src/java/org/jcomponent/netserve/connection/handlers/AbstractRequestHandler.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractRequestHandler.java	28 Oct 2003 06:28:54 -0000	1.5
  +++ AbstractRequestHandler.java	29 Oct 2003 03:11:56 -0000	1.6
  @@ -17,7 +17,7 @@
    * Abstract base class for request handlers.
    *
    * @author <a href="mailto:peter at realityforge.org">Peter Donald</a>
  - * @version $Revision: 1.5 $ $Date: 2003/10/28 06:28:54 $
  + * @version $Revision: 1.6 $ $Date: 2003/10/29 03:11:56 $
    */
   public abstract class AbstractRequestHandler
       implements RequestHandler
  @@ -28,6 +28,11 @@
       private final Set m_activeRequests = new HashSet();
   
       /**
  +     * True if shutdown() has been called.
  +     */
  +    private boolean m_shutdown;
  +
  +    /**
        * Handle a connection.
        *
        * @param socket the socket
  @@ -42,6 +47,7 @@
        */
       public void shutdown( final long timeout )
       {
  +        markAsShutdown();
           final Thread[] threads;
           synchronized( this )
           {
  @@ -74,6 +80,24 @@
                   }
               }
           }
  +    }
  +
  +    /**
  +     * Mark request handler as shutdown.
  +     */
  +    protected void markAsShutdown()
  +    {
  +        m_shutdown = true;
  +    }
  +
  +    /**
  +     * Return true if handler has been shutdown.
  +     *
  +     * @return true if handler has been shutdown.
  +     */
  +    protected boolean isShutdown()
  +    {
  +        return m_shutdown;
       }
   
       /**
  
  
  


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.