com.holonplatform.vaadin.flow.internal

## Class DefaultVaadinSessionScope

- java.lang.Object
- - com.holonplatform.vaadin.flow.internal.DefaultVaadinSessionScope

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

      public class DefaultVaadinSessionScope
      extends Object
      implements VaadinSessionScope

  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.2.0

- - ### Field Summary

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

    - ### Fields inherited from interface com.holonplatform.vaadin.flow.VaadinSessionScope

      `NAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultVaadinSessionScope()`

  - ### 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`

    - ### Methods inherited from interface com.holonplatform.vaadin.flow.VaadinSessionScope

      `get, require`

- - ### Field Detail

    - #### ORDER

          public static final int ORDER

      Context order
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DefaultVaadinSessionScope

          public DefaultVaadinSessionScope()

  - ### 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.