Class

net.liftweb.http

ContainerVar

Related Doc: package http

Permalink

abstract class ContainerVar[T] extends AnyVar[T, ContainerVar[T]] with LazyLoggable

A typesafe container for data with a lifetime nominally equivalent to the lifetime of HttpSession attributes. This alternative to SessionVar keeps data in the container's session and must be serializable to support session migration. Use SessionVars unless you are using MigratoryLiftSessions.

object MySnippetCompanion { object mySessionVar extends ContainerVar[String]("hello") }

The standard pattern is to create a singleton object extending ContainerVar instead of creating an instance variable of a concrete ContainerVar subclass. This is preferred because ContainerVar will use the name of its instantiating class for part of its state maintenance mechanism.

If you find it necessary to create a ContainerVar subclass of which there may be more than one instance, it is necessary to override the nameSalt() method to return a unique salt value for each instance to prevent name collisions.

Linear Supertypes
LazyLoggable, AnyVar[T, ContainerVar[T]], AnyVarTrait[T, ContainerVar[T]], HasCalcDefaultValue[T], PSettableValueHolder[T], SettableValueHolder, Settable, PValueHolder[T], ValueHolder, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ContainerVar
  2. LazyLoggable
  3. AnyVar
  4. AnyVarTrait
  5. HasCalcDefaultValue
  6. PSettableValueHolder
  7. SettableValueHolder
  8. Settable
  9. PValueHolder
  10. ValueHolder
  11. AnyRef
  12. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ContainerVar(dflt: ⇒ T)(implicit containerSerializer: ContainerSerializer[T])

    Permalink

    dflt

    - the default value to be returned if none was set prior to requesting a value to be returned from the container

    containerSerializer

    -- an implicit parameter that keeps us honest about only storing things that can be actually serialized. Lift provides a subset of these.

Type Members

  1. type CleanUpParam = LiftSession

    Permalink
    Definition Classes
    ContainerVar → AnyVarTrait
  2. type FuncType = (Box[T], Boolean) ⇒ Unit

    Permalink
    Definition Classes
    AnyVarTrait
  3. type ValueType = T

    Permalink
    Definition Classes
    PValueHolder → ValueHolder

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def __nameSalt: String

    Permalink
    Attributes
    protected
    Definition Classes
    AnyVarTrait
  5. def apply(what: T): T

    Permalink
    Definition Classes
    AnyVarTrait
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def atomicUpdate(f: (ValueType) ⇒ ValueType): ValueType

    Permalink
    Definition Classes
    Settable
  8. def calcDefaultValue: T

    Permalink
    Attributes
    protected
    Definition Classes
    AnyVar → AnyVarTrait → HasCalcDefaultValue
  9. def clearFunc(name: String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    ContainerVar → AnyVarTrait
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def doSync[F](f: ⇒ F): F

    Permalink

    Different Vars require different mechanisms for synchronization.

    Different Vars require different mechanisms for synchronization. This method implements the Var specific synchronization mechanism.

    In the case of ContainerVar, we don't need to do any explicit synchronization. Values are stored in the HttpSession, which already gives us atomic get and set operations.

    Definition Classes
    ContainerVar → AnyVarTrait
  12. def doWith[F](newVal: T)(f: ⇒ F): F

    Permalink
    Definition Classes
    AnyVarTrait
  13. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def findFunc(name: String): Box[T]

    Permalink
    Attributes
    protected
    Definition Classes
    ContainerVar → AnyVarTrait
  17. def get: T

    Permalink
    Definition Classes
    AnyVarTrait → ValueHolder
  18. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  19. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  20. def is: T

    Permalink
    Definition Classes
    AnyVarTrait
  21. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  22. lazy val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    LazyLoggable
  23. lazy val name: String

    Permalink
    Attributes
    protected
    Definition Classes
    AnyVarTrait
  24. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. def onChange(f: FuncType): Unit

    Permalink
    Definition Classes
    AnyVarTrait
  28. def onShutdown(session: CleanUpParam): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    AnyVarTrait
  29. def performAtomicOperation[T](f: ⇒ T): T

    Permalink
    Definition Classes
    Settable
  30. def registerCleanupFunc(in: (LiftSession) ⇒ Unit): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    ContainerVar → AnyVarTrait
  31. final def registerGlobalCleanupFunc(in: (CleanUpParam) ⇒ Unit): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    AnyVarTrait
  32. def remove(): Unit

    Permalink
    Definition Classes
    AnyVarTrait
  33. def set(what: T): T

    Permalink
    Definition Classes
    AnyVarTrait → Settable
  34. def setFunc(name: String, value: T): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    ContainerVar → AnyVarTrait
  35. def setIfUnset(value: ⇒ T): T

    Permalink
    Definition Classes
    AnyVarTrait
  36. def set_?: Boolean

    Permalink
    Definition Classes
    AnyVarTrait
  37. def settingDefault_?: Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    AnyVarTrait
  38. def showWarningWhenAccessedOutOfSessionScope_?: Boolean

    Permalink
  39. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  40. def testWasSet(name: String, bn: String): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    ContainerVar → AnyVarTrait
  41. def toString(): String

    Permalink
    Definition Classes
    AnyVarTrait → AnyRef → Any
  42. def update(f: (T) ⇒ T): T

    Permalink
    Definition Classes
    AnyVarTrait
  43. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. def wasInitialized(name: String, bn: String): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    ContainerVar → AnyVarTrait

Inherited from LazyLoggable

Inherited from AnyVar[T, ContainerVar[T]]

Inherited from AnyVarTrait[T, ContainerVar[T]]

Inherited from HasCalcDefaultValue[T]

Inherited from PSettableValueHolder[T]

Inherited from SettableValueHolder

Inherited from Settable

Inherited from PValueHolder[T]

Inherited from ValueHolder

Inherited from AnyRef

Inherited from Any

Ungrouped