Package org.apache.storm.messaging.netty
Class Context
java.lang.Object
org.apache.storm.messaging.netty.Context
- All Implemented Interfaces:
IContext
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbind
(String stormId, int port, IConnectionCallback cb, Supplier<Object> newConnectionResponse) establish a server with a binding port.connect
(String stormId, String host, int port, AtomicBoolean[] remoteBpStatus) establish a connection to a remote server.void
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.
-
Constructor Details
-
Context
public Context()
-
-
Method Details
-
prepare
initialization per Storm configuration. -
prepare
Description copied from interface:IContext
This 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:
bind
in 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
establish a connection to a remote server. -
term
public void term()terminate this context.
-