Class ModelContextProxy
java.lang.Object
de.hybris.platform.servicelayer.internal.model.impl.ModelContextProxy
- All Implemented Interfaces:
ModelContext,org.springframework.beans.factory.InitializingBean
public class ModelContextProxy
extends Object
implements ModelContext, org.springframework.beans.factory.InitializingBean
Proxy holder of one
ModelContext per active Jalo session.
This had been added to avoid using Spring <scoped-proxy> setting which was much slower at that time.
-
Field Summary
Fields inherited from interface de.hybris.platform.servicelayer.internal.model.ModelContext
loading -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClear context after save with generic DAOvoidafterDirectPersist(Collection<ModelWrapper> models) Clear context after save with generic DAOvoidafterPersist(Collection<ModelWrapper> models) voidvoidattach(Object model, Object source, ModelConverter conv) Attaches a new model to the context.voidclear()Removes all attached models.voiddetach(Object model, Object source, ModelConverter conv) Removes a model from context.getAttached(Object source, ModelConverter conv) Returns a attached model for a given source element and converter.Returns all attached model instances which are currently modified.getNew()Returns all attached model instances which are currently new.booleanisAttached(Object model, ModelConverter conv) voidsetModelContextFactory(ModelContextFactory modelContextFactory) protected voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.servicelayer.internal.model.ModelContext
clearLoading, isLoading, markLoading
-
Constructor Details
-
ModelContextProxy
public ModelContextProxy()
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
unsetContext
protected void unsetContext() -
getActiveContext
-
afterPersist
- Specified by:
afterPersistin interfaceModelContext
-
afterDirectPersist
Description copied from interface:ModelContextClear context after save with generic DAO- Specified by:
afterDirectPersistin interfaceModelContext
-
afterDirectPersist
Description copied from interface:ModelContextClear context after save with generic DAO- Specified by:
afterDirectPersistin interfaceModelContext
-
attach
Description copied from interface:ModelContextAttaches a new model to the context.- Specified by:
attachin interfaceModelContext- Parameters:
model- the model to holdsource- the source element - may be null for new modelsconv- the converter used
-
clear
public void clear()Description copied from interface:ModelContextRemoves all attached models.- Specified by:
clearin interfaceModelContext
-
detach
Description copied from interface:ModelContextRemoves a model from context.- Specified by:
detachin interfaceModelContext- Parameters:
model- the model to removesource- its source - may be null for new modelsconv- the converter which manages the model
-
getAttached
Description copied from interface:ModelContextReturns a attached model for a given source element and converter.- Specified by:
getAttachedin interfaceModelContext- Parameters:
source- the source element - must not be nullconv- the converter
-
getModified
Description copied from interface:ModelContextReturns all attached model instances which are currently modified.- Specified by:
getModifiedin interfaceModelContext
-
getNew
Description copied from interface:ModelContextReturns all attached model instances which are currently new.- Specified by:
getNewin interfaceModelContext
-
isAttached
Description copied from interface:ModelContext- Specified by:
isAttachedin interfaceModelContext- Returns:
falseotherwise.
-
setModelContextFactory
-