directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r208715 - in /directory/network: branches/0.7/src/java/org/apache/mina/io/datagram/ branches/0.7/src/java/org/apache/mina/io/socket/ branches/0.7/src/java/org/apache/mina/util/ trunk/src/java/org/apache/mina/transport/socket/nio/ trunk/src/...
Date Fri, 01 Jul 2005 05:09:59 GMT
Author: trustin
Date: Thu Jun 30 22:09:58 2005
New Revision: 208715

URL: http://svn.apache.org/viewcvs?rev=208715&view=rev
Log:
Fix for DIRMINA-65
* Modified SessionManagerFilterChain implementations to wake up selectors only when write
request queue is empty.

Fix for DIRMINA-71
* Added prefix to log message.


Modified:
    directory/network/branches/0.7/src/java/org/apache/mina/io/datagram/DatagramSessionManagerFilterChain.java
    directory/network/branches/0.7/src/java/org/apache/mina/io/socket/SocketSessionManagerFilterChain.java
    directory/network/branches/0.7/src/java/org/apache/mina/util/SessionLog.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramSessionManagerFilterChain.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketSessionManagerFilterChain.java
    directory/network/trunk/src/java/org/apache/mina/util/SessionLog.java

Modified: directory/network/branches/0.7/src/java/org/apache/mina/io/datagram/DatagramSessionManagerFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/0.7/src/java/org/apache/mina/io/datagram/DatagramSessionManagerFilterChain.java?rev=208715&r1=208714&r2=208715&view=diff
==============================================================================
--- directory/network/branches/0.7/src/java/org/apache/mina/io/datagram/DatagramSessionManagerFilterChain.java
(original)
+++ directory/network/branches/0.7/src/java/org/apache/mina/io/datagram/DatagramSessionManagerFilterChain.java
Thu Jun 30 22:09:58 2005
@@ -28,8 +28,11 @@
         {
             writeBufferQueue.push( buf );
             writeMarkerQueue.push( marker );
+            if( writeBufferQueue.size() == 1 )
+            {
+                // Notify DatagramSessionManager only when writeBufferQueue was empty.
+                ( ( DatagramSessionManager ) getManager() ).flushSession( s );
+            }
         }
-
-        ( ( DatagramSessionManager ) getManager() ).flushSession( s );
     }
 }

Modified: directory/network/branches/0.7/src/java/org/apache/mina/io/socket/SocketSessionManagerFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/0.7/src/java/org/apache/mina/io/socket/SocketSessionManagerFilterChain.java?rev=208715&r1=208714&r2=208715&view=diff
==============================================================================
--- directory/network/branches/0.7/src/java/org/apache/mina/io/socket/SocketSessionManagerFilterChain.java
(original)
+++ directory/network/branches/0.7/src/java/org/apache/mina/io/socket/SocketSessionManagerFilterChain.java
Thu Jun 30 22:09:58 2005
@@ -29,8 +29,11 @@
         {
             writeBufferQueue.push( buf );
             writeMarkerQueue.push( marker );
+            if( writeBufferQueue.size() == 1 )
+            {
+                // Notify SocketIoProcessor only when writeBufferQueue was empty.
+                SocketIoProcessor.getInstance().flushSession( s );
+            }
         }
-
-        SocketIoProcessor.getInstance().flushSession( s );
     }
 }

Modified: directory/network/branches/0.7/src/java/org/apache/mina/util/SessionLog.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/0.7/src/java/org/apache/mina/util/SessionLog.java?rev=208715&r1=208714&r2=208715&view=diff
==============================================================================
--- directory/network/branches/0.7/src/java/org/apache/mina/util/SessionLog.java (original)
+++ directory/network/branches/0.7/src/java/org/apache/mina/util/SessionLog.java Thu Jun 30
22:09:58 2005
@@ -1,3 +1,21 @@
+/*
+ *   @(#) $Id$
+ *
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
 package org.apache.mina.util;
 
 import java.util.logging.Level;
@@ -63,7 +81,7 @@
         Logger log = getLogger( session );
         if( log.isLoggable( level ) )
         {
-            log.log( level, message );
+            log.log( level, String.valueOf( session.getAttribute( PREFIX ) ) + message );
         }
     }
 
@@ -72,7 +90,7 @@
         Logger log = getLogger( session );
         if( log.isLoggable( level ) )
         {
-            log.log( level, message, cause );
+            log.log( level, String.valueOf( session.getAttribute( PREFIX ) ) + message, cause
);
         }
     }
 }

Modified: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramSessionManagerFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramSessionManagerFilterChain.java?rev=208715&r1=208714&r2=208715&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramSessionManagerFilterChain.java
(original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramSessionManagerFilterChain.java
Thu Jun 30 22:09:58 2005
@@ -26,8 +26,11 @@
         synchronized( writeRequestQueue )
         {
             writeRequestQueue.push( writeRequest );
+            if( writeRequestQueue.size() == 1 )
+            {
+                // Notify DatagramSessionManager only when writeRequestQueue was empty.
+                ( ( DatagramSessionManager ) getManager() ).flushSession( s );
+            }
         }
-
-        ( ( DatagramSessionManager ) getManager() ).flushSession( s );
     }
 }

Modified: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketSessionManagerFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketSessionManagerFilterChain.java?rev=208715&r1=208714&r2=208715&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketSessionManagerFilterChain.java
(original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketSessionManagerFilterChain.java
Thu Jun 30 22:09:58 2005
@@ -29,8 +29,11 @@
         synchronized( writeRequestQueue )
         {
             writeRequestQueue.push( writeRequest );
+            if( writeRequestQueue.size() == 1 )
+            {
+                // Notify SocketIoProcessor only when writeRequestQueue was empty.
+                SocketIoProcessor.getInstance().flushSession( s );
+            }
         }
-
-        SocketIoProcessor.getInstance().flushSession( s );
     }
 }

Modified: directory/network/trunk/src/java/org/apache/mina/util/SessionLog.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/util/SessionLog.java?rev=208715&r1=208714&r2=208715&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/util/SessionLog.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/util/SessionLog.java Thu Jun 30 22:09:58
2005
@@ -1,3 +1,21 @@
+/*
+ *   @(#) $Id$
+ *
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
 package org.apache.mina.util;
 
 import java.util.logging.Level;
@@ -58,7 +76,7 @@
         Logger log = getLogger( session );
         if( log.isLoggable( level ) )
         {
-            log.log( level, message );
+            log.log( level, String.valueOf( session.getAttribute( PREFIX ) ) + message );
         }
     }
 
@@ -67,7 +85,7 @@
         Logger log = getLogger( session );
         if( log.isLoggable( level ) )
         {
-            log.log( level, message, cause );
+            log.log( level, String.valueOf( session.getAttribute( PREFIX ) ) + message, cause
);
         }
     }
 }



Mime
View raw message