Class ConsoleCommand
- All Implemented Interfaces:
Future<Void>,Associator,Eligible
- Direct Known Subclasses:
AddConletType,AddPageResources,CloseModalDialog,DeleteConlet,DisplayNotification,LastConsoleLayout,NotifyConletView,OpenModalDialog,RenderConlet,SimpleConsoleCommand,UpdateConletType
Events derived from this class are transformed to JSON messages
that are sent to the web console page.
They may only be fired
on the IOSubchannel.DefaultIOSubchannel.responsePipeline()
(usually with
IOSubchannel.respond(org.jgrapes.core.Event)).
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final com.fasterxml.jackson.databind.ObjectMapperThe mapper.Fields inherited from class org.jgrapes.core.internal.EventBase
completed, completionEvents, invokedFor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidEmits the JSON notification using the given writer.protected voidCreates a JSON notification from the given data.protected voidDeprecated.Methods inherited from class org.jgrapes.core.Event
addCompletionEvent, associated, cancel, channels, channels, completionEvents, currentResults, defaultCriterion, forChannels, get, get, handled, handlingError, isCancelled, isDone, isEligibleFor, isStopped, processedBy, results, results, resumeHandling, setAssociated, setChannels, setRequiresResult, setResult, stop, suspendHandling, suspendHandling, tieTo, toStringMethods inherited from class org.jgrapes.core.internal.EventBase
disableTracking, enqueued, firstResultAssigned, isTracked, onCompletionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jgrapes.core.Associator
associated, associated, associated, associatedGetMethods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Field Details
-
mapper
The mapper.
-
-
Constructor Details
-
ConsoleCommand
public ConsoleCommand()
-
-
Method Details
-
emitJson
Emits the JSON notification using the given writer.Derived classes usually simply call
emitJson(Writer, String, Object...)with the method name and parameters.- Parameters:
writer- the writer- Throws:
InterruptedExceptionIOException
-
emitJson
Creates a JSON notification from the given data.Closes the
writer.- Parameters:
writer- the writermethod- the methodparams- the params- Throws:
IOException- Signals that an I/O exception has occurred.
-
toJson
@Deprecated protected void toJson(Writer writer, String method, Object... params) throws IOException Deprecated.UseemitJson(Writer, String, Object...)instead.CallsemitJson(Writer, String, Object...)with the given method and parameters.Provided for backwards compatibility.
- Parameters:
writer- the writermethod- the methodparams- the params- Throws:
IOException- Signals that an I/O exception has occurred.
-
emitJson(Writer, String, Object...)instead.