Class KVStoreBasedConsolePolicy

java.lang.Object
org.jgrapes.core.internal.ComponentVertex
org.jgrapes.core.Component
org.jgrapes.webconsole.base.KVStoreBasedConsolePolicy
All Implemented Interfaces:
Iterable<org.jgrapes.core.ComponentType>, org.jgrapes.core.Channel, org.jgrapes.core.ComponentType, org.jgrapes.core.Eligible, org.jgrapes.core.Manager

public class KVStoreBasedConsolePolicy extends org.jgrapes.core.Component
A component that restores the console layout using key/value events for persisting the data between sessions.Boot Event Sequence

This component requires another component that handles the key/value store events (KeyValueStoreUpdate, KeyValueStoreQuery) used by this component for implementing persistence. When the web console becomesready, this policy sends a query for the persisted data.

When the web console has been prepared, the policy sends the last layout as retrieved from persistent storage to the web console and then generates render events for all web console components contained in this layout.

Each time the layout is changed in the web console, the web console sends the new layout data and this component updates the persistent storage accordingly.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.jgrapes.core.Channel

    org.jgrapes.core.Channel.Default
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final com.fasterxml.jackson.databind.ObjectMapper
    The mapper.

    Fields inherited from class org.jgrapes.core.Component

    logger

    Fields inherited from interface org.jgrapes.core.Channel

    BROADCAST, SELF
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new component with its channel set to itself.
    KVStoreBasedConsolePolicy(org.jgrapes.core.Channel componentChannel)
    Creates a new component with its channel set to the given channel.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Forward layout changed event to browser session scoped storage.
    void
    Create browser session scoped storage and forward event to it.

    Methods inherited from class org.jgrapes.core.Component

    channel, component, defaultCriterion, isEligibleFor, setName

    Methods inherited from class org.jgrapes.core.internal.ComponentVertex

    activeEventPipeline, addHandler, attach, channelReplacements, children, componentPath, componentVertex, detach, fire, initComponentsHandlers, iterator, name, newEventPipeline, newEventPipeline, parent, registerAsGenerator, root, toString, unregisterAsGenerator

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator

    Methods inherited from interface org.jgrapes.core.Manager

    stream
  • Field Details

    • mapper

      protected static final com.fasterxml.jackson.databind.ObjectMapper mapper
      The mapper.
  • Constructor Details

    • KVStoreBasedConsolePolicy

      Creates a new component with its channel set to itself.
    • KVStoreBasedConsolePolicy

      public KVStoreBasedConsolePolicy(org.jgrapes.core.Channel componentChannel)
      Creates a new component with its channel set to the given channel.
      Parameters:
      componentChannel -
  • Method Details