directory-dev mailing list archives

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

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

1. IoHandlerFilter and ProtocolHandlerFilter is added.


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:

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(""));

You can add ProtocolHandlerFilters to IoAdapter of course:

Acceptor acceptor = new TcpAcceptor();
IoAdapter ioAdapter = new IoAdapter();
acceptor.bind(new InetSocketAddress(8080), ioAdapter.adapt(new
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.

what we call human nature is actually human habit

View raw message