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 Object

Inner tenant aware executor class. This claas deals with the AbstractJMXMBean.activateTenant() and AbstractJMXMBean.deactivateTenant() calls.

The following example shows how to use this inner class:

 <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 Details

    • TenantAwareExecutor

      protected TenantAwareExecutor()
      calls perform()
  • Method Details

    • 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