directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r123283 - in incubator/directory/network/trunk/mina/src: examples/org/apache/mina/examples/echoserver examples/org/apache/mina/examples/reverser java/org/apache/mina/io java/org/apache/mina/io/filter java/org/apache/mina/io/socket java/org/apache/mina/protocol java/org/apache/mina/protocol/filter java/org/apache/mina/util
Date Fri, 24 Dec 2004 07:13:24 GMT
Author: trustin
Date: Thu Dec 23 23:13:24 2004
New Revision: 123283

URL: http://svn.apache.org/viewcvs?view=rev&rev=123283
Log:
Reformatted source code
Modified:
   incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java
   incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/ExceptionMonitor.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoSession.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/IoThreadPoolFilter.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketAcceptor.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoder.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoder.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoderOutput.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/filter/ProtocolThreadPoolFilter.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Stack.java

Modified: incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java?view=diff&rev=123283&p1=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java&r1=123282&p2=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java&r2=123283
==============================================================================
--- incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java
(original)
+++ incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java
Thu Dec 23 23:13:24 2004
@@ -61,20 +61,19 @@
     {
         synchronized( rb )
         {
-            ByteBuffer wb = ByteBuffer.allocate(rb.remaining());
-            wb.put(rb);
+            ByteBuffer wb = ByteBuffer.allocate( rb.remaining() );
+            wb.put( rb );
             wb.flip();
             System.out.println( Thread.currentThread().getName() + ' '
-                                + session.getRemoteAddress()
-                                + ": READ (" + wb.remaining() + "B)" );
-            session.write(wb, null);
+                                + session.getRemoteAddress() + ": READ ("
+                                + wb.remaining() + "B)" );
+            session.write( wb, null );
         }
     }
 
     public void dataWritten( IoSession IoSession, Object marker )
     {
         System.out.println( Thread.currentThread().getName() + ' '
-                            + IoSession.getRemoteAddress()
-                            + ": WRITTEN" );
+                            + IoSession.getRemoteAddress() + ": WRITTEN" );
     }
 }

Modified: incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java?view=diff&rev=123283&p1=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java&r1=123282&p2=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java&r2=123283
==============================================================================
--- incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java
(original)
+++ incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java
Thu Dec 23 23:13:24 2004
@@ -63,4 +63,4 @@
 
         return null;
     }
-}
+}
\ No newline at end of file

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/ExceptionMonitor.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/ExceptionMonitor.java?view=diff&rev=123283&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/ExceptionMonitor.java&r1=123282&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/ExceptionMonitor.java&r2=123283
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/ExceptionMonitor.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/ExceptionMonitor.java
Thu Dec 23 23:13:24 2004
@@ -26,5 +26,5 @@
  */
 public interface ExceptionMonitor
 {
-    void exceptionCaught(Object source, Throwable cause);
-}
+    void exceptionCaught( Object source, Throwable cause );
+}
\ No newline at end of file

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoSession.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoSession.java?view=diff&rev=123283&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoSession.java&r1=123282&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoSession.java&r2=123283
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoSession.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoSession.java	Thu
Dec 23 23:13:24 2004
@@ -35,12 +35,12 @@
     IoHandler getHandler();
 
     void close();
-    
-    void write(ByteBuffer buf, Object marker);
 
-    void write(byte[] buf, Object marker);
+    void write( ByteBuffer buf, Object marker );
 
-    void write(byte[] buf, int offset, int length, Object marker);
+    void write( byte[] buf, Object marker );
+
+    void write( byte[] buf, int offset, int length, Object marker );
 
     Object getAttachment();
 

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java?view=diff&rev=123283&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java&r1=123282&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java&r2=123283
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java
Thu Dec 23 23:13:24 2004
@@ -49,7 +49,8 @@
         blacklist.remove( address );
     }
 
-    public void dataRead( IoHandler nextHandler, IoSession session, ByteBuffer buf )
+    public void dataRead( IoHandler nextHandler, IoSession session,
+                         ByteBuffer buf )
     {
         if( isBlocked( session ) )
         {

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/IoThreadPoolFilter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/IoThreadPoolFilter.java?view=diff&rev=123283&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/IoThreadPoolFilter.java&r1=123282&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/IoThreadPoolFilter.java&r2=123283
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/IoThreadPoolFilter.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/IoThreadPoolFilter.java
Thu Dec 23 23:13:24 2004
@@ -165,12 +165,14 @@
         fireEvent( nextHandler, session, EventType.EXCEPTION, cause );
     }
 
-    public void dataRead( IoHandler nextHandler, IoSession session, ByteBuffer buf )
+    public void dataRead( IoHandler nextHandler, IoSession session,
+                         ByteBuffer buf )
     {
         fireEvent( nextHandler, session, EventType.READ, buf );
     }
 
-    public void dataWritten( IoHandler nextHandler, IoSession session, Object marker )
+    public void dataWritten( IoHandler nextHandler, IoSession session,
+                            Object marker )
     {
         fireEvent( nextHandler, session, EventType.WRITTEN, marker );
     }
@@ -287,7 +289,8 @@
                 SessionBuffer buf = fetchBuffer();
                 giveUpLead();
 
-                if( buf == null ) {
+                if( buf == null )
+                {
                     break;
                 }
 
@@ -364,7 +367,7 @@
         {
             if( type == EventType.READ )
             {
-                ByteBuffer buf = (ByteBuffer) data;
+                ByteBuffer buf = ( ByteBuffer ) data;
                 boolean fire;
                 synchronized( buf )
                 {
@@ -450,13 +453,15 @@
                     {
                     }
                 }
-                
+
                 boolean timeToLead = this == leader;
-                
-                if (!timeToLead) {
+
+                if( !timeToLead )
+                {
                     // time to die
-                    synchronized (followers) {
-                        followers.remove(this);
+                    synchronized( followers )
+                    {
+                        followers.remove( this );
                     }
                 }
 

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketAcceptor.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketAcceptor.java?view=diff&rev=123283&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketAcceptor.java&r1=123282&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketAcceptor.java&r2=123283
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketAcceptor.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketAcceptor.java
Thu Dec 23 23:13:24 2004
@@ -204,10 +204,10 @@
                             continue;
 
                         SocketSession session = new SocketSession(
-                                                             filterManager,
-                                                             ch,
-                                                             ( IoHandler ) key
-                                                                     .attachment() );
+                                                                   filterManager,
+                                                                   ch,
+                                                                   ( IoHandler ) key
+                                                                           .attachment()
);
                         SocketIoProcessor.getInstance().addSession( session );
                     }
                 }

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java?view=diff&rev=123283&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java&r1=123282&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java&r2=123283
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
Thu Dec 23 23:13:24 2004
@@ -238,7 +238,7 @@
 
             synchronized( buf )
             {
-                if (buf.hasRemaining())
+                if( buf.hasRemaining() )
                     buf.compact();
                 else
                     buf.clear();
@@ -383,28 +383,32 @@
 
         Queue writeBufferQueue = session.getWriteBufferQueue();
         Queue writeMarkerQueue = session.getWriteMarkerQueue();
-        
+
         ByteBuffer buf;
         Object marker;
-        for ( ;; ) {
-            synchronized (writeBufferQueue) {
-                buf = (ByteBuffer) writeBufferQueue.first();
+        for( ;; )
+        {
+            synchronized( writeBufferQueue )
+            {
+                buf = ( ByteBuffer ) writeBufferQueue.first();
                 marker = writeMarkerQueue.first();
             }
-            
-            if (buf == null)
+
+            if( buf == null )
                 break;
-            
-            if (buf.remaining() == 0) {
-                synchronized (writeBufferQueue) {
+
+            if( buf.remaining() == 0 )
+            {
+                synchronized( writeBufferQueue )
+                {
                     writeBufferQueue.pop();
                     writeMarkerQueue.pop();
                 }
-                
-                session.getFilterManager().fireDataWritten(session, marker);
+
+                session.getFilterManager().fireDataWritten( session, marker );
                 continue;
             }
-            
+
             try
             {
                 ch.write( buf );
@@ -415,8 +419,9 @@
                 if( buf.hasRemaining() )
                 {
                     // Kernel buffer is full
-                    key.interestOps( key.interestOps()
-                                     | SelectionKey.OP_WRITE );
+                    key
+                            .interestOps( key.interestOps()
+                                          | SelectionKey.OP_WRITE );
                 }
                 else
                 {

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java?view=diff&rev=123283&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java&r1=123282&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java&r2=123283
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java
Thu Dec 23 23:13:24 2004
@@ -112,11 +112,13 @@
             Object result;
             try
             {
-                for ( ;; ) {
+                for( ;; )
+                {
                     result = null;
                     synchronized( in )
                     {
-                        if (in.hasRemaining()) {
+                        if( in.hasRemaining() )
+                        {
                             result = decoder.decode( psession, in );
                         }
                     }
@@ -129,7 +131,7 @@
                     else
                     {
                         filterManager.fireMessageReceived( psession, result );
-                    } 
+                    }
                 }
             }
             catch( Throwable t )

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoder.java?view=diff&rev=123283&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoder.java&r1=123282&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoder.java&r2=123283
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoder.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoder.java
Thu Dec 23 23:13:24 2004
@@ -20,7 +20,6 @@
 
 import java.nio.ByteBuffer;
 
-
 /**
  * TODO Insert type comment.
  * 

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoder.java?view=diff&rev=123283&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoder.java&r1=123282&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoder.java&r2=123283
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoder.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoder.java
Thu Dec 23 23:13:24 2004
@@ -18,7 +18,6 @@
  */
 package org.apache.mina.protocol;
 
-
 /**
  * TODO Insert type comment.
  * 

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoderOutput.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoderOutput.java?view=diff&rev=123283&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoderOutput.java&r1=123282&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoderOutput.java&r2=123283
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoderOutput.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoderOutput.java
Thu Dec 23 23:13:24 2004
@@ -28,7 +28,9 @@
  */
 public interface ProtocolEncoderOutput
 {
-    void write(ByteBuffer buf);
-    void write(byte[] buf);
-    void write(byte[] buf, int offset, int length);
-}
+    void write( ByteBuffer buf );
+
+    void write( byte[] buf );
+
+    void write( byte[] buf, int offset, int length );
+}
\ No newline at end of file

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/filter/ProtocolThreadPoolFilter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/filter/ProtocolThreadPoolFilter.java?view=diff&rev=123283&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/filter/ProtocolThreadPoolFilter.java&r1=123282&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/filter/ProtocolThreadPoolFilter.java&r2=123283
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/filter/ProtocolThreadPoolFilter.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/filter/ProtocolThreadPoolFilter.java
Thu Dec 23 23:13:24 2004
@@ -445,11 +445,13 @@
                 }
 
                 boolean timeToLead = this == leader;
-                
-                if (!timeToLead) {
+
+                if( !timeToLead )
+                {
                     // time to die
-                    synchronized (followers) {
-                        followers.remove(this);
+                    synchronized( followers )
+                    {
+                        followers.remove( this );
                     }
                 }
 

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Stack.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Stack.java?view=diff&rev=123283&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Stack.java&r1=123282&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Stack.java&r2=123283
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Stack.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Stack.java	Thu Dec
23 23:13:24 2004
@@ -91,13 +91,16 @@
         items[ size ] = obj;
         size++;
     }
-    
-    public void remove( Object o ) {
-        for ( int i = size - 1; i >= 0; i-- ) {
-            if (items[i] == o) {
-                System.arraycopy(items, i + 1, items, i, size - i - 1);
-                items[size - 1] = null;
-                size --;
+
+    public void remove( Object o )
+    {
+        for( int i = size - 1; i >= 0; i-- )
+        {
+            if( items[ i ] == o )
+            {
+                System.arraycopy( items, i + 1, items, i, size - i - 1 );
+                items[ size - 1 ] = null;
+                size--;
                 break;
             }
         }

Mime
View raw message