Home / Class/ WorldClockClient Class — netty Architecture

WorldClockClient Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  7176b634_bea9_f9ba_767d_a434f542eb50["WorldClockClient"]
  2723fe84_9bcf_7409_8323_1200dd4af0b7["WorldClockClient.java"]
  7176b634_bea9_f9ba_767d_a434f542eb50 -->|defined in| 2723fe84_9bcf_7409_8323_1200dd4af0b7
  7c11d884_969e_f111_52dc_ed8df65ceaf1["main()"]
  7176b634_bea9_f9ba_767d_a434f542eb50 -->|method| 7c11d884_969e_f111_52dc_ed8df65ceaf1

Relationship Graph

Source Code

example/src/main/java/io/netty/example/worldclock/WorldClockClient.java lines 34–72

public final class WorldClockClient {

    static final String HOST = System.getProperty("host", "127.0.0.1");
    static final int PORT = Integer.parseInt(System.getProperty("port", "8463"));
    static final List<String> CITIES = Arrays.asList(System.getProperty(
            "cities", "Asia/Seoul,Europe/Berlin,America/Los_Angeles").split(","));

    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 WorldClockClientInitializer(sslCtx));

            // Make a new connection.
            Channel ch = b.connect(HOST, PORT).sync().channel();

            // Get the handler instance to initiate the request.
            WorldClockClientHandler handler = ch.pipeline().get(WorldClockClientHandler.class);

            // Request and get the response.
            List<String> response = handler.getLocalTimes(CITIES);

            // Close the connection.
            ch.close();

            // Print the response at last but not least.
            for (int i = 0; i < CITIES.size(); i ++) {
                System.out.format("%28s: %s%n", CITIES.get(i), response.get(i));
            }
        } finally {
            group.shutdownGracefully();
        }
    }
}

Frequently Asked Questions

What is the WorldClockClient class?
WorldClockClient is a class in the netty codebase, defined in example/src/main/java/io/netty/example/worldclock/WorldClockClient.java.
Where is WorldClockClient defined?
WorldClockClient is defined in example/src/main/java/io/netty/example/worldclock/WorldClockClient.java at line 34.

Analyze Your Own Codebase

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

Try Supermodel Free