Class NettyConnector

    • Method Detail

      • getChannelGroup

        public io.netty.channel.group.ChannelGroup getChannelGroup()
      • isServerConnection

        public boolean isServerConnection()
      • start

        public void start()
        Description copied from interface: Connector
        starts the connector
      • close

        public void close()
        Description copied from interface: Connector
        closes the connector
      • isStarted

        public boolean isStarted()
        Description copied from interface: Connector
        returns true if the connector is started, oterwise false.
        Returns:
        true if the connector is started
      • createConnection

        public Connection createConnection()
        Description copied from interface: Connector
        Create and return a connection from this connector.

        This method must NOT throw an exception if it fails to create the connection (e.g. network is not available), in this case it MUST return null

        Returns:
        The connection, or null if unable to create a connection (e.g. network is unavailable)
      • createConnection

        public final Connection createConnection​(Consumer<io.netty.channel.ChannelFuture> onConnect)
        Create and return a connection from this connector.

        This method must NOT throw an exception if it fails to create the connection (e.g. network is not available), in this case it MUST return null.
        This version can be used for testing purposes.

        Parameters:
        onConnect - a callback that would be called right after Bootstrap.connect()
        Returns:
        The connection, or null if unable to create a connection (e.g. network is unavailable)
      • getConnectTimeoutMillis

        public int getConnectTimeoutMillis()
      • setConnectTimeoutMillis

        public void setConnectTimeoutMillis​(int connectTimeoutMillis)
      • isEquivalent

        public boolean isEquivalent​(Map<String,​Object> configuration)
        Description copied from interface: Connector
        If the configuration is equivalent to this connector, which means if the parameter configuration is used to create a connection to a target node, it will be the same node as of the connections made with this connector.
        Returns:
        true means the configuration is equivalent to the connector. false otherwise.
      • getBootStrap

        public io.netty.bootstrap.Bootstrap getBootStrap()
      • clearThreadPools

        public static void clearThreadPools()