Package org.jgrapes.webconsole.base
Class BrowserLocalBackedKVStore
java.lang.Object
org.jgrapes.core.internal.ComponentVertex
org.jgrapes.core.Component
org.jgrapes.webconsole.base.BrowserLocalBackedKVStore
- All Implemented Interfaces:
Iterable<ComponentType>,Channel,ComponentType,Eligible,Manager
The Class BrowserLocalBackedKVStore.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jgrapes.core.Channel
Channel.Default -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionBrowserLocalBackedKVStore(Channel componentChannel, String consolePrefix) Create a new key/value store that uses the browser’s local storage for persisting the values. -
Method Summary
Modifier and TypeMethodDescriptionvoidonConsoleReady(ConsoleReady event, ConsoleConnection channel) InterceptConsoleReadyevent to first get data.voidonJsonInput(JsonInput event, ConsoleConnection channel) Evaluate “retrievedLocalData” response.voidonKeyValueStoreQuery(KeyValueStoreQuery event, ConsoleConnection channel) Handle data query..voidonKeyValueStoreUpdate(KeyValueStoreUpdate event, ConsoleConnection channel) Handle data update events.Methods inherited from class org.jgrapes.core.Component
channel, component, defaultCriterion, isEligibleFor, setNameMethods 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, unregisterAsGeneratorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
BrowserLocalBackedKVStore
Create a new key/value store that uses the browser’s local storage for persisting the values.- Parameters:
componentChannel- the channel that the component’s handlers listen on by default and thatManager.fire(Event, Channel...)sends the event toconsolePrefix- the web console’s prefix as returned byConsoleWeblet.prefix(), i.e. staring and ending with a slash
-
-
Method Details
-
onConsoleReady
@Handler(priority=1000) public void onConsoleReady(ConsoleReady event, ConsoleConnection channel) throws InterruptedException InterceptConsoleReadyevent to first get data.- Parameters:
event- the eventchannel- the channel- Throws:
InterruptedException- the interrupted exception
-
onJsonInput
@Handler public void onJsonInput(JsonInput event, ConsoleConnection channel) throws InterruptedException, IOException Evaluate “retrievedLocalData” response.- Parameters:
event- the eventchannel- the channel- Throws:
InterruptedException- the interrupted exceptionIOException- Signals that an I/O exception has occurred.
-
onKeyValueStoreUpdate
@Handler public void onKeyValueStoreUpdate(KeyValueStoreUpdate event, ConsoleConnection channel) throws InterruptedException, IOException Handle data update events.- Parameters:
event- the eventchannel- the channel- Throws:
InterruptedException- the interrupted exceptionIOException- Signals that an I/O exception has occurred.
-
onKeyValueStoreQuery
Handle data query..- Parameters:
event- the eventchannel- the channel
-