org.apache.storm.messaging.netty

## Class Context

- java.lang.Object
- - org.apache.storm.messaging.netty.Context

- All Implemented Interfaces:
    IContext

      public class Context
      extends Object
      implements IContext

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Context()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `IConnection` | `bind(String stormId, int port, IConnectionCallback cb, Supplier<Object> newConnectionResponse)` establish a server with a binding port.
    `IConnection` | `connect(String stormId, String host, int port, AtomicBoolean[] remoteBpStatus)` establish a connection to a remote server.
    `void` | `prepare(Map<String,Object> topoConf)` initialization per Storm configuration.
    `void` | `prepare(Map<String,Object> topoConf, StormMetricRegistry metricRegistry)` This method is invoked at the startup of messaging plugin.
    `void` | `term()` terminate this context.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Context

          public Context()

  - ### Method Detail

    - #### prepare

          public void prepare(Map<String,Object> topoConf)

      initialization per Storm configuration.

      Specified by:
        `prepare` in interface `IContext`
      Parameters:
        `topoConf` - storm configuration

    - #### prepare

          public void prepare(Map<String,Object> topoConf,
                              StormMetricRegistry metricRegistry)

      Description copied from interface: `IContext`

      This method is invoked at the startup of messaging plugin.

      Specified by:
        `prepare` in interface `IContext`
      Parameters:
        `topoConf` - storm configuration
        `metricRegistry` - storm metric registry

    - #### bind

          public IConnection bind(String stormId,
                                  int port,
                                  IConnectionCallback cb,
                                  Supplier<Object> newConnectionResponse)

      establish a server with a binding port.

      Specified by:
        `bind` in interface `IContext`
      Parameters:
        `stormId` - topology ID
        `port` - port #
        `cb` - The callback to deliver received messages to
        `newConnectionResponse` - Supplier of the initial message to send to new client connections. If authentication is required, the message will be sent after authentication is complete.
      Returns:
        server side connection

    - #### connect

          public IConnection connect(String stormId,
                                     String host,
                                     int port,
                                     AtomicBoolean[] remoteBpStatus)

      establish a connection to a remote server.

      Specified by:
        `connect` in interface `IContext`
      Parameters:
        `stormId` - topology ID
        `host` - remote host
        `port` - remote port
        `remoteBpStatus` - array of booleans reflecting Back Pressure status of remote tasks.
      Returns:
        client side connection

    - #### term

          public void term()

      terminate this context.

      Specified by:
        `term` in interface `IContext`

Copyright © 2021 The Apache Software Foundation. All rights reserved.