* Updated to the latest version of jdocbook plugin and jbossorg styles

* Writing the getting started chapter...
This commit is contained in:
Trustin Lee 2008-09-19 07:28:48 +00:00
parent ac5a2a2f03
commit b571bdc0e2
2 changed files with 81 additions and 6 deletions

View File

@ -316,7 +316,6 @@
<plugin>
<groupId>org.jboss.maven.plugins</groupId>
<artifactId>maven-jdocbook-plugin</artifactId>
<version>2.0.0</version>
<executions>
<execution>
<id>generate-docbook</id>
@ -331,12 +330,12 @@
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jbossorg-docbook-xslt</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jbossorg-jdocbook-style</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>
<type>jdocbook-style</type>
</dependency>
</dependencies>
@ -352,12 +351,12 @@
<formats>
<format>
<formatName>html</formatName>
<stylesheetResource>classpath:/xslt/org/jboss/main-html.xsl</stylesheetResource>
<stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
<finalName>index.html</finalName>
</format>
<format>
<formatName>html_single</formatName>
<stylesheetResource>classpath:/xslt/org/jboss/nochunk-html.xsl</stylesheetResource>
<stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
<finalName>index.html</finalName>
</format>
</formats>

View File

@ -2,5 +2,81 @@
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.docbook.org/xml/4.5/docbookx.dtd">
<chapter id="start">
<title>Getting Started</title>
<para>To be written...</para>
<para>
This chapter tours around the core constructs of Netty with simple
examples to let you get started with Netty easily. You should be able to
write a network application on top of Netty right away when you are at the
end of this chapter.
</para>
<para>
If you prefer the top-down approach in learning something, you might want
to start from <xref linkend="architecture"/> and get back here.
</para>
<section>
<title>Minimum Requirement</title>
<para>
The minimum requirements to run the examples which are introduced in
this chapter are just two; the latest version of Netty release and JDK
1.5 or above. The latest version of Netty is available in
<ulink url="http://www.jboss.org/netty/downloads.html">the project
download page</ulink>. To get the right version of JDK, please refer to
your preferred JDK vendor's web site.
</para>
<para>
Is that all? To tell the truth, you should find these two are just
enough to implement almost any type of protocols. Otherwise, please
feel free to
<ulink url="http://www.jboss.org/netty/community.html">contact the Netty
project team </ulink> and let us know what's missing.
</para>
</section>
<section>
<title>Writing a Discard Server</title>
<para>
The most simplistic protocol in the world is not 'Hello, World!' but
<ulink url="http://tools.ietf.org/html/rfc863">DISCARD</ulink>. It's
a protocol which discards any received data without any response.
</para>
<para>
What you are supposed to do to implement the DISCARD protocol is to log
the received data, and that's all. Let's start straight from the handler
implementation, which handles I/O events generated by Netty.
</para>
<programlistingco>
<areaspec>
<area id="example.discard.c1" coords="1" />
</areaspec>
<programlisting>package org.jboss.netty.example.discard;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelPipelineCoverage;
import org.jboss.netty.channel.ExceptionEvent;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelHandler;
@ChannelPipelineCoverage("all")
public class DiscardServerHandler extends SimpleChannelHandler {
@Override
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) {
e.getCause().printStackTrace();
e.getChannel().close();
}
}</programlisting>
<calloutlist>
<callout arearefs="example.discard.c1">
<para>
TEST!
</para>
</callout>
</calloutlist>
</programlistingco>
</section>
</chapter>