Class AbstractJMXMBean.TenantAwareExecutor<T>
- java.lang.Object
-
- de.hybris.platform.jmx.mbeans.impl.AbstractJMXMBean.TenantAwareExecutor<T>
-
- Type Parameters:
T- - the return type
- Enclosing class:
- AbstractJMXMBean
protected abstract class AbstractJMXMBean.TenantAwareExecutor<T> extends java.lang.ObjectInner tenant aware executor class. This claas deals with the
The following example shows how to use this inner class:AbstractJMXMBean.activateTenant()andAbstractJMXMBean.deactivateTenant()calls.
<code> public Integer getMaxAllowedSize() { <b>return</b> new TenantAwareExecutor<Integer>() { protected Integer doExecute() { <b>return</b> Integer.valueOf(Registry.getCurrentTenant().getCache().getMaxAllowedSize()); } }.getResult(); } </code>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTenantAwareExecutor()callsperform()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract TdoExecute()The content of this method will run with activated tenant and the tenant will always deactivated afterward.protected TenantgetCurrentTenant()TgetResult()
-
-
-
Constructor Detail
-
TenantAwareExecutor
protected TenantAwareExecutor()
callsperform()
-
-
Method Detail
-
getResult
public T getResult()
- Returns:
- the result of the
doExecute()operation.
-
getCurrentTenant
protected final Tenant getCurrentTenant()
-
doExecute
protected abstract T doExecute()
The content of this method will run with activated tenant and the tenant will always deactivated afterward.- Returns:
- your result
-
-