Package sc.obj

Class ScopeContext

  • Direct Known Subclasses:

    public abstract class ScopeContext
    extends java.lang.Object
    Extended to implement a new scope. Each ScopeContext manages values obtained with it's scope's lifecycle (e.g. one per session, per-app-per-session, global, per-app but global, per-request or with future extensions scopes like: per-store, per-merchant, etc. Scope definitions can be hierarchical - i.e. a scope can have a parent scope. Listeners on a scope can receive events from child scopes - so if you listen on the window, you'll receive changes on the session, global, or window. To send an event, call scopeChanged() on the ScopeContext.
    • Field Detail

      • toRunLater

        public java.util.ArrayList<ScheduledJob> toRunLater
      • eventListenerLock

        public final java.lang.Object eventListenerLock
      • syncTypeFilter

        public java.util.Set<java.lang.String> syncTypeFilter
      • resetSyncTypeFilter

        public java.util.Set<java.lang.String> resetSyncTypeFilter
    • Constructor Detail

      • ScopeContext

        public ScopeContext()
    • Method Detail

      • setValue

        public abstract void setValue​(java.lang.String name,
                                      java.lang.Object value)
        Adds a value to the scope context that will be disposed when the scope is destroyed
      • setValueByRef

        public abstract void setValueByRef​(java.lang.String name,
                                           java.lang.Object value)
      • getValue

        public abstract java.lang.Object getValue​(java.lang.String name)
      • getScopeDefinition

        public abstract ScopeDefinition getScopeDefinition()
      • getId

        public abstract java.lang.String getId()
      • getTraceId

        public java.lang.String getTraceId()
      • getValues

        public abstract java.util.Map<java.lang.String,​java.lang.Object> getValues()
      • scopeDestroyed

        public void scopeDestroyed​(ScopeContext fromParent)
      • isCurrent

        public boolean isCurrent()
        Returns true if this scope is active in the current thread state.
      • addChildContext

        public void addChildContext​(ScopeContext childCtx)
      • addParentContext

        public void addParentContext​(ScopeContext parent)
      • removeChildContext

        public boolean removeChildContext​(ScopeContext childCtx)
      • init

        public void init()
        Should be called to initialize the parent/child scopeContexts
      • scopeChanged

        public void scopeChanged()
      • getSingletonForType

        public java.lang.Object getSingletonForType​(java.lang.Object typeObj)
      • getParentContext

        public ScopeContext getParentContext​(java.lang.String scopeName)
      • getChildContexts

        public java.util.HashSet<ScopeContext> getChildContexts()
      • getTraceInfo

        public java.lang.String getTraceInfo()
      • addInvokeLater

        public void addInvokeLater​(java.lang.Runnable r,
                                   int priority,
                                   CurrentScopeContext curScopeCtx)
      • closeScopeContext

        public void closeScopeContext()