Class AbstractLazyService
- java.lang.Object
-
- com.couchbase.client.core.state.AbstractStateMachine<LifecycleState>
-
- com.couchbase.client.core.service.AbstractDynamicService
-
- com.couchbase.client.core.service.AbstractLazyService
-
- All Implemented Interfaces:
Service
,Stateful<LifecycleState>
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.- Since:
- 1.1.2
- Author:
- Michael Nitschinger
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.couchbase.client.core.service.Service
Service.EndpointFactory
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractLazyService(String hostname, String bucket, String username, String password, int port, CoreContext ctx, Service.EndpointFactory endpointFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
dispatch(CouchbaseRequest request)
-
Methods inherited from class com.couchbase.client.core.service.AbstractDynamicService
connect, createEndpoint, diagnostics, disconnect, endpoints, endpointStates, logIdent, mapping, send, whenState
-
Methods inherited from class com.couchbase.client.core.state.AbstractStateMachine
hasSubscribers, isState, state, states, transitionState
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.couchbase.client.core.state.Stateful
hasSubscribers, isState, state, states
-
-
-
-
Constructor Detail
-
AbstractLazyService
protected AbstractLazyService(String hostname, String bucket, String username, String password, int port, CoreContext ctx, Service.EndpointFactory endpointFactory)
-
-
Method Detail
-
dispatch
protected void dispatch(CouchbaseRequest request)
- Specified by:
dispatch
in classAbstractDynamicService
-
-