@PublicEvolving public interface Factory
A factory is uniquely identified by Class and identifier().
The list of available factories is discovered using Java's Service Provider Interfaces (SPI).
Classes that implement this interface can be added to META_INF/services/Factory in JAR
files.
Every factory declares a set of required and optional options. This information will not be used during discovery but is helpful when generating documentation and performing validation. A factory may discover further (nested) factories, the options of the nested factories must not be declared in the sets of this factory.
It is the responsibility of each factory to perform validation before returning an instance.
| 限定符和类型 | 接口和说明 |
|---|---|
static interface |
Factory.Context
Provides session information describing the factory to be accessed.
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
identifier()
Returns a unique identifier among same factory interfaces.
|
Set<ConfigOption<?>> |
optionalOptions()
Returns a set of
ConfigOption that an implementation of this factory consumes in
addition to requiredOptions(). |
Set<ConfigOption<?>> |
requiredOptions()
Returns a set of
ConfigOption that an implementation of this factory requires in
addition to optionalOptions(). |
String identifier()
Set<ConfigOption<?>> requiredOptions()
ConfigOption that an implementation of this factory requires in
addition to optionalOptions().Set<ConfigOption<?>> optionalOptions()
ConfigOption that an implementation of this factory consumes in
addition to requiredOptions().Copyright © 2025 The Apache Software Foundation. All rights reserved.