public class TransportService extends AbstractLifecycleComponent<TransportService>
Modifier and Type | Class and Description |
---|---|
protected class |
TransportService.Adapter |
Modifier and Type | Field and Description |
---|---|
static String |
DIRECT_RESPONSE_PROFILE |
static String |
SETTING_TRACE_LOG_EXCLUDE |
static String |
SETTING_TRACE_LOG_INCLUDE |
protected TaskManager |
taskManager |
protected ThreadPool |
threadPool |
protected Transport |
transport |
lifecycle
deprecationLogger, logger, settings
Constructor and Description |
---|
TransportService(Settings settings,
Transport transport,
ThreadPool threadPool) |
TransportService(Transport transport,
ThreadPool threadPool) |
addLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stop
logDeprecatedSetting, logRemovedSetting, nodeName
public static final String DIRECT_RESPONSE_PROFILE
protected final Transport transport
protected final ThreadPool threadPool
protected final TaskManager taskManager
public static final String SETTING_TRACE_LOG_INCLUDE
public static final String SETTING_TRACE_LOG_EXCLUDE
public TransportService(Transport transport, ThreadPool threadPool)
@Inject public TransportService(Settings settings, Transport transport, ThreadPool threadPool)
public void setLocalNode(DiscoveryNode localNode)
public TaskManager getTaskManager()
protected TransportService.Adapter createAdapter()
protected TaskManager createTaskManager()
@Inject(optional=true) public void setDynamicSettings(NodeSettingsService nodeSettingsService)
public void applySettings(Settings settings)
protected void doStart()
doStart
in class AbstractLifecycleComponent<TransportService>
protected void doStop()
doStop
in class AbstractLifecycleComponent<TransportService>
protected void doClose()
doClose
in class AbstractLifecycleComponent<TransportService>
public void acceptIncomingRequests()
public boolean addressSupported(Class<? extends TransportAddress> address)
public TransportInfo info()
public TransportStats stats()
public BoundTransportAddress boundAddress()
public boolean nodeConnected(DiscoveryNode node)
public void connectToNode(DiscoveryNode node) throws ConnectTransportException
ConnectTransportException
public void connectToNodeLight(DiscoveryNode node) throws ConnectTransportException
ConnectTransportException
public void disconnectFromNode(DiscoveryNode node)
public void addConnectionListener(TransportConnectionListener listener)
public void removeConnectionListener(TransportConnectionListener listener)
public <T extends TransportResponse> TransportFuture<T> submitRequest(DiscoveryNode node, String action, TransportRequest request, TransportResponseHandler<T> handler) throws TransportException
TransportException
public <T extends TransportResponse> TransportFuture<T> submitRequest(DiscoveryNode node, String action, TransportRequest request, TransportRequestOptions options, TransportResponseHandler<T> handler) throws TransportException
TransportException
public <T extends TransportResponse> void sendRequest(DiscoveryNode node, String action, TransportRequest request, TransportResponseHandler<T> handler)
public <T extends TransportResponse> void sendRequest(DiscoveryNode node, String action, TransportRequest request, TransportRequestOptions options, TransportResponseHandler<T> handler)
public TransportAddress[] addressesFromString(String address, int perAddressLimit) throws Exception
Exception
public final <Request extends TransportRequest> void registerRequestHandler(String action, Class<Request> request, String executor, TransportRequestHandler<Request> handler)
action
- The action the request handler is associated withrequest
- The request class that will be used to constrcut new instances for streamingexecutor
- The executor the request handling will be executed onhandler
- The handler itself that implements the request handlingpublic <Request extends TransportRequest> void registerRequestHandler(String action, Callable<Request> requestFactory, String executor, TransportRequestHandler<Request> handler)
action
- The action the request handler is associated withrequestFactory
- a callable to be used construct new instances for streamingexecutor
- The executor the request handling will be executed onhandler
- The handler itself that implements the request handlingpublic <Request extends TransportRequest> void registerRequestHandler(String action, Class<Request> request, String executor, boolean forceExecution, TransportRequestHandler<Request> handler)
action
- The action the request handler is associated withrequest
- The request class that will be used to constrcut new instances for streamingexecutor
- The executor the request handling will be executed onforceExecution
- Force execution on the executor queue and never reject ithandler
- The handler itself that implements the request handlingprotected <Request extends TransportRequest> void registerRequestHandler(RequestHandlerRegistry<Request> reg)
public void removeHandler(String action)
protected RequestHandlerRegistry getRequestHandler(String action)
Copyright © 2009–2016. All rights reserved.