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 2013/06/09 19:33:45 UTC

git commit: javadoc tweaking and some warning fix

Updated Branches:
  refs/heads/trunk 82b7ad13e -> 71e8455e4


javadoc tweaking and some warning fix


Project: http://git-wip-us.apache.org/repos/asf/mina/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina/commit/71e8455e
Tree: http://git-wip-us.apache.org/repos/asf/mina/tree/71e8455e
Diff: http://git-wip-us.apache.org/repos/asf/mina/diff/71e8455e

Branch: refs/heads/trunk
Commit: 71e8455e431ec85e4d2c532caa01de205da39b5c
Parents: 82b7ad1
Author: jvermillard <jv...@apache.org>
Authored: Sun Jun 9 19:32:56 2013 +0200
Committer: jvermillard <jv...@apache.org>
Committed: Sun Jun 9 19:32:56 2013 +0200

----------------------------------------------------------------------
 .../org/apache/mina/api/AbstractIoHandler.java  |  2 +-
 .../main/java/org/apache/mina/api/IoClient.java |  3 ++-
 .../java/org/apache/mina/api/IoHandler.java     | 13 +++++++++
 .../main/java/org/apache/mina/api/IoServer.java |  4 ++-
 .../apache/mina/api/MinaRuntimeException.java   |  2 +-
 .../java/org/apache/mina/api/package-info.java  | 28 ++++++++++++++++++++
 .../mina/filter/codec/ProtocolCodecFilter.java  |  4 +++
 .../mina/transport/nio/NioSelectorLoop.java     |  4 +--
 .../apache/mina/transport/nio/SslHelper.java    |  3 ---
 9 files changed, 53 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina/blob/71e8455e/core/src/main/java/org/apache/mina/api/AbstractIoHandler.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/mina/api/AbstractIoHandler.java b/core/src/main/java/org/apache/mina/api/AbstractIoHandler.java
index 0385b37..05c61af 100644
--- a/core/src/main/java/org/apache/mina/api/AbstractIoHandler.java
+++ b/core/src/main/java/org/apache/mina/api/AbstractIoHandler.java
@@ -84,7 +84,7 @@ public abstract class AbstractIoHandler implements IoHandler {
      */
     @Override
     public void exceptionCaught(final IoSession session, final Exception cause) {
-        LOG.error("Unexpected exception : ", cause);
+        LOG.error("Unexpected exception, we close the session : ", cause);
         session.close(true);
     }
 }

http://git-wip-us.apache.org/repos/asf/mina/blob/71e8455e/core/src/main/java/org/apache/mina/api/IoClient.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/mina/api/IoClient.java b/core/src/main/java/org/apache/mina/api/IoClient.java
index 6cdb1c7..82b44aa 100644
--- a/core/src/main/java/org/apache/mina/api/IoClient.java
+++ b/core/src/main/java/org/apache/mina/api/IoClient.java
@@ -22,7 +22,8 @@ package org.apache.mina.api;
 import java.net.SocketAddress;
 
 /**
- * Connects to endpoint, communicates with the server, and fires events to {@link org.apache.mina.service.IoHandler}s.
+ * Connects to several end-points, communicates with the server, and fires events to
+ * {@link org.apache.mina.service.IoHandler}s.
  * 
  * @author <a href="http://mina.apache.org">Apache MINA Project</a>
  */

http://git-wip-us.apache.org/repos/asf/mina/blob/71e8455e/core/src/main/java/org/apache/mina/api/IoHandler.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/mina/api/IoHandler.java b/core/src/main/java/org/apache/mina/api/IoHandler.java
index 63e758a..b3a6acf 100644
--- a/core/src/main/java/org/apache/mina/api/IoHandler.java
+++ b/core/src/main/java/org/apache/mina/api/IoHandler.java
@@ -19,6 +19,19 @@
  */
 package org.apache.mina.api;
 
+import org.apache.mina.service.executor.IoHandlerExecutor;
+
+/**
+ * Handle all the I/O events generated by a {@link IoService}.
+ * <p>
+ * You should handle your business logic in an IoHandler implementation.
+ * <p>
+ * The {@link IoFilter} is dedicated to message transformation, but the IoHandler is mean to be the core of your
+ * business logic.
+ * <p>
+ * If you need to implement blocking code in your {@link IoHandler}, then you need to add a {@link IoHandlerExecutor} in
+ * the enclosing {@link IoService}.
+ */
 public interface IoHandler {
 
     /**

http://git-wip-us.apache.org/repos/asf/mina/blob/71e8455e/core/src/main/java/org/apache/mina/api/IoServer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/mina/api/IoServer.java b/core/src/main/java/org/apache/mina/api/IoServer.java
index 7f55838..af03abb 100644
--- a/core/src/main/java/org/apache/mina/api/IoServer.java
+++ b/core/src/main/java/org/apache/mina/api/IoServer.java
@@ -23,7 +23,9 @@ import java.net.SocketAddress;
 
 /**
  * 
- * A network server bound to a local address
+ * A network server bound to a local address.
+ * <p>
+ * Will crate a new {@link IoSession} for each new incoming connection.
  * 
  * @author <a href="http://mina.apache.org">Apache MINA Project</a>
  * 

http://git-wip-us.apache.org/repos/asf/mina/blob/71e8455e/core/src/main/java/org/apache/mina/api/MinaRuntimeException.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/mina/api/MinaRuntimeException.java b/core/src/main/java/org/apache/mina/api/MinaRuntimeException.java
index 8fb36a1..04a0e70 100644
--- a/core/src/main/java/org/apache/mina/api/MinaRuntimeException.java
+++ b/core/src/main/java/org/apache/mina/api/MinaRuntimeException.java
@@ -20,7 +20,7 @@
 package org.apache.mina.api;
 
 /**
- * something very wrong happened in the low level part of I/O processing.
+ * Something very wrong happened in the low level part of I/O processing.
  * 
  * @author <a href="http://mina.apache.org">Apache MINA Project</a>
  */

http://git-wip-us.apache.org/repos/asf/mina/blob/71e8455e/core/src/main/java/org/apache/mina/api/package-info.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/mina/api/package-info.java b/core/src/main/java/org/apache/mina/api/package-info.java
new file mode 100644
index 0000000..3574c43
--- /dev/null
+++ b/core/src/main/java/org/apache/mina/api/package-info.java
@@ -0,0 +1,28 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.api;
+
+/**
+ * Base API for the MINA library. All those interface and API are the contract with the framework.
+ * 
+ * For running an {@link org.apache.mina.api.IoService} you need to choose a concrete implementation in
+ * org.apache.mina.transport.
+ */

http://git-wip-us.apache.org/repos/asf/mina/blob/71e8455e/core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java b/core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java
index cb26f41..65974b4 100644
--- a/core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java
+++ b/core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java
@@ -19,6 +19,8 @@
  */
 package org.apache.mina.filter.codec;
 
+import java.nio.ByteBuffer;
+
 import org.apache.mina.api.AbstractIoFilter;
 import org.apache.mina.api.IoFilter;
 import org.apache.mina.api.IoSession;
@@ -37,6 +39,8 @@ import org.slf4j.LoggerFactory;
  * An {@link IoFilter} which translates binary or protocol specific data into message objects and vice versa using
  * {@link ProtocolCodecFactory}, {@link ProtocolEncoder}, or {@link ProtocolDecoder}.
  * 
+ * @param MESSAGE the kind of high level business message this filter will encode and decode.
+ * @param ENCODED the kind of low level message (most of time {@link ByteBuffer}) this filter will produce of consume.
  * @author <a href="http://mina.apache.org">Apache MINA Project</a>
  */
 public class ProtocolCodecFilter<MESSAGE, ENCODED, ENCODING_STATE, DECODING_STATE> extends AbstractIoFilter {

http://git-wip-us.apache.org/repos/asf/mina/blob/71e8455e/core/src/main/java/org/apache/mina/transport/nio/NioSelectorLoop.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/mina/transport/nio/NioSelectorLoop.java b/core/src/main/java/org/apache/mina/transport/nio/NioSelectorLoop.java
index 4ace7a7..382489e 100644
--- a/core/src/main/java/org/apache/mina/transport/nio/NioSelectorLoop.java
+++ b/core/src/main/java/org/apache/mina/transport/nio/NioSelectorLoop.java
@@ -71,11 +71,9 @@ public class NioSelectorLoop implements SelectorLoop {
      * @param index
      */
     public NioSelectorLoop(final String prefix, final int index) {
-        String name = NioSelectorLoop.class.getName() + ":" + prefix;
         String workerName = "SelectorWorker " + prefix;
 
         if (index >= 0) {
-            name += "-" + index;
             workerName += "-" + index;
         }
 
@@ -145,7 +143,7 @@ public class NioSelectorLoop implements SelectorLoop {
             SelectableChannel channel, boolean wakeup) {
         if (IS_DEBUG) {
             LOG.debug("modifying registration : {} for accept : {}, read : {}, write : {}, channel : {}", new Object[] {
-                    listener, accept, read, write, channel });
+                                    listener, accept, read, write, channel });
         }
 
         final SelectionKey key = channel.keyFor(selector);

http://git-wip-us.apache.org/repos/asf/mina/blob/71e8455e/core/src/main/java/org/apache/mina/transport/nio/SslHelper.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/mina/transport/nio/SslHelper.java b/core/src/main/java/org/apache/mina/transport/nio/SslHelper.java
index aeb19f5..889a65f 100644
--- a/core/src/main/java/org/apache/mina/transport/nio/SslHelper.java
+++ b/core/src/main/java/org/apache/mina/transport/nio/SslHelper.java
@@ -79,9 +79,6 @@ public class SslHelper {
     /** An empty buffer used during the handshake phase */
     private static final ByteBuffer EMPTY_BUFFER = ByteBuffer.allocate(0);
 
-    /** An empty buffer used during the handshake phase */
-    private static final ByteBuffer HANDSHAKE_BUFFER = ByteBuffer.allocate(1024);
-
     private ByteBuffer previous = null;
 
     /**