psmith      2003/06/22 19:54:43

  Modified:    src/java/org/apache/log4j/net SocketReceiver.java
  Log:
  Changes to back out the addition of the setActive method.
  
  Also implemented the Pauseable interface for this class to test it's
  effects.
  
  Revision  Changes    Path
  1.10      +19 -8     
jakarta-log4j-sandbox/src/java/org/apache/log4j/net/SocketReceiver.java
  
  Index: SocketReceiver.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-log4j-sandbox/src/java/org/apache/log4j/net/SocketReceiver.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SocketReceiver.java       20 Jun 2003 04:52:21 -0000      1.9
  +++ SocketReceiver.java       23 Jun 2003 02:54:43 -0000      1.10
  @@ -50,6 +50,7 @@
   package org.apache.log4j.net;
   
   import org.apache.log4j.helpers.LogLog;
  +import org.apache.log4j.plugins.Pauseable;
   import org.apache.log4j.plugins.Receiver;
   import org.apache.log4j.spi.LoggerRepository;
   
  @@ -78,7 +79,9 @@
     @author Paul Smith <[EMAIL PROTECTED]>
     @since 1.3
   */
  -public class SocketReceiver extends Receiver implements Runnable, PortBased {
  +public class SocketReceiver extends Receiver implements Runnable, PortBased,
  +  Pauseable {
  +  private boolean paused;
     private boolean shutdown;
     private Thread rThread;
     protected int port;
  @@ -138,20 +141,20 @@
         rThread = new Thread(this);
         rThread.setDaemon(true);
         rThread.start();
  -      setActive(true);
  +      active = true;
         setShutdown(false);
       }
     }
   
     /**
  -   * Called when the receiver should be stopped. Closes the 
  -   * server socket and all of the open sockets. 
  +   * Called when the receiver should be stopped. Closes the
  +   * server socket and all of the open sockets.
      */
     public synchronized void shutdown() {
       LogLog.debug(getName() + " received shutdown request");
   
       // mark this as no longer running
  -    setActive(false);
  +    active = false;
   
       if (rThread != null) {
         rThread.interrupt();
  @@ -166,7 +169,7 @@
      * and any connected sockets that have been created.
      */
     private void doShutdown() {
  -    setActive(false);
  +    active = false;
   
       LogLog.debug(getName() + " doShutdown called");
   
  @@ -228,7 +231,7 @@
         LogLog.error(
           "error starting SocketReceiver (" + this.getName()
           + "), receiver did not start", e);
  -      setActive(false);
  +      active = false;
         setShutdown(true);
   
         return;
  @@ -239,7 +242,7 @@
       try {
         LogLog.debug("in run-about to enter while not interrupted loop");
   
  -      setActive(true);
  +      active = true;
   
         while (!rThread.isInterrupted()) {
           // if we have a socket, start watching it
  @@ -365,6 +368,14 @@
      */
     private void setShutdown(boolean b) {
       shutdown = b;
  +  }
  +
  +  public boolean isPaused() {
  +    return paused;
  +  }
  +
  +  public void setPaused(boolean b) {
  +    paused = b;
     }
   
     public static class SocketDetail implements AddressBased, PortBased {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to