directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r169938 - in /directory/network: branches/api_integration/src/java/org/apache/mina/filter/codec/ trunk/src/java/org/apache/mina/protocol/codec/
Date Fri, 13 May 2005 04:48:26 GMT
Author: trustin
Date: Thu May 12 21:48:26 2005
New Revision: 169938

URL: http://svn.apache.org/viewcvs?rev=169938&view=rev
Log:
Resolved: DIRMINA-37


Added:
    directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageDecoderFactory.java
  (with props)
    directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageEncoderFactory.java
  (with props)
    directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageDecoderFactory.java
  (with props)
    directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageEncoderFactory.java
  (with props)
Modified:
    directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/DemuxingProtocolCodecFactory.java
    directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageDecoder.java
    directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageEncoder.java
    directory/network/trunk/src/java/org/apache/mina/protocol/codec/DemuxingProtocolCodecFactory.java
    directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageDecoder.java
    directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageEncoder.java

Modified: directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/DemuxingProtocolCodecFactory.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/DemuxingProtocolCodecFactory.java?rev=169938&r1=169937&r2=169938&view=diff
==============================================================================
--- directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/DemuxingProtocolCodecFactory.java
(original)
+++ directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/DemuxingProtocolCodecFactory.java
Thu May 12 21:48:26 2005
@@ -18,8 +18,8 @@
  */
 package org.apache.mina.filter.codec;
 
-import java.util.HashMap;
 import java.util.HashSet;
+import java.util.IdentityHashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
@@ -43,12 +43,8 @@
  */
 public class DemuxingProtocolCodecFactory implements ProtocolCodecFactory {
 
-    private MessageDecoder[] decoders = new MessageDecoder[0];
-    private final Map encoders = new HashMap();
-    
-    private final ProtocolEncoder protocolEncoder = new ProtocolEncoderImpl();
-
-    private final ProtocolDecoder protocolDecoder = new ProtocolDecoderImpl();
+    private MessageDecoderFactory[] decoderFactories = new MessageDecoderFactory[0];
+    private MessageEncoderFactory[] encoderFactories = new MessageEncoderFactory[0];
     
     public DemuxingProtocolCodecFactory()
     {
@@ -56,37 +52,67 @@
     
     public void register( MessageEncoder encoder )
     {
-        Iterator it = encoder.getMessageTypes().iterator();
-        while( it.hasNext() )
+        register( new SingletonMessageEncoderFactory( encoder ) );
+    }
+    
+    public void register( MessageEncoderFactory factory )
+    {
+        if( factory == null )
         {
-            Class type = (Class) it.next();
-            encoders.put( type, encoder );
+            throw new NullPointerException( "factory" );
         }
+        MessageEncoderFactory[] encoderFactories = this.encoderFactories;
+        MessageEncoderFactory[] newEncoderFactories = new MessageEncoderFactory[ encoderFactories.length
+ 1 ];
+        System.arraycopy( encoderFactories, 0, newEncoderFactories, 0, encoderFactories.length
);
+        newEncoderFactories[ encoderFactories.length ] = factory;
+        this.encoderFactories = newEncoderFactories;
     }
     
-    public void register( MessageDecoder decoder )
+    public void register( final MessageDecoder decoder )
     {
-        if( decoder == null )
+        register( new SingletonMessageDecoderFactory( decoder ) );
+    }
+    
+    public void register( MessageDecoderFactory factory )
+    {
+        if( factory == null )
         {
-            throw new NullPointerException( "decoder" );
+            throw new NullPointerException( "factory" );
         }
-        MessageDecoder[] decoders = this.decoders;
-        MessageDecoder[] newDecoders = new MessageDecoder[ decoders.length + 1 ];
-        System.arraycopy( decoders, 0, newDecoders, 0, decoders.length );
-        newDecoders[ decoders.length ] = decoder;
-        this.decoders = newDecoders;
+        MessageDecoderFactory[] decoderFactories = this.decoderFactories;
+        MessageDecoderFactory[] newDecoderFactories = new MessageDecoderFactory[ decoderFactories.length
+ 1 ];
+        System.arraycopy( decoderFactories, 0, newDecoderFactories, 0, decoderFactories.length
);
+        newDecoderFactories[ decoderFactories.length ] = factory;
+        this.decoderFactories = newDecoderFactories;
     }
     
     public ProtocolEncoder newEncoder() {
-        return protocolEncoder;
+        return new ProtocolEncoderImpl();
     }
 
     public ProtocolDecoder newDecoder() {
-        return protocolDecoder;
+        return new ProtocolDecoderImpl();
     }
     
     private class ProtocolEncoderImpl implements ProtocolEncoder
     {
+        private final Map encoders = new IdentityHashMap();
+        
+        private ProtocolEncoderImpl()
+        {
+            MessageEncoderFactory[] encoderFactories = DemuxingProtocolCodecFactory.this.encoderFactories;
+            for( int i = encoderFactories.length - 1; i >= 0; i-- )
+            {
+                MessageEncoder encoder = encoderFactories[ i ].newEncoder();
+                Iterator it = encoder.getMessageTypes().iterator();
+                while( it.hasNext() )
+                {
+                    Class type = ( Class ) it.next();
+                    encoders.put( type, encoder );
+                }
+            }
+        }
+        
         public void encode( IoSession session, Object message,
                             ProtocolEncoderOutput out ) throws ProtocolViolationException
         {
@@ -143,11 +169,19 @@
     
     private class ProtocolDecoderImpl extends CumulativeProtocolDecoder
     {
+        private final MessageDecoder[] decoders;
         private MessageDecoder currentDecoder;
 
         protected ProtocolDecoderImpl()
         {
             super( 16 );
+            
+            MessageDecoderFactory[] decoderFactories = DemuxingProtocolCodecFactory.this.decoderFactories;
+            decoders = new MessageDecoder[ decoderFactories.length ];
+            for( int i = decoderFactories.length - 1; i >= 0; i-- )
+            {
+                decoders[ i ] = decoderFactories[ i ].newDecoder();
+            }
         }
 
         protected boolean doDecode( IoSession session, ByteBuffer in,
@@ -155,7 +189,7 @@
         {
             if( currentDecoder == null )
             {
-                MessageDecoder[] decoders = DemuxingProtocolCodecFactory.this.decoders;
+                MessageDecoder[] decoders = this.decoders;
                 int undecodables = 0;
                 for( int i = decoders.length - 1; i >= 0; i -- ) 
                 {
@@ -214,6 +248,44 @@
             {
                 throw new IllegalStateException( "Unexpected decode result (see your decode()):
" + result );
             }
+        }
+    }
+    
+    private static class SingletonMessageEncoderFactory implements MessageEncoderFactory
+    {
+        private final MessageEncoder encoder;
+        
+        private SingletonMessageEncoderFactory( MessageEncoder encoder )
+        {
+            if( encoder == null )
+            {
+                throw new NullPointerException( "encoder" );
+            }
+            this.encoder = encoder;
+        }
+
+        public MessageEncoder newEncoder()
+        {
+            return encoder;
+        }
+    }
+
+    private static class SingletonMessageDecoderFactory implements MessageDecoderFactory
+    {
+        private final MessageDecoder decoder;
+        
+        private SingletonMessageDecoderFactory( MessageDecoder decoder )
+        {
+            if( decoder == null )
+            {
+                throw new NullPointerException( "decoder" );
+            }
+            this.decoder = decoder;
+        }
+
+        public MessageDecoder newDecoder()
+        {
+            return decoder;
         }
     }
 }

Modified: directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageDecoder.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageDecoder.java?rev=169938&r1=169937&r2=169938&view=diff
==============================================================================
--- directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageDecoder.java
(original)
+++ directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageDecoder.java
Thu May 12 21:48:26 2005
@@ -29,6 +29,7 @@
  * @version $Rev$, $Date$
  * 
  * @see DemuxingProtocolCodecFactory
+ * @see MessageDecoderFactory
  */
 public interface MessageDecoder {
     /**

Added: directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageDecoderFactory.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageDecoderFactory.java?rev=169938&view=auto
==============================================================================
--- directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageDecoderFactory.java
(added)
+++ directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageDecoderFactory.java
Thu May 12 21:48:26 2005
@@ -0,0 +1,36 @@
+/*
+ *   @(#) $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.filter.codec;
+
+/**
+ * A factory that creates a new instance of {@link MessageDecoder}.
+ * 
+ * @author The Apache Directory Project (dev@directory.apache.org)
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ * 
+ * @see DemuxingProtocolCodecFactory
+ */
+public interface MessageDecoderFactory
+{
+    /**
+     * Creates a new message decoder.
+     */
+    MessageDecoder newDecoder();
+}

Propchange: directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageDecoderFactory.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageEncoder.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageEncoder.java?rev=169938&r1=169937&r2=169938&view=diff
==============================================================================
--- directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageEncoder.java
(original)
+++ directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageEncoder.java
Thu May 12 21:48:26 2005
@@ -28,6 +28,7 @@
  * @version $Rev$, $Date$
  * 
  * @see DemuxingProtocolCodecFactory
+ * @see MessageEncoderFactory
  */
 public interface MessageEncoder extends ProtocolEncoder
 {  

Added: directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageEncoderFactory.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageEncoderFactory.java?rev=169938&view=auto
==============================================================================
--- directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageEncoderFactory.java
(added)
+++ directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageEncoderFactory.java
Thu May 12 21:48:26 2005
@@ -0,0 +1,36 @@
+/*
+ *   @(#) $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.filter.codec;
+
+/**
+ * A factory that creates a new instance of {@link MessageEncoder}.
+ * 
+ * @author The Apache Directory Project (dev@directory.apache.org)
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ * 
+ * @see DemuxingProtocolCodecFactory
+ */
+public interface MessageEncoderFactory
+{
+    /**
+     * Creates a new message encoder.
+     */
+    MessageEncoder newEncoder();
+}

Propchange: directory/network/branches/api_integration/src/java/org/apache/mina/filter/codec/MessageEncoderFactory.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/network/trunk/src/java/org/apache/mina/protocol/codec/DemuxingProtocolCodecFactory.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/codec/DemuxingProtocolCodecFactory.java?rev=169938&r1=169937&r2=169938&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/codec/DemuxingProtocolCodecFactory.java
(original)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/codec/DemuxingProtocolCodecFactory.java
Thu May 12 21:48:26 2005
@@ -18,8 +18,8 @@
  */
 package org.apache.mina.protocol.codec;
 
-import java.util.HashMap;
 import java.util.HashSet;
+import java.util.IdentityHashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
@@ -49,12 +49,8 @@
  */
 public class DemuxingProtocolCodecFactory implements ProtocolCodecFactory {
 
-    private MessageDecoder[] decoders = new MessageDecoder[0];
-    private final Map encoders = new HashMap();
-    
-    private final ProtocolEncoder protocolEncoder = new ProtocolEncoderImpl();
-
-    private final ProtocolDecoder protocolDecoder = new ProtocolDecoderImpl();
+    private MessageDecoderFactory[] decoderFactories = new MessageDecoderFactory[0];
+    private MessageEncoderFactory[] encoderFactories = new MessageEncoderFactory[0];
     
     public DemuxingProtocolCodecFactory()
     {
@@ -62,37 +58,67 @@
     
     public void register( MessageEncoder encoder )
     {
-        Iterator it = encoder.getMessageTypes().iterator();
-        while( it.hasNext() )
+        register( new SingletonMessageEncoderFactory( encoder ) );
+    }
+    
+    public void register( MessageEncoderFactory factory )
+    {
+        if( factory == null )
         {
-            Class type = (Class) it.next();
-            encoders.put( type, encoder );
+            throw new NullPointerException( "factory" );
         }
+        MessageEncoderFactory[] encoderFactories = this.encoderFactories;
+        MessageEncoderFactory[] newEncoderFactories = new MessageEncoderFactory[ encoderFactories.length
+ 1 ];
+        System.arraycopy( encoderFactories, 0, newEncoderFactories, 0, encoderFactories.length
);
+        newEncoderFactories[ encoderFactories.length ] = factory;
+        this.encoderFactories = newEncoderFactories;
     }
     
-    public void register( MessageDecoder decoder )
+    public void register( final MessageDecoder decoder )
     {
-        if( decoder == null )
+        register( new SingletonMessageDecoderFactory( decoder ) );
+    }
+    
+    public void register( MessageDecoderFactory factory )
+    {
+        if( factory == null )
         {
-            throw new NullPointerException( "decoder" );
+            throw new NullPointerException( "factory" );
         }
-        MessageDecoder[] decoders = this.decoders;
-        MessageDecoder[] newDecoders = new MessageDecoder[ decoders.length + 1 ];
-        System.arraycopy( decoders, 0, newDecoders, 0, decoders.length );
-        newDecoders[ decoders.length ] = decoder;
-        this.decoders = newDecoders;
+        MessageDecoderFactory[] decoderFactories = this.decoderFactories;
+        MessageDecoderFactory[] newDecoderFactories = new MessageDecoderFactory[ decoderFactories.length
+ 1 ];
+        System.arraycopy( decoderFactories, 0, newDecoderFactories, 0, decoderFactories.length
);
+        newDecoderFactories[ decoderFactories.length ] = factory;
+        this.decoderFactories = newDecoderFactories;
     }
     
     public ProtocolEncoder newEncoder() {
-        return protocolEncoder;
+        return new ProtocolEncoderImpl();
     }
 
     public ProtocolDecoder newDecoder() {
-        return protocolDecoder;
+        return new ProtocolDecoderImpl();
     }
     
     private class ProtocolEncoderImpl implements ProtocolEncoder
     {
+        private final Map encoders = new IdentityHashMap();
+        
+        private ProtocolEncoderImpl()
+        {
+            MessageEncoderFactory[] encoderFactories = DemuxingProtocolCodecFactory.this.encoderFactories;
+            for( int i = encoderFactories.length - 1; i >= 0; i-- )
+            {
+                MessageEncoder encoder = encoderFactories[ i ].newEncoder();
+                Iterator it = encoder.getMessageTypes().iterator();
+                while( it.hasNext() )
+                {
+                    Class type = ( Class ) it.next();
+                    encoders.put( type, encoder );
+                }
+            }
+        }
+        
         public void encode( ProtocolSession session, Object message,
                             ProtocolEncoderOutput out ) throws ProtocolViolationException
         {
@@ -149,11 +175,19 @@
     
     private class ProtocolDecoderImpl extends CumulativeProtocolDecoder
     {
+        private final MessageDecoder[] decoders;
         private MessageDecoder currentDecoder;
 
         protected ProtocolDecoderImpl()
         {
             super( 16 );
+            
+            MessageDecoderFactory[] decoderFactories = DemuxingProtocolCodecFactory.this.decoderFactories;
+            decoders = new MessageDecoder[ decoderFactories.length ];
+            for( int i = decoderFactories.length - 1; i >= 0; i-- )
+            {
+                decoders[ i ] = decoderFactories[ i ].newDecoder();
+            }
         }
 
         protected boolean doDecode( ProtocolSession session, ByteBuffer in,
@@ -161,7 +195,7 @@
         {
             if( currentDecoder == null )
             {
-                MessageDecoder[] decoders = DemuxingProtocolCodecFactory.this.decoders;
+                MessageDecoder[] decoders = this.decoders;
                 int undecodables = 0;
                 for( int i = decoders.length - 1; i >= 0; i -- ) 
                 {
@@ -220,6 +254,44 @@
             {
                 throw new IllegalStateException( "Unexpected decode result (see your decode()):
" + result );
             }
+        }
+    }
+    
+    private static class SingletonMessageEncoderFactory implements MessageEncoderFactory
+    {
+        private final MessageEncoder encoder;
+        
+        private SingletonMessageEncoderFactory( MessageEncoder encoder )
+        {
+            if( encoder == null )
+            {
+                throw new NullPointerException( "encoder" );
+            }
+            this.encoder = encoder;
+        }
+
+        public MessageEncoder newEncoder()
+        {
+            return encoder;
+        }
+    }
+
+    private static class SingletonMessageDecoderFactory implements MessageDecoderFactory
+    {
+        private final MessageDecoder decoder;
+        
+        private SingletonMessageDecoderFactory( MessageDecoder decoder )
+        {
+            if( decoder == null )
+            {
+                throw new NullPointerException( "decoder" );
+            }
+            this.decoder = decoder;
+        }
+
+        public MessageDecoder newDecoder()
+        {
+            return decoder;
         }
     }
 }

Modified: directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageDecoder.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageDecoder.java?rev=169938&r1=169937&r2=169938&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageDecoder.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageDecoder.java Thu
May 12 21:48:26 2005
@@ -31,6 +31,7 @@
  * @version $Rev$, $Date$
  * 
  * @see DemuxingProtocolCodecFactory
+ * @see MessageDecoderFactory
  */
 public interface MessageDecoder {
     /**

Added: directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageDecoderFactory.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageDecoderFactory.java?rev=169938&view=auto
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageDecoderFactory.java
(added)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageDecoderFactory.java
Thu May 12 21:48:26 2005
@@ -0,0 +1,36 @@
+/*
+ *   @(#) $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.protocol.codec;
+
+/**
+ * A factory that creates a new instance of {@link MessageDecoder}.
+ * 
+ * @author The Apache Directory Project (dev@directory.apache.org)
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ * 
+ * @see DemuxingProtocolCodecFactory
+ */
+public interface MessageDecoderFactory
+{
+    /**
+     * Creates a new message decoder.
+     */
+    MessageDecoder newDecoder();
+}

Propchange: directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageDecoderFactory.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageEncoder.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageEncoder.java?rev=169938&r1=169937&r2=169938&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageEncoder.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageEncoder.java Thu
May 12 21:48:26 2005
@@ -30,6 +30,7 @@
  * @version $Rev$, $Date$
  * 
  * @see DemuxingProtocolCodecFactory
+ * @see MessageEncoderFactory
  */
 public interface MessageEncoder extends ProtocolEncoder
 {  

Added: directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageEncoderFactory.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageEncoderFactory.java?rev=169938&view=auto
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageEncoderFactory.java
(added)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageEncoderFactory.java
Thu May 12 21:48:26 2005
@@ -0,0 +1,36 @@
+/*
+ *   @(#) $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.protocol.codec;
+
+/**
+ * A factory that creates a new instance of {@link MessageEncoder}.
+ * 
+ * @author The Apache Directory Project (dev@directory.apache.org)
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ * 
+ * @see DemuxingProtocolCodecFactory
+ */
+public interface MessageEncoderFactory
+{
+    /**
+     * Creates a new message encoder.
+     */
+    MessageEncoder newEncoder();
+}

Propchange: directory/network/trunk/src/java/org/apache/mina/protocol/codec/MessageEncoderFactory.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision



Mime
View raw message