Class SAPHybrisSessionProvider
java.lang.Object
de.hybris.platform.servicelayer.event.impl.AbstractEventListener<BeforeSessionCloseEvent>
de.hybris.platform.sap.core.runtime.SAPHybrisSessionProvider
- All Implemented Interfaces:
EventListener,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener<BeforeSessionCloseEvent>
public class SAPHybrisSessionProvider
extends de.hybris.platform.servicelayer.event.impl.AbstractEventListener<BeforeSessionCloseEvent>
SAP Hybris Session Provider.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Set<SAPHybrisSessionEventListener>Set of listeners which listens to theSAPHybrisSessionEventListenerinterface.protected GenericFactoryGenericFactoryreference.static final StringAlias of the SAP hybris session.static final StringSession attribute to store the SAP hybris session.protected final Map<de.hybris.platform.servicelayer.session.Session,SAPHybrisSession> Session which are about to be deleted. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDestroys the currentSAPHybrisSession.protected voiddestroySAPHybrisSessionInternal(de.hybris.platform.servicelayer.session.Session session) Destroys the currentSAPHybrisSessionif exists.booleanChecks if aSAPHybrisSessionexists within the hybrisSession.Gets the currentSAPHybrisSession.protected SAPHybrisSessionCreates theSAPHybrisSessionif it does not exist yet and returns it.de.hybris.platform.servicelayer.session.SessionServiceprotected voidonEvent(BeforeSessionCloseEvent event) voidRegisters aSAPHybrisSessionEventListener.voidsetGenericFactory(GenericFactory genericFactory) Injection setter for theGenericFactory.voidsetSessionService(de.hybris.platform.servicelayer.session.SessionService sessionService) voidUnregisters aSAPHybrisSessionEventListener.Methods inherited from class de.hybris.platform.servicelayer.event.impl.AbstractEventListener
afterPropertiesSet, onApplicationEvent, setApplicationContext, setClusterService, setTenantService
-
Field Details
-
SAP_HYBRIS_SESSION_ALIAS
Alias of the SAP hybris session.- See Also:
-
SAP_HYBRIS_SESSION_ATTRIBUTE
Session attribute to store the SAP hybris session.- See Also:
-
genericFactory
GenericFactoryreference. -
eventListener
Set of listeners which listens to theSAPHybrisSessionEventListenerinterface. -
sessionsToBeDeleted
protected final Map<de.hybris.platform.servicelayer.session.Session,SAPHybrisSession> sessionsToBeDeletedSession which are about to be deleted.
-
-
Constructor Details
-
SAPHybrisSessionProvider
public SAPHybrisSessionProvider()
-
-
Method Details
-
getSessionService
public de.hybris.platform.servicelayer.session.SessionService getSessionService() -
setSessionService
public void setSessionService(de.hybris.platform.servicelayer.session.SessionService sessionService) -
setGenericFactory
Injection setter for theGenericFactory.- Parameters:
genericFactory- theGenericFactoryto set
-
getSAPHybrisSession
Gets the currentSAPHybrisSession.- Returns:
SAPHybrisSession
-
destroySAPHybrisSession
public void destroySAPHybrisSession()Destroys the currentSAPHybrisSession. -
existsSAPHybrisSession
public boolean existsSAPHybrisSession()Checks if aSAPHybrisSessionexists within the hybrisSession.- Returns:
- true, if session exists
-
registerEventListener
Registers aSAPHybrisSessionEventListener.- Parameters:
listener- Event listener
-
unregisterEventListener
Unregisters aSAPHybrisSessionEventListener.- Parameters:
listener- Event listener
-
onEvent
- Specified by:
onEventin classde.hybris.platform.servicelayer.event.impl.AbstractEventListener<BeforeSessionCloseEvent>
-
getSAPHybrisSessionInternal
Creates theSAPHybrisSessionif it does not exist yet and returns it.- Returns:
SAPHybrisSession
-
destroySAPHybrisSessionInternal
protected void destroySAPHybrisSessionInternal(de.hybris.platform.servicelayer.session.Session session) Destroys the currentSAPHybrisSessionif exists.- Parameters:
session- hybrisSession
-