Class SAPHybrisSessionProvider
- java.lang.Object
-
- de.hybris.platform.servicelayer.event.impl.AbstractEventListener<BeforeSessionCloseEvent>
-
- de.hybris.platform.sap.core.runtime.SAPHybrisSessionProvider
-
- All Implemented Interfaces:
java.util.EventListener,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener<BeforeSessionCloseEvent>
public class SAPHybrisSessionProvider extends AbstractEventListener<BeforeSessionCloseEvent>
SAP Hybris Session Provider.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<SAPHybrisSessionEventListener>eventListenerSet of listeners which listens to theSAPHybrisSessionEventListenerinterface.protected GenericFactorygenericFactoryGenericFactoryreference.static java.lang.StringSAP_HYBRIS_SESSION_ALIASAlias of the SAP hybris session.static java.lang.StringSAP_HYBRIS_SESSION_ATTRIBUTESession attribute to store the SAP hybris session.protected java.util.Map<Session,SAPHybrisSession>sessionsToBeDeletedSession which are about to be deleted.
-
Constructor Summary
Constructors Constructor Description SAPHybrisSessionProvider()
-
Method Summary
-
Methods inherited from class de.hybris.platform.servicelayer.event.impl.AbstractEventListener
afterPropertiesSet, onApplicationEvent, setApplicationContext, setClusterService, setTenantService
-
-
-
-
Field Detail
-
SAP_HYBRIS_SESSION_ALIAS
public static final java.lang.String SAP_HYBRIS_SESSION_ALIAS
Alias of the SAP hybris session.- See Also:
- Constant Field Values
-
SAP_HYBRIS_SESSION_ATTRIBUTE
public static final java.lang.String SAP_HYBRIS_SESSION_ATTRIBUTE
Session attribute to store the SAP hybris session.- See Also:
- Constant Field Values
-
genericFactory
protected GenericFactory genericFactory
GenericFactoryreference.
-
eventListener
protected java.util.Set<SAPHybrisSessionEventListener> eventListener
Set of listeners which listens to theSAPHybrisSessionEventListenerinterface.
-
sessionsToBeDeleted
protected final java.util.Map<Session,SAPHybrisSession> sessionsToBeDeleted
Session which are about to be deleted.
-
-
Method Detail
-
getSessionService
public SessionService getSessionService()
-
setSessionService
public void setSessionService(SessionService sessionService)
-
setGenericFactory
public void setGenericFactory(GenericFactory genericFactory)
Injection setter for theGenericFactory.- Parameters:
genericFactory- theGenericFactoryto set
-
getSAPHybrisSession
public SAPHybrisSession 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
public void registerEventListener(SAPHybrisSessionEventListener listener)
Registers aSAPHybrisSessionEventListener.- Parameters:
listener- Event listener
-
unregisterEventListener
public void unregisterEventListener(SAPHybrisSessionEventListener listener)
Unregisters aSAPHybrisSessionEventListener.- Parameters:
listener- Event listener
-
onEvent
protected void onEvent(BeforeSessionCloseEvent event)
Description copied from class:AbstractEventListenerThis method is called byApplicationListener.onApplicationEvent(ApplicationEvent)and processes the given event.- Specified by:
onEventin classAbstractEventListener<BeforeSessionCloseEvent>- Parameters:
event- the event to be processed- See Also:
ApplicationListener.onApplicationEvent(ApplicationEvent)
-
getSAPHybrisSessionInternal
protected SAPHybrisSession getSAPHybrisSessionInternal()
Creates theSAPHybrisSessionif it does not exist yet and returns it.- Returns:
SAPHybrisSession
-
destroySAPHybrisSessionInternal
protected void destroySAPHybrisSessionInternal(Session session)
Destroys the currentSAPHybrisSessionif exists.- Parameters:
session- hybrisSession
-
-