Class AbstractService
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.service.AbstractService
-
- All Implemented Interfaces:
java.io.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
,DefaultSECSSOService
,DefaultSessionService
,DefaultSSOService
,DefaultTenantService
,MockClusterService
public abstract class AbstractService extends java.lang.Object implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.BeanNameAware, java.io.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 theAbstractBusinessService
classes for everything else. This class implements theBeanNameAware
interface (therefore each service knows its bean name) and theInitializingBean
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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractService.SerializableDTO
This is the SerializableDTO (DataTransferObject) for the core services.
-
Constructor Summary
Constructors Constructor Description AbstractService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied.protected Tenant
getCurrentTenant()
void
setBeanName(java.lang.String name)
Sets the bean name of the current class.void
setCurrentTenant(Tenant currentTenant)
java.lang.Object
writeReplace()
Used by the Java serialization mechanism.
-
-
-
Field Detail
-
tenant
@Deprecated protected volatile Tenant tenant
Deprecated.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.
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.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 alwayssuper.afterPropertiesSet()
before or the java serialization won't work.- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
- See Also:
InitializingBean.afterPropertiesSet()
-
setCurrentTenant
public void setCurrentTenant(Tenant currentTenant)
-
getCurrentTenant
protected Tenant getCurrentTenant()
-
setBeanName
public void setBeanName(java.lang.String name)
Sets the bean name of the current class. Called by the Spring framework.- Specified by:
setBeanName
in interfaceorg.springframework.beans.factory.BeanNameAware
-
writeReplace
public java.lang.Object writeReplace() throws java.io.ObjectStreamException
Used by the Java serialization mechanism. Instead of writing the current service class instance to the stream the (static) class objectAbstractService.SerializableDTO
is written. This object contains the usedTenant
and the currentbean name
.- Throws:
java.io.ObjectStreamException
-
-