Package io.helidon.common.http
Interface ContextualRegistry
-
- All Superinterfaces:
Context
@Deprecated public interface ContextualRegistry extends Context
Deprecated.This class will be replaced withContext
in future Helidon versionsA registry for context objects. Enables instance localization between several services / components / ... integrated in a particular known scope. ContextualRegistry instance is intended to be associated with a scope aware object such as WebServer, ServerRequest or ClientRequest.Context contains also a notion of classifiers. Classifier is any object defining additional key for registered objects. To obtain such registered object, the same classifier (precisely, any equal object) has to be used.
Classifiers can be used as follows:
- As an additional identifier for registered objects of common types, like a
String
, ...
// User detail provider service registry.register("NAME_PARAM_ID", "Smith"); registry.register("GENDER_PARAM_ID", "male"); ... // User consumer service String name = registry.get("name", String.class);
- As an access control mechanism where only owners of the classifier can retrieve such contextual instance.
// In some central security service. registry.register(securityFrameworkInternalInstance, new AuthenticatedInternalIdentity(...)); ... // In some authorization filter known by a central security service AuthenticatedInternalIdentity auth = registry.get(securityFrameworkInternalInstance, AuthenticatedInternalIdentity.class);
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ContextualRegistry.Builder
Deprecated.Fluent API builder forContextualRegistry
.
-
Method Summary
All Methods Static Methods Deprecated Methods Modifier and Type Method Description static ContextualRegistry.Builder
builder()
Deprecated.used for backward compatibility onlystatic ContextualRegistry
create()
Deprecated.useContext.create()
static ContextualRegistry
create(Context parent)
Deprecated.
-
-
-
Method Detail
-
create
@Deprecated static ContextualRegistry create()
Deprecated.useContext.create()
Creates a new empty instance.- Returns:
- new instance
-
create
@Deprecated static ContextualRegistry create(Context parent)
Deprecated.Creates a new empty instance backed by its parent read-throughContextualRegistry
.Parent
registry
is used only for get methods and only if this registry doesn't have registered required type.- Parameters:
parent
- a parent registry- Returns:
- new instance
-
builder
@Deprecated static ContextualRegistry.Builder builder()
Deprecated.used for backward compatibility onlyFluent API builder for advanced configuration.- Returns:
- a new builder
-
-