Class ConsoleWeblet

All Implemented Interfaces:
Iterable<ComponentType>, Channel, ComponentType, Eligible, Manager
Direct Known Subclasses:
FreeMarkerConsoleWeblet

public abstract class ConsoleWeblet extends Component
The server side base class for the web console single page application (SPA).

Its main tasks are to provide resources using Request/Response events (see onGet(org.jgrapes.http.events.Request.In.Get, org.jgrapes.io.IOSubchannel) for details about the different kinds of resources), to create the ConsoleConnections for new WebSocket connections (see onUpgraded(org.jgrapes.http.events.Upgraded, org.jgrapes.io.IOSubchannel)) and to convert the JSON RPC messages received from the browser via the web socket to JsonInput events and fire them on the corresponding ConsoleConnection channel.

The class has a counter part in the browser, the jgconsole JavaScript module (see functions) that can be loaded as console-base-resource/jgconsole.js (relative to the configured prefix).

The class also provides handlers for some console related events (i.e. fired on the attached WebConsole’s channel) that affect the console representation in the browser. These handlers are declared with class channel ConsoleConnection which is replaced using the HandlerDefinition.ChannelReplacements mechanism.