java.lang.Object
me.ahoo.cosid.runtime.RuntimeOptions
What a
CosIdRuntime starts with besides its RuntimeSpec: everything that is not configuration.
Immutable; built with builder(), the only way to create one, so fields can be added with a default
(api-freeze.md ยง4); toBuilder() changes one.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic RuntimeOptions.Builderbuilder()A builder starting from the defaults (defaults()).clients()Existing client objects by store name, passed asStoreConfig.client.codecs()ResolvesCodecSpec.Customreferences.booleanWhether to count the ids each generator issues through the views the runtime hands out (CosIdRuntime.generated(String)).static RuntimeOptionsdefaults()The system clock, an own executor, no listener, providers fromServiceLoaderonly, no clients, the local host, no port, custom codecs by class name, no custom generators, no counting.booleanexecutor()Runs refills and renewals.ResolvesGeneratorSpec.Customreferences (D41).inthashCode()The host of a derived owner key.listener()The event listener.port()The port of a derived owner key,host:port.Providers besides thoseServiceLoaderfinds; they win for the same type.time()The time source.A builder holding these options, to change them.toString()
-
Method Details
-
builder
A builder starting from the defaults (defaults()).- Returns:
- the builder
-
defaults
The system clock, an own executor, no listener, providers fromServiceLoaderonly, no clients, the local host, no port, custom codecs by class name, no custom generators, no counting.- Returns:
- the default options
-
toBuilder
A builder holding these options, to change them.- Returns:
- the builder
-
time
The time source.- Returns:
- the time source; default
TimeSource.SYSTEM
-
executor
Runs refills and renewals.- Returns:
- the executor; when empty (the default) the runtime creates a virtual thread executor and closes it
-
listener
The event listener.- Returns:
- the listener; default
GeneratorListener.NOOP
-
storeProviders
Providers besides thoseServiceLoaderfinds; they win for the same type.- Returns:
- the providers, unmodifiable; default none
-
clients
Existing client objects by store name, passed asStoreConfig.client.- Returns:
- the clients, unmodifiable; default none
-
hostResolver
The host of a derived owner key.- Returns:
- the resolver; default
HostResolver.LOCAL
-
port
The port of a derived owner key,host:port.- Returns:
- the port; when empty (the default) the owner key is
host:pid
-
codecs
ResolvesCodecSpec.Customreferences.- Returns:
- the resolver, empty for an unknown reference; default by class name
-
generators
ResolvesGeneratorSpec.Customreferences (D41).- Returns:
- the resolver, empty for an unknown reference; by default always empty, so a custom reference fails the start
-
countGenerated
public boolean countGenerated()Whether to count the ids each generator issues through the views the runtime hands out (CosIdRuntime.generated(String)).- Returns:
- whether to count; off by default, which leaves the hot path unchanged
-
equals
-
hashCode
public int hashCode() -
toString
-