directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trustin Lee <trus...@gmail.com>
Subject [mina] Current status
Date Sun, 19 Dec 2004 10:03:18 GMT
Hi.

I added/applied bunch of features and fixes to MINA today.  This post
summarizes them.

1. IoHandlerFilter and ProtocolHandlerFilter is added.

http://svn.apache.org/viewcvs.cgi/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java?rev=122724&view=auto

and

http://svn.apache.org/viewcvs.cgi/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilter.java?rev=122724&view=auto

They are very similar to that of Servlet filters as you see.  Adapter
classes are also provided to let user filter required events only
easily.  Here is a blacklist filter:

http://svn.apache.org/viewcvs.cgi/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java?rev=122739&view=auto

Acceptor, Connector, and IoAdapter provides addFilter(...) and
removeFilter(...) methods and you can add or remove filters at any
time.  Here is an example:

Acceptor acceptor = new TcpAcceptor();
acceptor.bind(new InetSocketAddress(8080), new MyIoHandler());
BlacklistFilter filter = new BlacklistFilter();
acceptor.addFilter(10, filter); // 10 is a priority number.
filter.block(new InetAddress("192.168.0.1"));

You can add ProtocolHandlerFilters to IoAdapter of course:

Acceptor acceptor = new TcpAcceptor();
IoAdapter ioAdapter = new IoAdapter();
acceptor.bind(new InetSocketAddress(8080), ioAdapter.adapt(new
MyProtocolProvider()));
ioAdapter.addFilter(0, new MyCoolProtocolFilter());


2. There is no need to explicitly start/stop I/O threads.

I/O threads starts when there are any channels to handle, and they
stops when there are no channels to do.  So convenient, eh? :)


Now I'll implement thread-pool which is IoHandlerFilter and
ProtocolHandlerFilter sooner or later.  If once done, we could
benchmark and profile MINA with lots of clients and tune her. 
Actually I don't have much experience with benchmarking massively by
myself.  Is there anyone who can help me?  I need some URLs of tools
and articles about it.

Cheers,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/

Mime
View raw message