Chapter 8. Bootstrapping
This chapter covers
- Bootstrapping clients and servers
- Bootstrapping clients from within a Channel
- Adding ChannelHandlers
- Using ChannelOptions and attributes
Having studied ChannelPipelines, ChannelHandlers, and codec classes in depth, your next question is probably, “How do all these pieces add up to a working application?”
The answer? “Bootstrapping.” Up to now, we’ve used the term somewhat vaguely, and the time has come to define it more precisely. Simply stated, bootstrapping an application is the process of configuring it to run—though the details of the process may not be as simple as its definition, especially in network applications.
Consistent with its approach to application architecture, Netty handles bootstrapping in a way that insulates your application, whether client or server, from the network layer. As you’ll see, all of the framework components are connected and enabled in the background. Bootstrapping is the missing piece of the puzzle we’ve been assembling; when you put it in place, your Netty application will be complete.
The bootstrapping class hierarchy consists of an abstract parent class and two concrete bootstrap subclasses, as shown in figure 8.1.