Home / Class/ FactorialClient Class — netty Architecture

FactorialClient Class — netty Architecture

Architecture documentation for the FactorialClient class in FactorialClient.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  fddf5e55_7d11_7a99_f8da_5cedf4577068["FactorialClient"]
  6667a0c6_1243_f2a9_c695_59b5038ac3d4["FactorialClient.java"]
  fddf5e55_7d11_7a99_f8da_5cedf4577068 -->|defined in| 6667a0c6_1243_f2a9_c695_59b5038ac3d4
  0544e424_04a2_5fc6_e8e5_0ce640494bb7["main()"]
  fddf5e55_7d11_7a99_f8da_5cedf4577068 -->|method| 0544e424_04a2_5fc6_e8e5_0ce640494bb7

Relationship Graph

Source Code

example/src/main/java/io/netty/example/factorial/FactorialClient.java lines 31–61

public final class FactorialClient {

    static final String HOST = System.getProperty("host", "127.0.0.1");
    static final int PORT = Integer.parseInt(System.getProperty("port", "8322"));
    static final int COUNT = Integer.parseInt(System.getProperty("count", "1000"));

    public static void main(String[] args) throws Exception {
        // Configure SSL.
        final SslContext sslCtx = ServerUtil.buildSslContext();

        EventLoopGroup group = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());
        try {
            Bootstrap b = new Bootstrap();
            b.group(group)
             .channel(NioSocketChannel.class)
             .handler(new FactorialClientInitializer(sslCtx));

            // Make a new connection.
            ChannelFuture f = b.connect(HOST, PORT).sync();

            // Get the handler instance to retrieve the answer.
            FactorialClientHandler handler =
                (FactorialClientHandler) f.channel().pipeline().last();

            // Print out the answer.
            System.err.format("Factorial of %,d is: %,d", COUNT, handler.getFactorial());
        } finally {
            group.shutdownGracefully();
        }
    }
}

Frequently Asked Questions

What is the FactorialClient class?
FactorialClient is a class in the netty codebase, defined in example/src/main/java/io/netty/example/factorial/FactorialClient.java.
Where is FactorialClient defined?
FactorialClient is defined in example/src/main/java/io/netty/example/factorial/FactorialClient.java at line 31.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free