org.elasticsearch.transport
Class TransportService
java.lang.Object
org.elasticsearch.util.component.AbstractComponent
org.elasticsearch.util.component.AbstractLifecycleComponent<TransportService>
org.elasticsearch.transport.TransportService
- All Implemented Interfaces:
- CloseableComponent, LifecycleComponent<TransportService>
public class TransportService
- extends AbstractLifecycleComponent<TransportService>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TransportService
public TransportService(Transport transport,
ThreadPool threadPool)
TransportService
@Inject
public TransportService(Settings settings,
Transport transport,
ThreadPool threadPool)
doStart
protected void doStart()
throws ElasticSearchException
- Specified by:
doStart
in class AbstractLifecycleComponent<TransportService>
- Throws:
ElasticSearchException
doStop
protected void doStop()
throws ElasticSearchException
- Specified by:
doStop
in class AbstractLifecycleComponent<TransportService>
- Throws:
ElasticSearchException
doClose
protected void doClose()
throws ElasticSearchException
- Specified by:
doClose
in class AbstractLifecycleComponent<TransportService>
- Throws:
ElasticSearchException
addressSupported
public boolean addressSupported(java.lang.Class<? extends TransportAddress> address)
boundAddress
public BoundTransportAddress boundAddress()
nodesAdded
public void nodesAdded(java.lang.Iterable<DiscoveryNode> nodes)
nodesRemoved
public void nodesRemoved(java.lang.Iterable<DiscoveryNode> nodes)
throwConnectException
public void throwConnectException(boolean throwConnectException)
- Set to true to indicate that a
ConnectTransportException
should be thrown when
sending a message (otherwise, it will be passed to the response handler). Defaults to false.
This is useful when logic based on connect failure is needed without having to wrap the handler,
for example, in case of retries across several nodes.
submitRequest
public <T extends Streamable> TransportFuture<T> submitRequest(DiscoveryNode node,
java.lang.String action,
Streamable message,
TransportResponseHandler<T> handler)
throws TransportException
- Throws:
TransportException
sendRequest
public <T extends Streamable> void sendRequest(DiscoveryNode node,
java.lang.String action,
Streamable message,
TransportResponseHandler<T> handler)
throws TransportException
- Throws:
TransportException
registerHandler
public void registerHandler(ActionTransportRequestHandler handler)
registerHandler
public void registerHandler(java.lang.String action,
TransportRequestHandler handler)
removeHandler
public void removeHandler(java.lang.String action)