Package org.apache.storm.messaging.netty
Class Context
- java.lang.Object
-
- org.apache.storm.messaging.netty.Context
-
-
Constructor Summary
Constructors Constructor Description Context()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IConnectionbind(String stormId, int port, IConnectionCallback cb, Supplier<Object> newConnectionResponse)establish a server with a binding port.IConnectionconnect(String stormId, String host, int port, AtomicBoolean[] remoteBpStatus)establish a connection to a remote server.voidprepare(Map<String,Object> topoConf)initialization per Storm configuration.voidprepare(Map<String,Object> topoConf, StormMetricRegistry metricRegistry)This method is invoked at the startup of messaging plugin.voidterm()terminate this context.
-
-
-
Method Detail
-
prepare
public void prepare(Map<String,Object> topoConf, StormMetricRegistry metricRegistry)
Description copied from interface:IContextThis method is invoked at the startup of messaging plugin.
-
bind
public IConnection bind(String stormId, int port, IConnectionCallback cb, Supplier<Object> newConnectionResponse)
establish a server with a binding port.- Specified by:
bindin interfaceIContext- Parameters:
stormId- topology IDport- port #cb- The callback to deliver received messages tonewConnectionResponse- 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.
-
-