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
Modifier and TypeFieldDescriptionprotected static final com.fasterxml.jackson.databind.ObjectMapper
The mapper.Fields inherited from class org.jgrapes.core.internal.EventBase
completed, completionEvents, invokedFor
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
Emits the JSON notification using the given writer.protected void
Creates a JSON notification from the given data.protected void
Deprecated.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, toString
Methods inherited from class org.jgrapes.core.internal.EventBase
disableTracking, enqueued, firstResultAssigned, isTracked, onCompletion
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jgrapes.core.Associator
associated, associated, associated, associatedGet
Methods 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:
InterruptedException
IOException
-
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.