public static NettyConnectionHandler createConnectionHandler(ConnectionConfiguration configuration) {
        return switch (configuration.getType()) {
            case SOCKET_S2S -> new NettyServerConnectionHandler(configuration);
            case SOCKET_C2S -> new NettyClientConnectionHandler(configuration);
            case COMPONENT  -> new NettyComponentConnectionHandler(configuration);
            case CONNECTION_MANAGER -> new NettyMultiplexerConnectionHandler(configuration);
            default ->
                throw new IllegalStateException("This implementation does not support the connection type as defined in the provided configuration: " + configuration.getType());
        };
    }
Creates a new NettyConnectionHandler based on the type of connection set in the configuration.
@param configuration options for how the connection is configured
@return a new NettyConnectionHandler
xmppserver/src/main/java/org/jivesoftware/openfire/nio/NettyConnectionHandlerFactory.java