public abstract class AbstractLazyService extends AbstractDynamicService
This service lazily creates an Endpoint if needed and reuses it.
If no storedEndpoint is currently found, a new one is created and stored - the request is dispatched to it. When subsequent requests come along they are dispatched to the same storedEndpoint. If the storedEndpoint dies for some reason it is cleaned up and a new one is created on the next attempt.
Service.EndpointFactory
Constructor and Description |
---|
AbstractLazyService(String hostname,
String bucket,
String password,
int port,
CoreEnvironment env,
com.lmax.disruptor.RingBuffer<ResponseEvent> responseBuffer,
Service.EndpointFactory endpointFactory) |
Modifier and Type | Method and Description |
---|---|
protected void |
dispatch(CouchbaseRequest request) |
connect, createEndpoint, disconnect, endpoints, endpointStates, logIdent, mapping, send, whenState
hasSubscribers, isState, state, states, transitionState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasSubscribers, isState, state, states
public AbstractLazyService(String hostname, String bucket, String password, int port, CoreEnvironment env, com.lmax.disruptor.RingBuffer<ResponseEvent> responseBuffer, Service.EndpointFactory endpointFactory)
protected void dispatch(CouchbaseRequest request)
dispatch
in class AbstractDynamicService
Copyright © 2017 Couchbase, Inc.. All rights reserved.