@groovy.transform.CompileStatic protected static class Tenants.CurrentTenant extends java.lang.Object
Modifiers | Name | Description |
---|---|---|
private static java.lang.ThreadLocal<java.io.Serializable> |
currentTenantThreadLocal |
Constructor and description |
---|
Tenants.CurrentTenant
() |
Type Params | Return Type | Name and description |
---|---|---|
|
static java.io.Serializable |
get()
|
|
private static void |
remove() |
|
private static void |
set(java.io.Serializable tenantId) Set the current tenant |
<T> |
static T |
withTenant(java.io.Serializable tenantId, groovy.lang.Closure<T> callable) Execute with the current tenant |
<T> |
static T |
withoutTenant(groovy.lang.Closure<T> callable) Execute without current tenant |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Set the current tenant
tenantId
- The tenant idExecute with the current tenant
callable
- The closureExecute without current tenant
callable
- The closure