Go to file
Eric Anderson 6dbb610f5b Add ChannelHandlerContext.invoker()
Motivation:

Being able to access the invoker() is useful when adding additional
handlers that should be running in the same thread. Since an application
may be using a threading model unsupported by the default invoker, they
can specify their own. Because of that, in a handler that auto-adds
other handlers:

// This is a good pattern
ctx.pipeline().addBefore(ctx.invoker(), ctx.name(), null, newHandler);
// This will generally work, but prevents using custom invoker.
ctx.pipeline().addBefore(ctx.executor(), ctx.name(), null, newHandler);

That's why I believe in commit 110745b0, for the now-defunct 5.0 branch,
when ChannelHandlerAppender was added the invoker() method was also
necessary.

There is a side-benefit to exposing the invoker: in certain advanced
use-cases using the invoker for a particular handler is useful. Using
the invoker you are able to invoke a _particular_ handler, from possibly
a different thread yet still using standard exception processing.

ChannelHandlerContext does part of that, but is unwieldy when trying to
invoke a particular handler because it invokes the prev or next handler,
not the one the context is for. A workaround is to use the next or prev
context (respectively), but this breaks when the pipeline changes.

This came up during writing the Http2MultiplexCodec which uses a
separate child channel for each http/2 stream and wants to send messages
from the child channel directly to the Http2MultiplexCodec handler that
created it.

Modifications:

Add the invoker() method to ChannelHandlerContext. It was already being
implemented by AbstractChannelHandlerContext. The two other
implementations of ChannelHandlerContext needed minor tweaks.

Result:

Access to the invoker used for a particular handler, for either reusing
for other handlers or for advanced use-cases. Fixes #4738
2016-01-22 14:04:35 +01:00
all [maven-release-plugin] prepare for next development iteration 2015-11-10 22:59:33 +01:00
buffer [#4017] Implement proper resource leak detection for CompositeByteBuf 2016-01-18 10:14:39 +01:00
codec Change 64 to 63 in Snappy.decodeLiteral 2016-01-21 09:59:10 +01:00
codec-dns Make codec-dns can support build a dns server, reply answer from client. 2016-01-18 16:41:44 +09:00
codec-haproxy [maven-release-plugin] prepare for next development iteration 2015-11-10 22:59:33 +01:00
codec-http Let CombinedChannelDuplexHandler correctly handle exceptionCaught. Related to [#4528] 2016-01-18 09:54:48 +01:00
codec-http2 Log the current channel in Http2FrameLogger 2016-01-18 10:52:08 +01:00
codec-memcache Let CombinedChannelDuplexHandler correctly handle exceptionCaught. Related to [#4528] 2016-01-18 09:54:48 +01:00
codec-mqtt [maven-release-plugin] prepare for next development iteration 2015-11-10 22:59:33 +01:00
codec-socks [maven-release-plugin] prepare for next development iteration 2015-11-10 22:59:33 +01:00
codec-stomp [maven-release-plugin] prepare for next development iteration 2015-11-10 22:59:33 +01:00
codec-xml [maven-release-plugin] prepare for next development iteration 2015-11-10 22:59:33 +01:00
common PlatformDependent static initialization ExceptionInInitializerError 2016-01-20 06:13:36 -08:00
example Avoid unnecessary boxing/unboxing 2016-01-08 17:38:20 +01:00
handler Ensure we flush out all pending data on SslException. Related to [#3900] 2016-01-20 19:56:24 +01:00
handler-proxy Let CombinedChannelDuplexHandler correctly handle exceptionCaught. Related to [#4528] 2016-01-18 09:54:48 +01:00
license added support for Protobuf codec nano runtime 2016-01-19 21:39:17 +01:00
microbench Add ChannelHandlerContext.invoker() 2016-01-22 14:04:35 +01:00
resolver Fix errors reported by javadoc 2015-12-27 08:36:45 +01:00
resolver-dns Init DnsNameResolverBuilder#nameServerAddresses 2016-01-20 13:38:01 +01:00
tarball [maven-release-plugin] prepare for next development iteration 2015-11-10 22:59:33 +01:00
testsuite Removed unused imports 2016-01-04 14:32:29 +01:00
testsuite-osgi [maven-release-plugin] prepare for next development iteration 2015-11-10 22:59:33 +01:00
transport Add ChannelHandlerContext.invoker() 2016-01-22 14:04:35 +01:00
transport-native-epoll Native Transport Netty Class Package Prefix 2016-01-15 12:55:58 -08:00
transport-rxtx Fix errors reported by javadoc 2015-12-27 08:36:45 +01:00
transport-sctp Improve SctpMessage.hashCode method 2016-01-05 20:30:52 +01:00
transport-udt [maven-release-plugin] prepare for next development iteration 2015-11-10 22:59:33 +01:00
.fbprefs Updated Find Bugs configuration 2009-03-04 10:33:09 +00:00
.gitignore Add JVM crash logs to .gitignore 2014-05-18 21:36:54 +09:00
.travis.yml Travis CI branch whitelisting 2013-03-11 09:55:43 +09:00
CONTRIBUTING.md Move the pull request guide to the developer guide 2014-03-12 13:13:58 +09:00
LICENSE.txt Relicensed to Apache License v2 2009-08-28 07:15:49 +00:00
NOTICE.txt added support for Protobuf codec nano runtime 2016-01-19 21:39:17 +01:00
pom.xml added support for Protobuf codec nano runtime 2016-01-19 21:39:17 +01:00
README.md Fix the 'branches to look' section 2015-10-27 13:59:11 +01:00
run-example.sh Add HTTP/2 Netty tiles example 2015-05-18 14:16:54 -07:00

Netty Project

Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients.

How to build

For the detailed information about building and developing Netty, please visit the developer guide. This page only gives very basic information.

You require the following to build Netty:

Note that this is build-time requirement. JDK 5 (for 3.x) or 6 (for 4.0+) is enough to run your Netty-based application.

Branches to look

The 'master' branch is where the development of the latest major version lives on. The development of all other versions takes place in each branch whose name is identical to <majorVersion>.<minorVersion>. For example, the development of 3.9 and 4.0 resides in the branch '3.9' and the branch '4.0' respectively.