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.SerializableThis abstract class AbstractService is the super class for all services in the hybris platform. Those subclasses can be divided into the core services and theAbstractBusinessServiceclasses for everything else. This class implements theBeanNameAwareinterface (therefore each service knows its bean name) and theInitializingBeaninterface (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 classAbstractService.SerializableDTOThis 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 voidafterPropertiesSet()Invoked by a BeanFactory after it has set all bean properties supplied.protected TenantgetCurrentTenant()voidsetBeanName(java.lang.String name)Sets the bean name of the current class.voidsetCurrentTenant(Tenant currentTenant)java.lang.ObjectwriteReplace()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.ExceptionInvoked 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:
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:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware
-
writeReplace
public java.lang.Object writeReplace() throws java.io.ObjectStreamExceptionUsed 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:
java.io.ObjectStreamException
-
-