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 java.lang.Object implements ModelContext, org.springframework.beans.factory.InitializingBean
Proxy holder of oneModelContextper 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 Constructor Description ModelContextProxy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterDirectPersist(ModelWrapper wr)Clear context after save with generic DAOvoidafterDirectPersist(java.util.Collection<ModelWrapper> models)Clear context after save with generic DAOvoidafterPersist(java.util.Collection<ModelWrapper> models)voidafterPropertiesSet()voidattach(java.lang.Object model, java.lang.Object source, ModelConverter conv)Attaches a new model to the context.voidclear()Removes all attached models.voiddetach(java.lang.Object model, java.lang.Object source, ModelConverter conv)Removes a model from context.ModelContextgetActiveContext()java.lang.ObjectgetAttached(java.lang.Object source, ModelConverter conv)Returns a attached model for a given source element and converter.java.util.Set<java.lang.Object>getModified()Returns all attached model instances which are currently modified.java.util.Set<java.lang.Object>getNew()Returns all attached model instances which are currently new.booleanisAttached(java.lang.Object model, ModelConverter conv)voidsetModelContextFactory(ModelContextFactory modelContextFactory)protected voidunsetContext()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.servicelayer.internal.model.ModelContext
clearLoading, isLoading, markLoading
-
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
unsetContext
protected void unsetContext()
-
getActiveContext
public ModelContext getActiveContext()
-
afterPersist
public void afterPersist(java.util.Collection<ModelWrapper> models)
- Specified by:
afterPersistin interfaceModelContext
-
afterDirectPersist
public void afterDirectPersist(java.util.Collection<ModelWrapper> models)
Description copied from interface:ModelContextClear context after save with generic DAO- Specified by:
afterDirectPersistin interfaceModelContext
-
afterDirectPersist
public void afterDirectPersist(ModelWrapper wr)
Description copied from interface:ModelContextClear context after save with generic DAO- Specified by:
afterDirectPersistin interfaceModelContext
-
attach
public void attach(java.lang.Object model, java.lang.Object source, ModelConverter conv)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
public void detach(java.lang.Object model, java.lang.Object source, ModelConverter conv)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
public java.lang.Object getAttached(java.lang.Object source, ModelConverter conv)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
public java.util.Set<java.lang.Object> getModified()
Description copied from interface:ModelContextReturns all attached model instances which are currently modified.- Specified by:
getModifiedin interfaceModelContext
-
getNew
public java.util.Set<java.lang.Object> getNew()
Description copied from interface:ModelContextReturns all attached model instances which are currently new.- Specified by:
getNewin interfaceModelContext
-
isAttached
public boolean isAttached(java.lang.Object model, ModelConverter conv)Description copied from interface:ModelContext- Specified by:
isAttachedin interfaceModelContext- Returns:
falseotherwise.
-
setModelContextFactory
public void setModelContextFactory(ModelContextFactory modelContextFactory)
-
-