Package com.couchbase.client.core
Class CoreContext
- java.lang.Object
-
- com.couchbase.client.core.cnc.AbstractContext
-
- com.couchbase.client.core.CoreContext
-
- All Implemented Interfaces:
Context
- Direct Known Subclasses:
EndpointContext
,IoContext
,NodeContext
,ObserveContext
,RequestContext
,ServiceContext
public class CoreContext extends AbstractContext
TheCoreContext
is bound to a core and provides both exportable and usable state for the rest of the application to use.- Since:
- 2.0.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.couchbase.client.core.cnc.Context
Context.ExportFormat
-
-
Constructor Summary
Constructors Constructor Description CoreContext(Core core, long id, CoreEnvironment env)
Creates a newCoreContext
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Core
core()
CoreEnvironment
environment()
The attached environment for this core.long
id()
A (app local) unique ID per core instance.protected void
injectExportableParams(Map<String,Object> input)
This method needs to be implemented by the actual context implementations to inject the params they need for exporting.-
Methods inherited from class com.couchbase.client.core.cnc.AbstractContext
exportAsString, toString
-
-
-
-
Constructor Detail
-
CoreContext
public CoreContext(Core core, long id, CoreEnvironment env)
Creates a newCoreContext
.- Parameters:
id
- the core id.env
- the core environment.
-
-
Method Detail
-
id
public long id()
A (app local) unique ID per core instance.- Returns:
- the app local id.
-
environment
public CoreEnvironment environment()
The attached environment for this core.- Returns:
- the core environment attached.
-
core
public Core core()
-
injectExportableParams
protected void injectExportableParams(Map<String,Object> input)
Description copied from class:AbstractContext
This method needs to be implemented by the actual context implementations to inject the params they need for exporting.- Overrides:
injectExportableParams
in classAbstractContext
- Parameters:
input
- pass exportable params in here.
-
-