K - key typepublic interface Container<K>
The source container used to store the provided data objects.
The data source that can be used to complete the assembly operation.
Any Map set object method that can accept the key value set
and return grouping by key value can be used as a data source.
Lifecycle
All container instances support registering callback functions during specific stages of their lifecycle, including:
ContainerDefinition instance to the ContainerManager;
ContainerDefinition to an actual instance;
ContainerDefinition;
ContainerLifecycleProcessor(for all containers)
or implementing Container.Lifecycle(for specified container class),
users can perceive these specific stages and perform modifications and replacement operations on the container.
Manger
Containers are typically not used directly in specific operations,
but rather managed by a designated ContainerManager that handles the creation,
usage, and destruction process.
This allows the associated ContainerLifecycleProcessor to fully handle the container's lifecycle.
When delegating the container to the manager,
you can directly register an instance or a factory method used to create the instance with the manager.
Alternatively, you can register a ContainerProvider,
allowing the container to automatically complete the registration logic when necessary,
similar to the internal BeanFactory in Spring, where beans are created using FactoryBean.
ContainerManager,
ContainerLifecycleProcessor,
LambdaContainer,
MethodInvokerContainer,
EmptyContainer,
CacheableContainer| 限定符和类型 | 接口和说明 |
|---|---|
static interface |
Container.Lifecycle
Simple lifecycle callback of container
|
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
EMPTY_CONTAINER_NAMESPACE
Namespace of empty container.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static <K> Container<K> |
empty()
Get an empty data source container.
|
Map<K,?> |
get(Collection<K> keys)
Enter a batch of key values to return data source objects grouped by key values.
|
String |
getNamespace()
Gets the namespace of the data source container,
which should be globally unique.
|
static final String EMPTY_CONTAINER_NAMESPACE
Namespace of empty container.
empty(),
EmptyContainer,
常量字段值static <K> Container<K> empty()
Get an empty data source container.
When an assembly operation specifies to use the data source container,
the operation object itself will be used as the data source object.
EmptyContainerString getNamespace()
Map<K,?> get(Collection<K> keys)
keys - keysCopyright © 2024. All rights reserved.