Uses of Annotation Interface
org.jgrapes.core.annotation.Handler
Package
Description
Provides components for building a HTTP server based on the
core and IO components.
I/O related components built on top of the core package.
Classes for managing processes.
Utility classes, mainly for adapted buffers to specific needs.
Components for handling mail.
Networking related I/O classes.
Utility components that are too small to deserve
individual libraries/projects.
-
Uses of Handler in org.jgrapes.http
Modifier and TypeMethodDescriptionvoid
HttpServer.onAccepted
(Accepted event, IOSubchannel netChannel) Creates a new downstream connection asLinkedIOSubchannel
of the network connection, aHttpRequestDecoder
and aHttpResponseEncoder
.void
Handles a close event from the application channel.void
Handles a close event from downstream by closing the upstream connections.void
HttpConnector.onClosed
(Closed<?> event, SocketIOChannel netConnChannel) Called when the network connection is closed.void
HttpServer.onClosed
(Closed<?> event, IOSubchannel netChannel) Forwards aClosed
event to the application channel.void
HttpConnector.onConnected
(ClientConnected event, SocketIOChannel netConnChannel) Called when the network connection is established.void
SessionManager.onDiscard
(DiscardSession event) Discards the given session.void
HttpConnector.onInput
(Input<ByteBuffer> event, SocketIOChannel netConnChannel) Processes any input from the network layer.void
HttpServer.onInput
(Input<ByteBuffer> event, IOSubchannel netChannel) Handles data from the client (from upstream).void
Handles I/O error events from the network layer.void
HttpServer.onOptions
(Request.In.Options event, IOSubchannel appChannel) Provides a fallback handler for an OPTIONS request with asterisk.void
Handles output from the application.void
Receives the message body of a response.void
HttpServer.onProtocolSwitchAccepted
(ProtocolSwitchAccepted event, org.jgrapes.http.HttpServer.WebAppMsgChannel appChannel) void
LanguageSelector.onProtocolSwitchAccepted
(ProtocolSwitchAccepted event, IOSubchannel channel) Handles a procotol switch by associating the language selection with the channel.void
SessionManager.onProtocolSwitchAccepted
(ProtocolSwitchAccepted event, IOSubchannel channel) Associates the channel with a
for the session.Supplier<Optional<Session>>
void
HttpServer.onPurge
(Purge event, IOSubchannel netChannel) Forwards aPurge
event to the application channel.void
HttpConnector.onRequest
(Request.Out event) Starts the processing of a request from the application layer.void
HttpServer.onRequestCompleted
(Request.In.Completed event, IOSubchannel appChannel) Checks whether the request has been handled (value ofRequest
event set totrue
) or the status code in the prepared response is no longer “Not Implemented”.void
HttpServer.onResponse
(Response event, org.jgrapes.http.HttpServer.WebAppMsgChannel appChannel) Handles a response event from downstream by sending it through anHttpResponseEncoder
that generates the data (encoded information) and sends it upstream withOutput
events. -
Uses of Handler in org.jgrapes.io
Modifier and TypeMethodDescriptionvoid
Handle close by closing the file associated with the channel.void
InputStreamMonitor.onConfigurationUpdate
(ConfigurationUpdate event) The component can be configured with events that include a path (see @linkConfigurationUpdate.paths()
) that matches this components path (seeManager.componentPath()
).void
FileStorage.onInput
(Input<ByteBuffer> event, Channel channel) Handle input by writing it to the file, if a channel exists.void
NioDispatcher.onNioRegistration
(NioRegistration event) Handle the NIO registration.void
FileStorage.onOutput
(Output<ByteBuffer> event, Channel channel) HandleOutput
events by writing them to the file, if a channel exists.void
PurgeTerminator.onPurge
(Purge event, IOSubchannel channel) void
FileStorage.onSaveInput
(SaveInput event) Opens a file for writing using the properties of the event.void
FileStorage.onSaveOutput
(SaveOutput event) Opens a file for writing using the properties of the event.void
Starts a thread that continuously reads available data from the input stream.void
Starts this dispatcher.void
Handle stop by closing all files.void
Stops the thread that reads data from the input stream.void
Stops the thread that is associated with this dispatcher.void
FileStorage.onStreamFile
(StreamFile event) Opens a file for reading using the properties of the event and streams its content as a sequence ofOutput
events with the end of record flag set in the last event. -
Uses of Handler in org.jgrapes.io.process
Modifier and TypeMethodDescriptionvoid
Closes the output to the process (the process’s stdin).void
Handles closed events from stdout and stderr.void
ProcessManager.onOutput
(Output<ByteBuffer> event, ProcessManager.ProcessChannel channel) Writes the data passed in the event.void
ProcessManager.onStartProcess
(StartProcess event) Start a new process using the data from the event.void
Stop all running processes. -
Uses of Handler in org.jgrapes.io.util
-
Uses of Handler in org.jgrapes.mail
Modifier and TypeMethodDescriptionvoid
MailConnectionManager.onConfigUpdate
(ConfigurationUpdate event) Configure the component.void
MailSender.onMessage
(SendMailMessage event, Channel channel) Sends the message as specified by the event.void
MailMonitor.onOpenMailMonitor
(OpenMailMonitor event, Channel channel) Open a store as specified by the event and monitor the folders (also specified by the event).void
MailSender.onOpenMailSender
(OpenMailSender event, Channel channel) Open a connection for sending mail as specified by the event.void
Start the component.void
MailMonitor.onUpdateFolders
(UpdateMailFolders event, MailChannel channel) Retrieves the folders specified in the event. -
Uses of Handler in org.jgrapes.net
Modifier and TypeMethodDescriptionvoid
SslCodec.onAccepted
(Accepted event, IOSubchannel encryptedChannel) Creates a new downstream connection asLinkedIOSubchannel
of the network connection together with anSSLEngine
.void
Shuts down the one of the connections.void
Shuts down the server or one of the connections to the server.void
Forwards a close event upstream.void
SslCodec.onClosed
(Closed<Void> event, IOSubchannel encryptedChannel) Handles a close event from the encrypted channel (client).void
SocketServer.onConfigurationUpdate
(ConfigurationUpdate event) The component can be configured with events that include a path (see @linkConfigurationUpdate.paths()
) that matches this components path (seeManager.componentPath()
).void
SslCodec.onConnected
(ClientConnected event, IOSubchannel encryptedChannel) Creates a new downstream connection asLinkedIOSubchannel
of the network connection together with anSSLEngine
.void
SslCodec.onHalfClosed
(HalfClosed event, IOSubchannel encryptedChannel) Handles a half close event from the encrypted channel (client).void
SslCodec.onInput
(Input<ByteBuffer> event, IOSubchannel encryptedChannel) Handles encrypted data from upstream (the network).void
Handles anIOError
event from the encrypted channel (client) by sending it downstream.void
SocketConnector.onOpenConnection
(OpenSocketConnection event) Opens a connection to the end point specified in the event.void
SslCodec.onOpenConnection
(OpenSocketConnection event) Forward the connection request to the encrypted network.void
SocketConnectionManager.onOutput
(Output<ByteBuffer> event, SocketConnectionManager.SocketChannelImpl channel) Writes the data passed in the event.void
SslCodec.onOutput
(Output<ByteBuffer> event, org.jgrapes.net.SslCodec.PlainChannel plainChannel) Sends plain data through the engine and then upstream.void
SslCodec.onPurge
(Purge event, IOSubchannel encryptedChannel) Forwards aPurge
event downstream.void
SocketConnector.onRegistered
(NioRegistration.Completed event) Called when the new socket channel has successfully been registered with the nio dispatcher.void
SocketServer.onRegistered
(NioRegistration.Completed event) Handles the successful channel registration.void
Starts the server.void
Shuts down the server by firing aClose
using the server as channel. -
Uses of Handler in org.jgrapes.util
Modifier and TypeMethodDescriptionvoid
ComponentProvider.onConfigurationUpdate
(ConfigurationUpdate evt) Uses the information from the event to configure the provided components.void
NightConfigStore.onConfigurationUpdate
(ConfigurationUpdate event) Merges and saves configuration updates.void
PreferencesStore.onConfigurationUpdate
(ConfigurationUpdate event) Merges and saves configuration updates.void
NightConfigStore.onFileChanged
(FileChanged event) If watching the configuration file is enabled, fire aConfigurationUpdate
event with the complete configuration when the file changes.void
Intercepts theStart
event and fires aConfigurationUpdate
event.void
Intercepts theStart
event and fires aConfigurationUpdate
event.void
FileSystemWatcher.onWatchFile
(WatchFile event, Channel channel) Register a path to wath.