Search in sources :

Example 1 with VaultFactory

use of io.aklivity.zilla.runtime.engine.vault.VaultFactory in project zilla by aklivity.

the class EngineBuilder method build.

public Engine build() {
    final EngineConfiguration config = new EngineConfiguration(this.config != null ? this.config : new Configuration());
    final Set<Binding> bindings = new LinkedHashSet<>();
    final BindingFactory bindingFactory = BindingFactory.instantiate();
    for (String name : bindingFactory.names()) {
        Binding binding = bindingFactory.create(name, config);
        bindings.add(binding);
    }
    final Set<Vault> vaults = new LinkedHashSet<>();
    final VaultFactory vaultFactory = VaultFactory.instantiate();
    for (String name : vaultFactory.names()) {
        Vault vault = vaultFactory.create(name, config);
        vaults.add(vault);
    }
    final ErrorHandler errorHandler = requireNonNull(this.errorHandler, "errorHandler");
    return new Engine(config, bindings, vaults, errorHandler, configURL, affinities);
}
Also used : Binding(io.aklivity.zilla.runtime.engine.binding.Binding) LinkedHashSet(java.util.LinkedHashSet) ErrorHandler(org.agrona.ErrorHandler) VaultFactory(io.aklivity.zilla.runtime.engine.vault.VaultFactory) Vault(io.aklivity.zilla.runtime.engine.vault.Vault) BindingFactory(io.aklivity.zilla.runtime.engine.binding.BindingFactory)

Aggregations

Binding (io.aklivity.zilla.runtime.engine.binding.Binding)1 BindingFactory (io.aklivity.zilla.runtime.engine.binding.BindingFactory)1 Vault (io.aklivity.zilla.runtime.engine.vault.Vault)1 VaultFactory (io.aklivity.zilla.runtime.engine.vault.VaultFactory)1 LinkedHashSet (java.util.LinkedHashSet)1 ErrorHandler (org.agrona.ErrorHandler)1