@@ -0,0 +1,1066 @@
+package biz.deinum.multitenant.context;%0A%0Aimport org.springframework.util.Assert;%0A%0A/**%0A * A %3Ccode%3Estatic%3C/code%3E field-based implementation of %7B@link TenantContextHolderStrategy%7D.%0A * %3Cp%3E%0A * This means that all intances in the JVM share the same %7B@code TenantContext%7D. This is useful%0A * in situation where only a single tenant is required, like in a rich client after selecting the%0A * tenant to use.%0A *%0A * @author M. Deinum%0A * @since 1.3.0%0A */%0Apublic class GlobalTenantContextHolderStrategy implements TenantContextHolderStrategy %7B%0A%0A%09private static TenantContext contextHolder;%0A%0A%09@Override%0A%09public void clearContext() %7B%0A%09%09contextHolder=null;%0A%09%7D%0A%0A%09@Override%0A%09public TenantContext getContext() %7B%0A%09%09if (contextHolder == null) %7B%0A%09%09%09contextHolder = createEmptyContext();%0A%09%09%7D%0A%09%09return contextHolder;%0A%09%7D%0A%0A%09@Override%0A%09public void setContext(TenantContext context) %7B%0A%09%09Assert.notNull(context, %22Only non-null TenantContext instances are permitted%22);%0A%09%09contextHolder = context;%0A%09%7D%0A%0A%09@Override%0A%09public TenantContext createEmptyContext() %7B%0A%09%09return new DefaultTenantContext();%0A%09%7D%0A%7D%0A

Add GlobalTenantContextHolderStrategy