Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 98167 invoked from network); 23 Apr 2005 17:43:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Apr 2005 17:43:31 -0000 Received: (qmail 19023 invoked by uid 500); 23 Apr 2005 17:44:01 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 18954 invoked by uid 500); 23 Apr 2005 17:44:00 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 18939 invoked by uid 99); 23 Apr 2005 17:44:00 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Sat, 23 Apr 2005 10:44:00 -0700 Received: (qmail 98164 invoked by uid 65534); 23 Apr 2005 17:43:29 -0000 Message-ID: <20050423174329.98163.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: svn commit: r164404 - in /directory/network/trunk: src/examples/org/apache/mina/examples/echoserver/ssl/ src/examples/org/apache/mina/examples/httpserver/ src/java/org/apache/mina/io/ src/java/org/apache/mina/io/handler/ src/java/org/apache/mina/protocol/ xdocs/ Date: Sat, 23 Apr 2005 17:43:27 -0000 To: commits@directory.apache.org From: trustin@apache.org X-Mailer: svnmailer-1.0.0-dev X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: trustin Date: Sat Apr 23 10:43:26 2005 New Revision: 164404 URL: http://svn.apache.org/viewcvs?rev=3D164404&view=3Drev Log: * Added StreamIoHandler that enables stream-based I/O for MINA * Added HTTP server example * Added some JavaDocs Added: directory/network/trunk/src/examples/org/apache/mina/examples/echoserve= r/ssl/package.html (with props) directory/network/trunk/src/examples/org/apache/mina/examples/httpserve= r/ directory/network/trunk/src/examples/org/apache/mina/examples/httpserve= r/HttpProtocolHandler.java (with props) directory/network/trunk/src/examples/org/apache/mina/examples/httpserve= r/Main.java (with props) directory/network/trunk/src/examples/org/apache/mina/examples/httpserve= r/package.html (with props) directory/network/trunk/src/java/org/apache/mina/io/handler/ directory/network/trunk/src/java/org/apache/mina/io/handler/StreamIoHan= dler.java (with props) directory/network/trunk/src/java/org/apache/mina/io/handler/package.htm= l (with props) Modified: directory/network/trunk/src/java/org/apache/mina/io/AbstractIoHandlerFi= lterChain.java directory/network/trunk/src/java/org/apache/mina/protocol/AbstractProto= colHandlerFilterChain.java directory/network/trunk/xdocs/index.xml Added: directory/network/trunk/src/examples/org/apache/mina/examples/echose= rver/ssl/package.html URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/examples/org= /apache/mina/examples/echoserver/ssl/package.html?rev=3D164404&view=3Dauto =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/network/trunk/src/examples/org/apache/mina/examples/echoserve= r/ssl/package.html (added) +++ directory/network/trunk/src/examples/org/apache/mina/examples/echoserve= r/ssl/package.html Sat Apr 23 10:43:26 2005 @@ -0,0 +1,8 @@ + + + + + +SSL support classes. + + Propchange: directory/network/trunk/src/examples/org/apache/mina/examples/e= choserver/ssl/package.html ---------------------------------------------------------------------------= --- svn:keywords =3D HeadURL Id LastChangedBy LastChangedDate LastChangedRe= vision Added: directory/network/trunk/src/examples/org/apache/mina/examples/httpse= rver/HttpProtocolHandler.java URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/examples/org= /apache/mina/examples/httpserver/HttpProtocolHandler.java?rev=3D164404&view= =3Dauto =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/network/trunk/src/examples/org/apache/mina/examples/httpserve= r/HttpProtocolHandler.java (added) +++ directory/network/trunk/src/examples/org/apache/mina/examples/httpserve= r/HttpProtocolHandler.java Sat Apr 23 10:43:26 2005 @@ -0,0 +1,127 @@ +/* + * @(#) $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 impli= ed. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.mina.examples.httpserver; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.util.Iterator; +import java.util.Map; +import java.util.TreeMap; +import java.util.Map.Entry; + +import org.apache.mina.io.IoSession; +import org.apache.mina.io.handler.StreamIoHandler; + +/** + * A simplistic HTTP protocol handler that replies back the URL and header= s + * which a client requested. + *=20 + * @author The Apache Directory Project (dev@directory.apache.org) + * @author Trustin Lee (trustin@apache.org) + * @version $Rev$, $Date$ + */ +public class HttpProtocolHandler extends StreamIoHandler +{ + protected void processStreamIo( IoSession session, InputStream in, + OutputStream out ) + { + // You *MUST* execute stream I/O logic in a separate thread. + new Worker( in, out ).start(); + } + =20 + private static class Worker extends Thread + { + private final InputStream in; + private final OutputStream out; + =20 + public Worker( InputStream in, OutputStream out ) + { + setDaemon( true ); + this.in =3D in; + this.out =3D out; + } + =20 + public void run() + { + String url; + Map headers =3D new TreeMap(); + BufferedReader in =3D new BufferedReader( + new InputStreamReader( this.in ) ); + PrintWriter out =3D new PrintWriter( + new BufferedWriter( new OutputStreamWriter( this.out )= ) ); + =20 + try + { + // Get request URL. + url =3D in.readLine().split( " " )[1]; + =20 + // Read header + String line; + while ( ( line =3D in.readLine() ) !=3D null && !line.equa= ls( "" ) ) + { + String[] tokens =3D line.split(": "); + headers.put( tokens[0], tokens[1] ); + } + =20 + // Write header + out.println( "HTTP/1.0 200 OK" ); + out.println( "Content-Type: text/html" ); + out.println( "Server: MINA Example" ); + out.println(); + =20 + // Write content + out.println( "" ); + out.println( "

Request Summary for: " + url + "

" )= ; + out.println( "" ); + =20 + Iterator it =3D headers.entrySet().iterator(); + while( it.hasNext() ) + { + Entry e =3D ( Entry ) it.next(); + out.println( "" ); + } + =20 + out.println( "
KeyVa= lue
" + e.getKey() + "" + e= .getValue() + "
" ); + out.println( "" ); + } + catch( Exception e ) + { + e.printStackTrace(); + } + finally + { + out.flush(); + out.close(); + try + { + in.close(); + } + catch( IOException e ) + { + } + } + } + } +} Propchange: directory/network/trunk/src/examples/org/apache/mina/examples/h= ttpserver/HttpProtocolHandler.java ---------------------------------------------------------------------------= --- svn:keywords =3D HeadURL Id LastChangedBy LastChangedDate LastChangedRe= vision Added: directory/network/trunk/src/examples/org/apache/mina/examples/httpse= rver/Main.java URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/examples/org= /apache/mina/examples/httpserver/Main.java?rev=3D164404&view=3Dauto =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/network/trunk/src/examples/org/apache/mina/examples/httpserve= r/Main.java (added) +++ directory/network/trunk/src/examples/org/apache/mina/examples/httpserve= r/Main.java Sat Apr 23 10:43:26 2005 @@ -0,0 +1,71 @@ +/* + * @(#) $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 impli= ed. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.mina.examples.httpserver; + +import java.net.InetSocketAddress; + +import org.apache.mina.examples.echoserver.ssl.BogusSSLContextFactory; +import org.apache.mina.io.IoAcceptor; +import org.apache.mina.io.filter.IoThreadPoolFilter; +import org.apache.mina.io.filter.SSLFilter; +import org.apache.mina.io.socket.SocketAcceptor; + +/** + * (Entry point) HTTP server + *=20 + * @author Trustin Lee (trustin@apache.org) + * @version $Rev$, $Date$ + */ +public class Main +{ + /** Choose your favorite port number. */ + private static final int PORT =3D 8080; + =20 + /** Set this to true if you want to make the server SSL */ + private static final boolean USE_SSL =3D false; + + public static void main( String[] args ) throws Exception + { + // Create a I/O thread pool filter=20 + IoThreadPoolFilter threadPoolFilter =3D new IoThreadPoolFilter(); + threadPoolFilter.start(); // and start it + + // Create a TCP/IP acceptor + IoAcceptor acceptor =3D new SocketAcceptor(); + + // Add thread pool filter + // MINA runs in a single thread if you don't add this filter. + acceptor.getFilterChain().addFirst( "threadPool", threadPoolFilter= ); + + // Add SSL filter if SSL is enabled. + if( USE_SSL ) + { + System.out.println( "SSL is enabled." ); + SSLFilter sslFilter =3D new SSLFilter( BogusSSLContextFactory + .getInstance( true ) ); + acceptor.getFilterChain().addLast( "sslFilter", sslFilter ); + } + + // Bind + acceptor.bind( new InetSocketAddress( PORT ), + new HttpProtocolHandler() ); + + System.out.println( "Listening on port " + PORT ); + } +} Propchange: directory/network/trunk/src/examples/org/apache/mina/examples/h= ttpserver/Main.java ---------------------------------------------------------------------------= --- svn:keywords =3D HeadURL Id LastChangedBy LastChangedDate LastChangedRe= vision Added: directory/network/trunk/src/examples/org/apache/mina/examples/httpse= rver/package.html URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/examples/org= /apache/mina/examples/httpserver/package.html?rev=3D164404&view=3Dauto =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/network/trunk/src/examples/org/apache/mina/examples/httpserve= r/package.html (added) +++ directory/network/trunk/src/examples/org/apache/mina/examples/httpserve= r/package.html Sat Apr 23 10:43:26 2005 @@ -0,0 +1,8 @@ + + + + + +Simplistic HTTP server which demonstates stream-based I/O support. + + Propchange: directory/network/trunk/src/examples/org/apache/mina/examples/h= ttpserver/package.html ---------------------------------------------------------------------------= --- svn:keywords =3D HeadURL Id LastChangedBy LastChangedDate LastChangedRe= vision Modified: directory/network/trunk/src/java/org/apache/mina/io/AbstractIoHan= dlerFilterChain.java URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apa= che/mina/io/AbstractIoHandlerFilterChain.java?rev=3D164404&r1=3D164403&r2= =3D164404&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/network/trunk/src/java/org/apache/mina/io/AbstractIoHandlerFi= lterChain.java (original) +++ directory/network/trunk/src/java/org/apache/mina/io/AbstractIoHandlerFi= lterChain.java Sat Apr 23 10:43:26 2005 @@ -1,3 +1,21 @@ +/* + * @(#) $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 impli= ed. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ package org.apache.mina.io; =20 import java.util.ArrayList; @@ -28,7 +46,7 @@ * finally to be written to the underlying transport layer (e.g. socket) *=20 * @author The Apache Directory Project - * @version $Rev$, $Date$, + * @version $Rev$, $Date$ */ public abstract class AbstractIoHandlerFilterChain implements IoHandlerFil= terChain { Added: directory/network/trunk/src/java/org/apache/mina/io/handler/StreamIo= Handler.java URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apa= che/mina/io/handler/StreamIoHandler.java?rev=3D164404&view=3Dauto =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/network/trunk/src/java/org/apache/mina/io/handler/StreamIoHan= dler.java (added) +++ directory/network/trunk/src/java/org/apache/mina/io/handler/StreamIoHan= dler.java Sat Apr 23 10:43:26 2005 @@ -0,0 +1,290 @@ +package org.apache.mina.io.handler; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PipedOutputStream; +import java.net.SocketTimeoutException; + +import org.apache.mina.common.ByteBuffer; +import org.apache.mina.common.IdleStatus; +import org.apache.mina.io.IoHandlerAdapter; +import org.apache.mina.io.IoSession; + +/** + * A {@lin IoHandler} that adapts asynchronous MINA events to stream I/O. + *

+ * Please extend this class and implement + * {@link #processStreamIo(IoSession, InputStream, OutputStream)} to + * execute your stream I/O logic; please note that you must forward + * the process request to other thread or thread pool. + *=20 + * @author The Apache Directory Project (dev@directory.apache.org) + * @author Trustin Lee (trustin@apache.org) + * @version $Rev$, $Date$ + */ +public abstract class StreamIoHandler extends IoHandlerAdapter +{ + private static final String KEY_IN =3D "BlockingIoHandler.in"; + private static final String KEY_OUT =3D "BlockingIoHandler.out"; + private static final String KEY_STARTED =3D "BlockingIoHandler.started= "; + =20 + private int readTimeout; + =20 + private int writeTimeout; + =20 + protected StreamIoHandler() + { + } + =20 + /** + * Implement this method to execute your stream I/O logic; + * please note that you must forward the process request to other + * thread or thread pool. + */ + protected abstract void processStreamIo( IoSession session, + InputStream in, OutputStream = out ); + =20 + /** + * Returns read timeout in seconds. + * The default value is 0 (disabled). + */ + public int getReadTimeout() + { + return readTimeout; + } + =20 + /** + * Sets read timeout in seconds. + * The default value is 0 (disabled). + */ + public void setReadTimeout( int readTimeout ) + { + this.readTimeout =3D readTimeout; + } + =20 + /** + * Returns write timeout in seconds. + * The default value is 0 (disabled). + */ + public int getWriteTimeout() + { + return writeTimeout; + } + =20 + /** + * Sets write timeout in seconds. + * The default value is 0 (disabled). + */ + public void setWriteTimeout( int writeTimeout ) + { + this.writeTimeout =3D writeTimeout; + } + + /** + * Initializes streams and timeout settings. + */ + public void sessionOpened( IoSession session ) + { + // Set timeouts + session.getConfig().setWriteTimeout( writeTimeout ); + session.getConfig().setIdleTime( IdleStatus.READER_IDLE, readTimeo= ut ); + + // Create streams + PipedOutputStream out =3D new PipedOutputStream(); + session.setAttribute( KEY_OUT, out ); + try + { + session.setAttribute( KEY_IN, new PipedInputStream( out ) ); + } + catch( IOException e ) + { + throw new StreamIoException( e ); + } + } + =20 + /** + * Closes input stream. + */ + public void sessionClosed( IoSession session ) + { + final PipedOutputStream out =3D ( PipedOutputStream ) session.getA= ttribute( KEY_OUT ); + try { + out.close(); + } + catch( IOException e ) + { + throw new StreamIoException( e ); + } + } + + /** + * Forwards read data to input stream. + */ + public void dataRead( IoSession session, ByteBuffer buf ) + { + final PipedInputStream in =3D ( PipedInputStream ) session.getAttr= ibute( KEY_IN ); + final PipedOutputStream out =3D ( PipedOutputStream ) session.getA= ttribute( KEY_OUT ); + =20 + java.nio.ByteBuffer nioBuf =3D buf.buf(); + int offset =3D nioBuf.position(); + int length =3D nioBuf.limit() - offset; + if( !nioBuf.hasArray() ) + { + ByteBuffer heapBuf =3D ByteBuffer.allocate( length, false ); + heapBuf.put( buf ); + heapBuf.flip(); + nioBuf =3D heapBuf.buf(); + offset =3D 0; + } + =20 + try + { + out.write( nioBuf.array(), offset, length ); + } + catch( IOException e ) + { + throw new StreamIoException( e ); + } + finally + { + beginService( session, in ); + } + } + + /** + * Forwards caught exceptions to input stream. + */ + public void exceptionCaught( IoSession session, Throwable cause ) + { + final PipedInputStream in =3D ( PipedInputStream ) session.getAttr= ibute( KEY_IN ); + =20 + IOException e =3D null; + if( cause instanceof StreamIoException ) + { + e =3D ( IOException ) cause.getCause(); + } + else if( cause instanceof IOException ) + { + e =3D ( IOException ) cause; + } + =20 + if( e !=3D null && in !=3D null ) + { + in.setException( e ); + beginService( session, in ); + } + else + { + cause.printStackTrace(); + session.close(); + } + } + + /** + * Handles read timeout. + */ + public void sessionIdle( IoSession session, IdleStatus status ) + { + if( status =3D=3D IdleStatus.READER_IDLE ) + { + throw new StreamIoException( + new SocketTimeoutException( "Read timeout" ) ); + } + } + + private void beginService( IoSession session, PipedInputStream in ) + { + if( session.getAttribute( KEY_STARTED ) =3D=3D null ) + { + session.setAttribute( KEY_STARTED, Boolean.TRUE ); + processStreamIo( session, in, new ServiceOutputStream( session= ) ); + } + } + + private static class PipedInputStream extends java.io.PipedInputStream + { + private IOException exception; + + public PipedInputStream(PipedOutputStream src) throws IOException + { + super( src ); + } + =20 + public void setException( IOException e ) + { + this.exception =3D e; + } + + public synchronized int read() throws IOException + { + throwException(); + return super.read(); + } + + public synchronized int read( byte[] b, int off, int len ) throws = IOException + { + throwException(); + return super.read( b, off, len ); + } + =20 + private void throwException() throws IOException + { + if( exception !=3D null ) + { + throw exception; + } + } + } + + private static class ServiceOutputStream extends OutputStream + { + private final IoSession session; + =20 + public ServiceOutputStream( IoSession session ) + { + this.session =3D session; + } + + public void close() + { + session.close( true ); + } + + public void flush() + { + } + + public void write( byte[] b, int off, int len ) + { + ByteBuffer buf =3D ByteBuffer.wrap( b, off, len ); + buf.acquire(); // prevent from being pooled. + session.write( buf, null ); + } + + public void write( byte[] b ) + { + ByteBuffer buf =3D ByteBuffer.wrap( b ); + buf.acquire(); // prevent from being pooled. + session.write( buf, null ); + } + + public void write( int b ) + { + ByteBuffer buf =3D ByteBuffer.allocate( 1 ); + buf.put( ( byte ) b ); + buf.flip(); + session.write( buf, null ); + } + } + =20 + private static class StreamIoException extends RuntimeException + { + private static final long serialVersionUID =3D 3976736960742503222= L; + + public StreamIoException( IOException cause ) + { + super(cause); + } + } +} Propchange: directory/network/trunk/src/java/org/apache/mina/io/handler/Str= eamIoHandler.java ---------------------------------------------------------------------------= --- svn:keywords =3D HeadURL Id LastChangedBy LastChangedDate LastChangedRe= vision Added: directory/network/trunk/src/java/org/apache/mina/io/handler/package.= html URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apa= che/mina/io/handler/package.html?rev=3D164404&view=3Dauto =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/network/trunk/src/java/org/apache/mina/io/handler/package.htm= l (added) +++ directory/network/trunk/src/java/org/apache/mina/io/handler/package.htm= l Sat Apr 23 10:43:26 2005 @@ -0,0 +1,8 @@ + + + + + +Useful IoHandler implementations. + + Propchange: directory/network/trunk/src/java/org/apache/mina/io/handler/pac= kage.html ---------------------------------------------------------------------------= --- svn:keywords =3D HeadURL Id LastChangedBy LastChangedDate LastChangedRe= vision Modified: directory/network/trunk/src/java/org/apache/mina/protocol/Abstrac= tProtocolHandlerFilterChain.java URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apa= che/mina/protocol/AbstractProtocolHandlerFilterChain.java?rev=3D164404&r1= =3D164403&r2=3D164404&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/network/trunk/src/java/org/apache/mina/protocol/AbstractProto= colHandlerFilterChain.java (original) +++ directory/network/trunk/src/java/org/apache/mina/protocol/AbstractProto= colHandlerFilterChain.java Sat Apr 23 10:43:26 2005 @@ -1,3 +1,21 @@ +/* + * @(#) $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 impli= ed. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ package org.apache.mina.protocol; =20 import java.util.ArrayList; @@ -10,6 +28,25 @@ import org.apache.mina.common.IdleStatus; import org.apache.mina.protocol.ProtocolHandlerFilter.NextFilter; =20 +/** + * An abstract implementation of {@link ProtocolHandlerFilterChain} that p= rovides + * common operations for developers to extend protocol layer. + *

+ * All methods has been implemented. The list of filters is maintained + * as a doublely linked list. You can fire any MINA events which is filte= red + * by this chain using these public methods: + *

    + *
  • + *
+ *=20 + * The only method a developer should implement is {@link #doWrite(Protoco= lSession, Object)}. + * This method is invoked when filter chain is evaluated for + * {@link ProtocolHandlerFilter#filterWrite(NextFilter, ProtocolSession, O= bject)} and=20 + * finally to be written out. + *=20 + * @author The Apache Directory Project + * @version $Rev$, $Date$ + */ public abstract class AbstractProtocolHandlerFilterChain implements Protoc= olHandlerFilterChain { private final ProtocolHandlerFilter HEAD_FILTER =3D new ProtocolHandle= rFilter() Modified: directory/network/trunk/xdocs/index.xml URL: http://svn.apache.org/viewcvs/directory/network/trunk/xdocs/index.xml?= rev=3D164404&r1=3D164403&r2=3D164404&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/network/trunk/xdocs/index.xml (original) +++ directory/network/trunk/xdocs/index.xml Sat Apr 23 10:43:26 2005 @@ -68,6 +68,11 @@ Client + HTTP server<= /td> + Stream-based I/O support. + Server + + Tennis In-VM pipe support in protocol layer. Both