@groovy.transform.PackageScope @groovy.transform.CompileStatic class CurrentTenant extends java.lang.Object
Holds a reference to the current tenant for the thread
| Modifiers | Name | Description |
|---|---|---|
private static java.lang.ThreadLocal<java.io.Serializable> |
currentTenantThreadLocal |
| Constructor and description |
|---|
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 |
| 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 closure