com.holonplatform.vaadin.internal

## Class VaadinSessionScope

- java.lang.Object
- - com.holonplatform.vaadin.internal.VaadinSessionScope

- All Implemented Interfaces:
    com.holonplatform.core.ContextScope

      public class VaadinSessionScope
      extends Object
      implements com.holonplatform.core.ContextScope

  A `ContextScope` bound to current `VaadinSession`, looking up context resources using Vaadin Session attributes.

  THis scope uses `VaadinSession.getCurrent()` to obtain the current Vaadin session, so this scope is active only when invoked within a Vaadin server request thread.

  Since:
    5.0.0

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `NAME` Context name
    `static int` | `ORDER` Context order

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `VaadinSessionScope()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> Optional<T>` | `get(String resourceKey, Class<T> resourceType)`
    `String` | `getName()`
    `int` | `getOrder()`
    `<T> Optional<T>` | `put(String resourceKey, T value)`
    `<T> Optional<T>` | `putIfAbsent(String resourceKey, T value)`
    `boolean` | `remove(String resourceKey)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### NAME

          public static final String NAME

      Context name
      See Also:
        Constant Field Values

    - #### ORDER

          public static final int ORDER

      Context order
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### VaadinSessionScope

          public VaadinSessionScope()

  - ### Method Detail

    - #### getName

          public String getName()

      Specified by:
        `getName` in interface `com.holonplatform.core.ContextScope`

    - #### getOrder

          public int getOrder()

      Specified by:
        `getOrder` in interface `com.holonplatform.core.ContextScope`

    - #### get

          public <T> Optional<T> get(String resourceKey,
                                     Class<T> resourceType)
                              throws com.holonplatform.core.exceptions.TypeMismatchException

      Specified by:
        `get` in interface `com.holonplatform.core.ContextScope`
      Throws:
        `com.holonplatform.core.exceptions.TypeMismatchException`

    - #### put

          public <T> Optional<T> put(String resourceKey,
                                     T value)
                              throws UnsupportedOperationException

      Specified by:
        `put` in interface `com.holonplatform.core.ContextScope`
      Throws:
        `UnsupportedOperationException`

    - #### putIfAbsent

          public <T> Optional<T> putIfAbsent(String resourceKey,
                                             T value)
                                      throws UnsupportedOperationException

      Specified by:
        `putIfAbsent` in interface `com.holonplatform.core.ContextScope`
      Throws:
        `UnsupportedOperationException`

    - #### remove

          public boolean remove(String resourceKey)
                         throws UnsupportedOperationException

      Specified by:
        `remove` in interface `com.holonplatform.core.ContextScope`
      Throws:
        `UnsupportedOperationException`

Copyright © 2019 The Holon Platform. All rights reserved.