Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Multitenancy  in in WSO2 Carbon was introduced with the goal of maximizing resource sharing. It could provide tenant isolation, data isolation, execution isolation and performance isolation. The TenantMgtListner interface is an extension that allows a component developer to execute any custom code during the different stages of a tenant’s lifecycle.

In order to use this extension point, a developer needs to implement the TenantMgtListener interface. ThemeLoadingListerner is an example of an implementation of this interface. Following are the methods that needs to need to be overridden:

METHODDESCRIPTION

public void onTenantCreate(TenantInfoBean tenantInfo)

Contains the implementation of tasks that need to be performed after a tenant gets created.

public void onTenantUpdate(TenantInfoBean tenantInfo)

Contains the implementation of tasks that need to be performed whenever a tenant’s information is updated.

public void onTenantDelete(int tenantId)

Contains the implementation of tasks that need to be performed after a tenant is deleted.

public void onTenantRename(int tenantId, String oldDomainName, String newDomainName)

Contains the implementation of tasks that need to be performed after a tenant is renamed.

public void onTenantInitialActivation(int tenantId)

Contains the implementation of tasks that need to be performed when each tenant is activated for the first time.

public void onTenantActivation(int tenantId)

Contains the implementation of tasks that need to be performed when a tenant is activated.

public void onTenantDeactivation(int tenantId)

Contains the implementation of tasks that need to be performed when a tenant is deactivated.

public void onSubscriptionPlanChange(int tenentId, String oldPlan, String newPlan)

Contains the implementation of tasks that need to be performed when a subscription plan changes.

public int getListenerOrder()

Contains the implementation logic for returning the rank of this listener.

public void onPreDelete(int tenantId)

Contains the implementation of tasks that need to be performed before a tenant is deleted

...