@Beta public interface TenantControlFactory
TenantControlobjects when Hazelcast service attaches the tenant control to a distributed object. An implementation of
TenantControlFactoryis instantiated via
ServiceLoader, so in order to be picked up:
- Its class name must be stored in a service definition file in
- It must have a public no-args constructor
Fields Modifier and Type Field Description
NOOP_TENANT_CONTROL_FACTORYDefault tenant control factory.
Modifier and Type Method Description
isClassesAlwaysAvailable()If the method returns false (classes are not always available), all objects, e.g.
saveCurrentTenant()To be called from the application's thread to connect a Hazelcast object with a particular tenant, e.g.
NOOP_TENANT_CONTROL_FACTORYstatic final TenantControlFactory NOOP_TENANT_CONTROL_FACTORYDefault tenant control factory. Always produces
saveCurrentTenantTenantControl saveCurrentTenant()To be called from the application's thread to connect a Hazelcast object with a particular tenant, e.g. JCache-based cache with a particular application Implementor will save the current thread context and return it Further operations from other threads will use the returned context for this particular Hazelcast object to re-establish the invocation context
- new TenantControl instance with the saved state of the current tenant
isClassesAlwaysAvailableboolean isClassesAlwaysAvailable()If the method returns false (classes are not always available), all objects, e.g. CacheConfigs are always sent over the wire in a form that does not require classes to be loaded / available. Objects will be sent using class names instead of class types, and sending byte arrays instead of serialized objects. This is so de-serialization does not fail with ClassNotFoundException
- true is the associated applications are always loaded and running