Class AbstractService

java.lang.Object
de.hybris.platform.servicelayer.internal.service.AbstractService
All Implemented Interfaces:
Serializable, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
AbstractBusinessService, AbstractModelService, DefaultClusterService, DefaultConfigurationService, DefaultEnumerationService, DefaultEventService, DefaultGenericSearchService, DefaultLocalizationService, DefaultSessionService, DefaultSSOService, DefaultTenantService, MockClusterService

public abstract class AbstractService extends Object implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.BeanNameAware, Serializable
This abstract class AbstractService is the super class for all services in the hybris platform. Those subclasses can be divided into the core services and the AbstractBusinessService classes for everything else. This class implements the BeanNameAware interface (therefore each service knows its bean name) and the InitializingBean interface (set the correct tenant in the service).

The main purpose of this class is for de~/serializing the services.

Since:
4.0.3
See Also:
  • Field Details

    • tenant

      @Deprecated(since="5.0", forRemoval=true) protected volatile Tenant tenant
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 5.0
      This property is left for compilation backward compatibility. Any write to it has no effect won't reflect to service behaviour. For reading current tenant use {#getCurrentTenant} instead.
  • Constructor Details

    • AbstractService

      public AbstractService()
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Invoked by a BeanFactory after it has set all bean properties supplied. Overwrite this method for adding/implementing additional code into the service. Important note: Please call always super.afterPropertiesSet() before or the java serialization won't work.
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
      See Also:
      • InitializingBean.afterPropertiesSet()
    • setCurrentTenant

      public void setCurrentTenant(Tenant currentTenant)
    • getCurrentTenant

      protected Tenant getCurrentTenant()
    • setBeanName

      public void setBeanName(String name)
      Sets the bean name of the current class. Called by the Spring framework.
      Specified by:
      setBeanName in interface org.springframework.beans.factory.BeanNameAware
    • writeReplace

      public Object writeReplace() throws ObjectStreamException
      Used by the Java serialization mechanism. Instead of writing the current service class instance to the stream the (static) class object AbstractService.SerializableDTO is written. This object contains the used Tenant and the current bean name.
      Throws:
      ObjectStreamException