org.glassfish.paas.tenantmanager.api
Interface TenantManager

All Known Subinterfaces:
TenantManagerEx
All Known Implementing Classes:
TenantManagerImpl

@Contract
public interface TenantManager

TenantManager provides access to information about all tenants. It is designed for multi-tenant environment, so keeps track of the currently active tenant, and guarantees access to currently active tenant information. It also provides restricted write access to tenant information as whole. Its implementation uses reentrant lock. CAUTION: Interface is currently evolving and may be changed.

Author:
Andriy Zhdanov

Method Summary
 Object excuteUpdate(org.jvnet.hk2.config.ConfigCode code, org.jvnet.hk2.config.ConfigBeanProxy... objects)
          Executes code on objects protected by a transaction.
<T extends org.jvnet.hk2.config.ConfigBeanProxy>
Object
executeUpdate(org.jvnet.hk2.config.SingleConfigCode<T> code, T object)
          Executes code on object protected by a transaction.
<T> T
get(Class<T> config)
          Get current tenant specific information.
 String getCurrentTenant()
          Get current tenant.
 void setCurrentTenant(String name)
          Get current tenant.
 

Method Detail

get

<T> T get(Class<T> config)
Get current tenant specific information. It is possible to get relevant top level configuration, like Tenant, Environments and Services.

Parameters:
config - Config class.
Returns:
Config.

executeUpdate

<T extends org.jvnet.hk2.config.ConfigBeanProxy> Object executeUpdate(org.jvnet.hk2.config.SingleConfigCode<T> code,
                                                                      T object)
                     throws org.jvnet.hk2.config.TransactionFailure
Executes code on object protected by a transaction. It is wrapper to ConfigBeanSupport.apply and ensures restricted access to tenant information as whole.

Parameters:
code -
object -
Returns:
Throws:
org.jvnet.hk2.config.TransactionFailure

excuteUpdate

Object excuteUpdate(org.jvnet.hk2.config.ConfigCode code,
                    org.jvnet.hk2.config.ConfigBeanProxy... objects)
                    throws org.jvnet.hk2.config.TransactionFailure
Executes code on objects protected by a transaction. It is wrapper to ConfigBeanSupport.apply and ensures restricted access to tenant information as whole.

Parameters:
code -
objects - configurations
Returns:
Throws:
org.jvnet.hk2.config.TransactionFailure

getCurrentTenant

String getCurrentTenant()
Get current tenant.


setCurrentTenant

void setCurrentTenant(String name)
Get current tenant.



Copyright © 2012. All Rights Reserved.