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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classThis is the SerializableDTO (DataTransferObject) for the core services. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked by a BeanFactory after it has set all bean properties supplied.protected TenantvoidsetBeanName(String name) Sets the bean name of the current class.voidsetCurrentTenant(Tenant currentTenant) Used by the Java serialization mechanism.
-
Field Details
-
tenant
Deprecated, for removal: This API element is subject to removal in a future version.since 5.0This 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
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 alwayssuper.afterPropertiesSet()before or the java serialization won't work.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception- See Also:
-
InitializingBean.afterPropertiesSet()
-
setCurrentTenant
-
getCurrentTenant
-
setBeanName
Sets the bean name of the current class. Called by the Spring framework.- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware
-
writeReplace
Used by the Java serialization mechanism. Instead of writing the current service class instance to the stream the (static) class objectAbstractService.SerializableDTOis written. This object contains the usedTenantand the currentbean name.- Throws:
ObjectStreamException
-