directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r371277 - in /directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common: IoSession.java RuntimeIOException.java
Date Sun, 22 Jan 2006 12:30:05 GMT
Author: trustin
Date: Sun Jan 22 04:29:59 2006
New Revision: 371277

URL: http://svn.apache.org/viewcvs?rev=371277&view=rev
Log:
* Added RuntimeIOException
* Added more documentation to IoSession

Added:
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/RuntimeIOException.java
  (with props)
Modified:
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/IoSession.java

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/IoSession.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/IoSession.java?rev=371277&r1=371276&r2=371277&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/IoSession.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/IoSession.java
Sun Jan 22 04:29:59 2006
@@ -31,7 +31,16 @@
  * 
  * <h3>Adjusting Transport Type Specific Properties</h3>
  * <p>
- * You can simply downcast the session to an appropriate subclass.
+ * Transport type specific properties are provided as user-defined attributes.
+ * You can simply use the same methods you use when accessing your own
+ * attributes.  For example:
+ * <pre>
+ * IoSession session = ...;
+ * Integer recvBufSize = session.getAttribute( "receiveBufferSize" );
+ * session.setAttribute( "tcpNoDelay", Boolean.TRUE );
+ * </pre>
+ * Please refer to the documentation of the {@link IoServiceProvider}
+ * implementation you're using for the list of supported properties.
  * </p>
  * 
  * <h3>Thread Safety</h3>
@@ -99,6 +108,8 @@
      * 
      * @param key the key of the attribute
      * @return <tt>null</tt> if there is no attribute with the specified key
+     * 
+     * @throws RuntimeIOException if failed to read the attribute
      */
     Object getAttribute( String key );
     
@@ -108,6 +119,8 @@
      * @param key the key of the attribute
      * @param value the value of the attribute
      * @return The old value of the attribute.  <tt>null</tt> if it is new.
+     * 
+     * @throws RuntimeIOException if failed to set the attribute
      */
     Object setAttribute( String key, Object value );
     
@@ -118,6 +131,8 @@
      * 
      * @param key the key of the attribute
      * @return The old value of the attribute.  <tt>null</tt> if it is new.
+     * 
+     * @throws RuntimeIOException if failed to set the attribute
      */
     Object setAttribute( String key );
     

Added: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/RuntimeIOException.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/RuntimeIOException.java?rev=371277&view=auto
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/RuntimeIOException.java
(added)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/RuntimeIOException.java
Sun Jan 22 04:29:59 2006
@@ -0,0 +1,50 @@
+/*
+ *   @(#) $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.common;
+
+/**
+ * A unchecked version of {@link java.io.IOException}.
+ *
+ * @author The Apache Directory Project (dev@directory.apache.org)
+ * @version $Rev$, $Date$
+ */
+public class RuntimeIOException extends RuntimeException
+{
+    private static final long serialVersionUID = 9029092241311939548L;
+
+    public RuntimeIOException()
+    {
+        super();
+    }
+
+    public RuntimeIOException( String message )
+    {
+        super( message );
+    }
+
+    public RuntimeIOException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+
+    public RuntimeIOException( Throwable cause )
+    {
+        super( cause );
+    }
+}

Propchange: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/RuntimeIOException.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision



Mime
View raw message