eXo Kernel :: Container 2.4.11-UXP01

org.exoplatform.container.multitenancy
Interface TenantsService

All Known Implementing Classes:
TenantsServiceImpl

public interface TenantsService

Provides convenient methods to get an information about Current Tenant and provides support for multi-tenant capable services.

Author:
Peter Nedonosko

Method Summary
 void addListener(TenantsStateListener listener)
          Add listener for Tenant events in Multitenancy sub-system.
 Tenant getCurrentTanant()
          Return Current Tenant or throws an exception if Current Tenant not set in current thread.
 boolean hasCurrentTanant()
          Answers if Current Tenant is set in current thread.
 void removeListener(TenantsStateListener listener)
          Remove Tenant events listener from Multitenancy sub-system.
 

Method Detail

getCurrentTanant

Tenant getCurrentTanant()
                        throws CurrentTenantNotSetException
Return Current Tenant or throws an exception if Current Tenant not set in current thread. Current Tenant can be not set in two cases: In both cases an application should not rely on multitenant environment in this thread.

Returns:
Tenant Current Tenant descriptor.
Throws:
CurrentTenantNotSetException - if Current Tenant not found or not set.

hasCurrentTanant

boolean hasCurrentTanant()
Answers if Current Tenant is set in current thread. See #getCurrentTenant() for details.

Returns:
boolean, true if current tenant is set in current thread, false otherwise.
See Also:
#getCurrentTenant()

addListener

void addListener(TenantsStateListener listener)
Add listener for Tenant events in Multitenancy sub-system. Added listener later can be removed by removeListener(TenantsStateListener) method.

Parameters:
listener - TenantsStateListener

removeListener

void removeListener(TenantsStateListener listener)
Remove Tenant events listener from Multitenancy sub-system.
Take in account that it's possible to remove only explicitly added listeners. Listeners available as components in eXo Container don't affected by this method.

Parameters:
listener - TenantsStateListener

eXo Kernel :: Container 2.4.11-UXP01

Copyright © 2014 eXo Platform SAS. All Rights Reserved.