Class 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 one ModelContext per active Jalo session.

    This had been added to avoid using Spring <scoped-proxy> setting which was much slower at that time.

    • Constructor Detail

      • ModelContextProxy

        public ModelContextProxy()
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        java.lang.Exception
      • unsetContext

        protected void unsetContext()
      • attach

        public void attach​(java.lang.Object model,
                           java.lang.Object source,
                           ModelConverter conv)
        Description copied from interface: ModelContext
        Attaches a new model to the context.
        Specified by:
        attach in interface ModelContext
        Parameters:
        model - the model to hold
        source - the source element - may be null for new models
        conv - the converter used
      • clear

        public void clear()
        Description copied from interface: ModelContext
        Removes all attached models.
        Specified by:
        clear in interface ModelContext
      • detach

        public void detach​(java.lang.Object model,
                           java.lang.Object source,
                           ModelConverter conv)
        Description copied from interface: ModelContext
        Removes a model from context.
        Specified by:
        detach in interface ModelContext
        Parameters:
        model - the model to remove
        source - its source - may be null for new models
        conv - the converter which manages the model
      • getAttached

        public java.lang.Object getAttached​(java.lang.Object source,
                                            ModelConverter conv)
        Description copied from interface: ModelContext
        Returns a attached model for a given source element and converter.
        Specified by:
        getAttached in interface ModelContext
        Parameters:
        source - the source element - must not be null
        conv - the converter
      • getModified

        public java.util.Set<java.lang.Object> getModified()
        Description copied from interface: ModelContext
        Returns all attached model instances which are currently modified.
        Specified by:
        getModified in interface ModelContext
      • getNew

        public java.util.Set<java.lang.Object> getNew()
        Description copied from interface: ModelContext
        Returns all attached model instances which are currently new.
        Specified by:
        getNew in interface ModelContext
      • setModelContextFactory

        public void setModelContextFactory​(ModelContextFactory modelContextFactory)