You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by jv...@apache.org on 2012/11/22 22:56:12 UTC

svn commit: r1412687 - in /mina/mina/trunk: core/src/main/java/org/apache/mina/api/ core/src/main/java/org/apache/mina/service/ core/src/main/java/org/apache/mina/session/ examples/src/main/java/org/apache/mina/examples/http/ examples/src/main/java/org...

Author: jvermillard
Date: Thu Nov 22 21:56:09 2012
New Revision: 1412687

URL: http://svn.apache.org/viewvc?rev=1412687&view=rev
Log:
removed dead class and cleared some warning

Removed:
    mina/mina/trunk/core/src/main/java/org/apache/mina/service/OneThreadSelectorStrategy.java
    mina/mina/trunk/core/src/main/java/org/apache/mina/service/SelectorProcessor.java
    mina/mina/trunk/core/src/main/java/org/apache/mina/service/SelectorStrategy.java
    mina/mina/trunk/http/src/main/java/org/apache/mina/http/HttpServerDescriptor.java
Modified:
    mina/mina/trunk/core/src/main/java/org/apache/mina/api/IoSession.java
    mina/mina/trunk/core/src/main/java/org/apache/mina/session/AbstractIoSession.java
    mina/mina/trunk/examples/src/main/java/org/apache/mina/examples/http/HttpTest.java
    mina/mina/trunk/examples/src/main/java/org/apache/mina/examples/http/HttpsTest.java
    mina/mina/trunk/examples/src/main/java/org/apache/mina/examples/ldap/LdapTest.java
    mina/mina/trunk/http/src/main/java/org/apache/mina/http/HttpServerCodec.java

Modified: mina/mina/trunk/core/src/main/java/org/apache/mina/api/IoSession.java
URL: http://svn.apache.org/viewvc/mina/mina/trunk/core/src/main/java/org/apache/mina/api/IoSession.java?rev=1412687&r1=1412686&r2=1412687&view=diff
==============================================================================
--- mina/mina/trunk/core/src/main/java/org/apache/mina/api/IoSession.java (original)
+++ mina/mina/trunk/core/src/main/java/org/apache/mina/api/IoSession.java Thu Nov 22 21:56:09 2012
@@ -27,10 +27,10 @@ import java.util.Set;
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLException;
 
-import org.apache.mina.service.SelectorProcessor;
 import org.apache.mina.session.AttributeKey;
 import org.apache.mina.session.SslHelper;
 import org.apache.mina.session.WriteRequest;
+import org.apache.mina.transport.nio.SelectorLoop;
 
 /**
  * A handle which represents a connection between two end-points regardless of transport types.
@@ -133,20 +133,20 @@ public interface IoSession {
     boolean isSecured();
 
     /**
-     * Changes the session's state from the current state to a new state. Not all the
-     * transition are allowed. Here is the list of all the possible transitions :<br/>
+     * Changes the session's state from the current state to a new state. Not all the transition are allowed. Here is
+     * the list of all the possible transitions :<br/>
      * <ul>
-     *   <li>CREATED   -> CONNECTED</li>
-     *   <li>CREATED   -> SECURING</li>
-     *   <li>CREATED   -> CLOSING</li>
-     *   <li>CONNECTED -> SECURING</li>
-     *   <li>CONNECTED -> CLOSING</li>
-     *   <li>SECURING  -> SECURED</li>
-     *   <li>SECURING  -> CLOSING</li>
-     *   <li>SECURED   -> CONNECTED</li>
-     *   <li>SECURED   -> SECURING</li>
-     *   <li>SECURED   -> CLOSING</li>
-     *   <li>CLOSING   -> CLOSED</li>
+     * <li>CREATED -> CONNECTED</li>
+     * <li>CREATED -> SECURING</li>
+     * <li>CREATED -> CLOSING</li>
+     * <li>CONNECTED -> SECURING</li>
+     * <li>CONNECTED -> CLOSING</li>
+     * <li>SECURING -> SECURED</li>
+     * <li>SECURING -> CLOSING</li>
+     * <li>SECURED -> CONNECTED</li>
+     * <li>SECURED -> SECURING</li>
+     * <li>SECURED -> CLOSING</li>
+     * <li>CLOSING -> CLOSED</li>
      * </ul>
      * 
      * @param newState The final SessionState
@@ -268,59 +268,48 @@ public interface IoSession {
     /* Session context management */
 
     /**
-     * Returns the value of the user-defined attribute for the given
-     * <code>key</code>.If the there is no attribute with the specified key the <tt>defaultValue</tt> will be returned.
+     * Returns the value of the user-defined attribute for the given <code>key</code>.If the there is no attribute with
+     * the specified key the <tt>defaultValue</tt> will be returned.
      * 
-     * @param key
-     *            the attribute's key, must not be <code>null</code>
+     * @param key the attribute's key, must not be <code>null</code>
      * @return <tt>defaultValue</tt> if there is no attribute with the specified key
-     * @exception IllegalArgumentException
-     *                if <code>key==null</code>
+     * @exception IllegalArgumentException if <code>key==null</code>
      * @see #setAttribute(AttributeKey, Object)
      */
     <T> T getAttribute(AttributeKey<T> key, T defaultValue);
 
     /**
-     * Returns the value of the user-defined attribute for the given
-     * <code>key</code>.If the there is no attribute with the specified key <code>null</code> will be returned.
+     * Returns the value of the user-defined attribute for the given <code>key</code>.If the there is no attribute with
+     * the specified key <code>null</code> will be returned.
      * 
-     * @param key
-     *            the attribute's key, must not be <code>null</code>
+     * @param key the attribute's key, must not be <code>null</code>
      * @return <code>null</code> if there is no attribute with the specified key
-     * @exception IllegalArgumentException
-     *                if <code>key==null</code>
+     * @exception IllegalArgumentException if <code>key==null</code>
      * @see #setAttribute(AttributeKey, Object)
      */
     <T> T getAttribute(AttributeKey<T> key);
 
     /**
-     * Sets a user-defined attribute. If the <code>value</code> is
-     * <code>null</code> the attribute will be removed from this
-     * {@link IoSession}.
-     * 
-     * @param key
-     *            the attribute's key, must not be <code>null</code>
-     * @param value
-     *            the attribute's value, <code>null</code> to remove the
-     *            attribute
-     * @return the old attribute's value or <code>null</code> if there is no
-     *         previous value
-     * @exception IllegalArgumentException
-     *                <ul>
-     *                <li>if <code>key==null</code>
-     *                <li>if <code>value</code> is not <code>null</code> and not
-     *                an instance of type that is specified in by the given
-     *                <code>key</code> (see {@link AttributeKey#getType()})
+     * Sets a user-defined attribute. If the <code>value</code> is <code>null</code> the attribute will be removed from
+     * this {@link IoSession}.
+     * 
+     * @param key the attribute's key, must not be <code>null</code>
+     * @param value the attribute's value, <code>null</code> to remove the attribute
+     * @return the old attribute's value or <code>null</code> if there is no previous value
+     * @exception IllegalArgumentException <ul>
+     *            <li>if <code>key==null</code>
+     *            <li>if <code>value</code> is not <code>null</code> and not an instance of type that is specified in by
+     *            the given <code>key</code> (see {@link AttributeKey#getType()})
      * 
-     *                </ul>
+     *            </ul>
      * 
      * @see #getAttribute(AttributeKey)
      */
     <T> T setAttribute(AttributeKey<? extends T> key, T value);
 
     /**
-     * Returns an unmodifiable {@link Set} of all Keys of this {@link IoSession}. If
-     * this {@link IoSession} contains no attributes an empty {@link Set} will be returned.
+     * Returns an unmodifiable {@link Set} of all Keys of this {@link IoSession}. If this {@link IoSession} contains no
+     * attributes an empty {@link Set} will be returned.
      * 
      * @return all Keys, never <code>null</code>
      * @see Collections#unmodifiableSet(Set)
@@ -328,16 +317,13 @@ public interface IoSession {
     Set<AttributeKey<?>> getAttributeKeys();
 
     /**
-     * Removes the specified Attribute from this container. The old value will
-     * be returned, <code>null</code> will be rutrnen if there is no such
-     * attribute in this container.<br>
+     * Removes the specified Attribute from this container. The old value will be returned, <code>null</code> will be
+     * rutrnen if there is no such attribute in this container.<br>
      * <br>
      * This method is equivalent to <code>setAttribute(key,null)</code>.
      * 
-     * @param key
-     *            of the attribute to be removed,must not be <code>null</code>
-     * @return the removed value, <code>null</code> if this container doesn't
-     *         contain the specified attribute
+     * @param key of the attribute to be removed,must not be <code>null</code>
+     * @return the removed value, <code>null</code> if this container doesn't contain the specified attribute
      * @exception IllegalArgumentException if <code>key==null</code>
      */
     public <T> T removeAttribute(AttributeKey<T> key);
@@ -355,7 +341,7 @@ public interface IoSession {
     /* SESSION WRITING */
     /**
      * Enqueue a message for writing. This method wont block ! The message will by asynchronously processed by the
-     * filter chain and wrote to socket by the {@link SelectorProcessor}.
+     * filter chain and wrote to socket by the {@link SelectorLoop}
      * 
      */
     public void write(Object message);
@@ -378,7 +364,7 @@ public interface IoSession {
     public WriteRequest enqueueWriteRequest(Object message);
 
     /**
-     * Get the {@link Queue} of this session. The write queue contains the pending writes. 
+     * Get the {@link Queue} of this session. The write queue contains the pending writes.
      * 
      * @return the write queue of this session
      */

Modified: mina/mina/trunk/core/src/main/java/org/apache/mina/session/AbstractIoSession.java
URL: http://svn.apache.org/viewvc/mina/mina/trunk/core/src/main/java/org/apache/mina/session/AbstractIoSession.java?rev=1412687&r1=1412686&r2=1412687&view=diff
==============================================================================
--- mina/mina/trunk/core/src/main/java/org/apache/mina/session/AbstractIoSession.java (original)
+++ mina/mina/trunk/core/src/main/java/org/apache/mina/session/AbstractIoSession.java Thu Nov 22 21:56:09 2012
@@ -41,8 +41,8 @@ import org.apache.mina.api.IoSession;
 import org.apache.mina.api.RuntimeIoException;
 import org.apache.mina.filterchain.ReadFilterChainController;
 import org.apache.mina.filterchain.WriteFilterChainController;
-import org.apache.mina.service.SelectorProcessor;
 import org.apache.mina.service.idlechecker.IdleChecker;
+import org.apache.mina.transport.nio.SelectorLoop;
 import org.apache.mina.util.AbstractIoFuture;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -116,7 +116,7 @@ public abstract class AbstractIoSession 
     // Write queue
     // ------------------------------------------------------------------------
 
-    /** the queue of pending writes for the session, to be dequeued by the {@link SelectorProcessor} */
+    /** the queue of pending writes for the session, to be dequeued by the {@link SelectorLoop} */
     private final Queue<WriteRequest> writeQueue = new DefaultWriteQueue();
 
     // ------------------------------------------------------------------------
@@ -638,7 +638,7 @@ public abstract class AbstractIoSession 
     }
 
     /**
-     * process session opened event using the filter chain. To be called by the session {@link SelectorProcessor} .
+     * process session opened event using the filter chain. To be called by the session {@link SelectorLoop} .
      */
     public void processSessionOpened() {
         LOG.debug("processing session open event");
@@ -659,7 +659,7 @@ public abstract class AbstractIoSession 
     }
 
     /**
-     * process session closed event using the filter chain. To be called by the session {@link SelectorProcessor} .
+     * process session closed event using the filter chain. To be called by the session {@link SelectorLoop} .
      */
     public void processSessionClosed() {
         LOG.debug("processing session closed event");
@@ -678,7 +678,7 @@ public abstract class AbstractIoSession 
     }
 
     /**
-     * process session idle event using the filter chain. To be called by the session {@link SelectorProcessor} .
+     * process session idle event using the filter chain. To be called by the session {@link SelectorLoop} .
      */
     public void processSessionIdle(final IdleStatus status) {
         LOG.debug("processing session idle {} event for session {}", status, this);
@@ -698,8 +698,7 @@ public abstract class AbstractIoSession 
     }
 
     /**
-     * process session message received event using the filter chain. To be called by the session
-     * {@link SelectorProcessor} .
+     * process session message received event using the filter chain. To be called by the session {@link SelectorLoop} .
      * 
      * @param message the received message
      */
@@ -729,8 +728,7 @@ public abstract class AbstractIoSession 
     }
 
     /**
-     * process session message writing event using the filter chain. To be called by the session
-     * {@link SelectorProcessor} .
+     * process session message writing event using the filter chain. To be called by the session {@link SelectorLoop} .
      * 
      * @param message the wrote message, should be transformed into ByteBuffer at the end of the filter chain
      */
@@ -769,14 +767,14 @@ public abstract class AbstractIoSession 
         LOG.debug("processing message '{}' sent event for session {}", highLevelMessage, this);
 
         try {
-        final int size = chain.length;
-        for (int i = size - 1; i >= 0; i--) {
-            chain[i].messageSent(this, highLevelMessage);
-        }
-        final IoHandler handler = getService().getIoHandler();
-        if (handler != null) {
-            handler.messageSent(this, highLevelMessage);
-        }
+            final int size = chain.length;
+            for (int i = size - 1; i >= 0; i--) {
+                chain[i].messageSent(this, highLevelMessage);
+            }
+            final IoHandler handler = getService().getIoHandler();
+            if (handler != null) {
+                handler.messageSent(this, highLevelMessage);
+            }
         } catch (final RuntimeException e) {
             processException(e);
         }
@@ -784,8 +782,7 @@ public abstract class AbstractIoSession 
     }
 
     /**
-     * process session message received event using the filter chain. To be called by the session
-     * {@link SelectorProcessor} .
+     * process session message received event using the filter chain. To be called by the session {@link SelectorLoop} .
      * 
      * @param message the received message
      */

Modified: mina/mina/trunk/examples/src/main/java/org/apache/mina/examples/http/HttpTest.java
URL: http://svn.apache.org/viewvc/mina/mina/trunk/examples/src/main/java/org/apache/mina/examples/http/HttpTest.java?rev=1412687&r1=1412686&r2=1412687&view=diff
==============================================================================
--- mina/mina/trunk/examples/src/main/java/org/apache/mina/examples/http/HttpTest.java (original)
+++ mina/mina/trunk/examples/src/main/java/org/apache/mina/examples/http/HttpTest.java Thu Nov 22 21:56:09 2012
@@ -39,13 +39,9 @@ import org.apache.mina.http.api.HttpRequ
 import org.apache.mina.http.api.HttpStatus;
 import org.apache.mina.http.api.HttpVersion;
 import org.apache.mina.transport.nio.NioTcpServer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class HttpTest {
 
-    private static final Logger LOG = LoggerFactory.getLogger(HttpTest.class);
-
     public static void main(String[] args) throws Exception {
 
         NioTcpServer acceptor = new NioTcpServer();

Modified: mina/mina/trunk/examples/src/main/java/org/apache/mina/examples/http/HttpsTest.java
URL: http://svn.apache.org/viewvc/mina/mina/trunk/examples/src/main/java/org/apache/mina/examples/http/HttpsTest.java?rev=1412687&r1=1412686&r2=1412687&view=diff
==============================================================================
--- mina/mina/trunk/examples/src/main/java/org/apache/mina/examples/http/HttpsTest.java (original)
+++ mina/mina/trunk/examples/src/main/java/org/apache/mina/examples/http/HttpsTest.java Thu Nov 22 21:56:09 2012
@@ -39,13 +39,9 @@ import org.apache.mina.http.api.HttpRequ
 import org.apache.mina.http.api.HttpStatus;
 import org.apache.mina.http.api.HttpVersion;
 import org.apache.mina.transport.nio.NioTcpServer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class HttpsTest {
 
-    private static final Logger LOG = LoggerFactory.getLogger(HttpsTest.class);
-
     public static void main(String[] args) throws Exception {
 
         NioTcpServer acceptor = new NioTcpServer();

Modified: mina/mina/trunk/examples/src/main/java/org/apache/mina/examples/ldap/LdapTest.java
URL: http://svn.apache.org/viewvc/mina/mina/trunk/examples/src/main/java/org/apache/mina/examples/ldap/LdapTest.java?rev=1412687&r1=1412686&r2=1412687&view=diff
==============================================================================
--- mina/mina/trunk/examples/src/main/java/org/apache/mina/examples/ldap/LdapTest.java (original)
+++ mina/mina/trunk/examples/src/main/java/org/apache/mina/examples/ldap/LdapTest.java Thu Nov 22 21:56:09 2012
@@ -40,14 +40,11 @@ import org.apache.mina.filter.logging.Lo
 import org.apache.mina.filterchain.ReadFilterChainController;
 import org.apache.mina.ldap.LdapCodec;
 import org.apache.mina.transport.nio.NioTcpServer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * A simple LDAP server class used to test theLDAP encoder/decoder. It only deal with the BindRequest message.
  */
 public class LdapTest {
-    private static final Logger LOG = LoggerFactory.getLogger(LdapTest.class);
 
     public static void main(String[] args) throws Exception {
         LdapTest ldapServer = new LdapTest();

Modified: mina/mina/trunk/http/src/main/java/org/apache/mina/http/HttpServerCodec.java
URL: http://svn.apache.org/viewvc/mina/mina/trunk/http/src/main/java/org/apache/mina/http/HttpServerCodec.java?rev=1412687&r1=1412686&r2=1412687&view=diff
==============================================================================
--- mina/mina/trunk/http/src/main/java/org/apache/mina/http/HttpServerCodec.java (original)
+++ mina/mina/trunk/http/src/main/java/org/apache/mina/http/HttpServerCodec.java Thu Nov 22 21:56:09 2012
@@ -26,13 +26,9 @@ import org.apache.mina.filter.codec.Prot
 import org.apache.mina.filter.codec.ProtocolDecoder;
 import org.apache.mina.filter.codec.ProtocolEncoder;
 import org.apache.mina.session.AttributeKey;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class HttpServerCodec extends ProtocolCodecFilter {
 
-    private static final Logger LOG = LoggerFactory.getLogger(HttpServerCodec.class);
-
     /** Key for decoder current state */
     private static final AttributeKey<DecoderState> DECODER_STATE_ATT = createKey(DecoderState.class,
             "internal_http.ds");