directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r122630 - /incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolProvider.java
Date Fri, 17 Dec 2004 08:16:32 GMT
Author: trustin
Date: Fri Dec 17 00:16:29 2004
New Revision: 122630

URL: http://svn.apache.org/viewcvs?view=rev&rev=122630
Log:
 * Made codec factory singleton.
Modified:
   incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolProvider.java

Modified: incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolProvider.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolProvider.java?view=diff&rev=122630&p1=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolProvider.java&r1=122629&p2=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolProvider.java&r2=122630
==============================================================================
--- incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolProvider.java
(original)
+++ incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolProvider.java
Fri Dec 17 00:16:29 2004
@@ -34,21 +34,23 @@
 {
 
     private static ProtocolHandler HANDLER = new ReverseProtocolHandler();
+    
+    private static ProtocolCodecFactory CODEC_FACTORY = new ProtocolCodecFactory()
+    {
+        public ProtocolEncoder newEncoder()
+        {
+            return new TextLineEncoder();
+        }
+        
+        public ProtocolDecoder newDecoder()
+        {
+            return new TextLineDecoder();
+        }
+    };
 
     public ProtocolCodecFactory getCodecFactory()
     {
-        return new ProtocolCodecFactory()
-        {
-            public ProtocolEncoder newEncoder()
-            {
-                return new TextLineEncoder();
-            }
-            
-            public ProtocolDecoder newDecoder()
-            {
-                return new TextLineDecoder();
-            }
-        };
+        return CODEC_FACTORY;
     }
 
     public ProtocolHandler getHandler()

Mime
View raw message