Interface MultiTenantAwareComponent

All Superinterfaces:
DescribableComponent
All Known Subinterfaces:
TenantComponentProvider<T>
All Known Implementing Classes:
AxonServerTenantEventStorageEngineFactory, AxonServerTenantSnapshotStoreFactory, MultiTenantAxonServerCommandBusConnector, MultiTenantAxonServerQueryBusConnector, MultiTenantEventStorageEngine, MultiTenantPersistentStreamEventSource, TenantScopedCache

public interface MultiTenantAwareComponent extends DescribableComponent
Interface for components that can be registered with a TenantProvider.
Since:
4.6.0
Author:
Stefan Dragisic
  • Method Details

    • registerTenant

      Registration registerTenant(TenantDescriptor tenantDescriptor)
      Registers the given tenantDescriptor as a known tenant with this multi-tenant aware component.

      The caller must retain the returned Registration and cancel it when the tenant is removed, since releasing the component's per-tenant resources rides on that cancellation.

      Parameters:
      tenantDescriptor - The TenantDescriptor to register with this component.
      Returns:
      A Registration used to deregister the given tenantDescriptor.
    • registerAndStartTenant

      Registration registerAndStartTenant(TenantDescriptor tenantDescriptor)
      Registers the given tenantDescriptor as a known tenant with this multi-tenant aware component. If applicable, this task will construct a tenant segment and start it.
      Parameters:
      tenantDescriptor - The TenantDescriptor to register with this component.
      Returns:
      A Registration used to deregister the given tenantDescriptor.