logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r966516 - in /logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net: MulticastReceiver.java UDPReceiver.java XMLSocketReceiver.java
Date Thu, 22 Jul 2010 06:44:06 GMT
Author: sdeboy
Date: Thu Jul 22 06:44:06 2010
New Revision: 966516

URL: http://svn.apache.org/viewvc?rev=966516&view=rev
Log:
Update receivers to set the 'active' member on activateoptions & shutdown

Modified:
    logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/MulticastReceiver.java
    logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/UDPReceiver.java
    logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/XMLSocketReceiver.java

Modified: logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/MulticastReceiver.java
URL: http://svn.apache.org/viewvc/logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/MulticastReceiver.java?rev=966516&r1=966515&r2=966516&view=diff
==============================================================================
--- logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/MulticastReceiver.java
(original)
+++ logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/MulticastReceiver.java
Thu Jul 22 06:44:06 2010
@@ -44,7 +44,6 @@ import org.apache.log4j.spi.LoggingEvent
 public class MulticastReceiver extends Receiver implements PortBased,
   AddressBased, Pauseable {
   private static final int PACKET_LENGTH = 16384;
-  private boolean isActive = false;
   private int port;
   private String address;
   private String encoding;
@@ -100,7 +99,7 @@ public class MulticastReceiver extends R
   }
 
   public synchronized void shutdown() {
-    isActive = false;
+    active = false;
     if (advertiseViaMulticastDNS) {
         zeroConf.unadvertise();
     }
@@ -152,7 +151,7 @@ public class MulticastReceiver extends R
     }
 
     try {
-      isActive = true;
+      active = true;
       socket = new MulticastSocket(port);
       socket.joinGroup(addr);
       receiverThread = new MulticastReceiverThread();
@@ -246,12 +245,12 @@ public class MulticastReceiver extends R
     }
 
     public void run() {
-      isActive = true;
+      active = true;
 
       byte[] b = new byte[PACKET_LENGTH];
       DatagramPacket p = new DatagramPacket(b, b.length);
 
-      while (isActive) {
+      while (active) {
         try {
           socket.receive(p);
 

Modified: logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/UDPReceiver.java
URL: http://svn.apache.org/viewvc/logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/UDPReceiver.java?rev=966516&r1=966515&r2=966516&view=diff
==============================================================================
--- logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/UDPReceiver.java
(original)
+++ logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/UDPReceiver.java
Thu Jul 22 06:44:06 2010
@@ -112,6 +112,7 @@ public class UDPReceiver extends Receive
       return;
     }
     closed = true;
+    active = false;
     // Closing the datagram socket will unblock the UDPReceiverThread if it is
     // was waiting to receive data from the socket.
     if (socket != null) {
@@ -166,7 +167,7 @@ public class UDPReceiver extends Receive
         zeroConf = new ZeroConfSupport(ZONE, port, getName());
         zeroConf.advertise();
       }
-
+      active = true;
     } catch (IOException ioe) {
       ioe.printStackTrace();
     }

Modified: logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/XMLSocketReceiver.java
URL: http://svn.apache.org/viewvc/logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/XMLSocketReceiver.java?rev=966516&r1=966515&r2=966516&view=diff
==============================================================================
--- logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/XMLSocketReceiver.java
(original)
+++ logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/net/XMLSocketReceiver.java
Thu Jul 22 06:44:06 2010
@@ -51,7 +51,6 @@ import org.apache.log4j.spi.LoggingEvent
 
 */
 public class XMLSocketReceiver extends Receiver implements Runnable, PortBased, Pauseable
{
-  protected boolean active = false;
   private boolean paused;
   //default to log4j xml decoder
   protected String decoder = "org.apache.log4j.xml.XMLDecoder";



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message