Uses of Interface
org.jgrapes.io.IOSubchannel
Package
Description
Provides components for building a HTTP server based on the
core and IO components.
Provides a base component for generating template based responses
to HTTP requests.
I/O related components built on top of the core package.
Classes for managing processes.
Utility classes, mainly for adapted buffers to specific needs.
Networking related I/O classes.
-
Uses of IOSubchannel 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
HttpServer.onClosed
(Closed<?> event, IOSubchannel netChannel) Forwards aClosed
event to the application channel.void
StaticContentDispatcher.onGet
(Request.In.Get event, IOSubchannel channel) Handles aGET
request.void
HttpServer.onInput
(Input<ByteBuffer> event, IOSubchannel netChannel) Handles data from the client (from upstream).void
HttpServer.onOptions
(Request.In.Options event, IOSubchannel appChannel) Provides a fallback handler for an OPTIONS request with asterisk.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
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”.static void
ResponseCreationSupport.sendResponse
(HttpRequest request, IOSubchannel channel, int statusCode, String reasonPhrase) Send a response to the given request with the given status code and reason phrase, including atext/plain
body with the status code and reason phrase.static void
ResponseCreationSupport.sendResponse
(HttpRequest request, IOSubchannel channel, HttpConstants.HttpStatus status) Shorthand for invokingResponseCreationSupport.sendResponse(HttpRequest, IOSubchannel, int, String)
with a predefined HTTP status.static boolean
ResponseCreationSupport.sendStaticContent
(HttpRequest request, IOSubchannel channel, Function<String, URL> resolver, ResponseCreationSupport.MaxAgeCalculator maxAgeCalculator) Creates and sends a response with static content.static boolean
ResponseCreationSupport.sendStaticContent
(Request.In event, IOSubchannel channel, Function<String, URL> resolver, ResponseCreationSupport.MaxAgeCalculator maxAgeCalculator) Shorthand for invokingResponseCreationSupport.sendStaticContent(HttpRequest, IOSubchannel, Function, MaxAgeCalculator)
with theHttpRequest
from the event. -
Uses of IOSubchannel in org.jgrapes.http.freemarker
Modifier and TypeMethodDescriptionprotected void
FreeMarkerRequestHandler.doRespond
(Request.In event, IOSubchannel channel) Removes the prefix specified in the constructor from the path in the request.protected boolean
FreeMarkerRequestHandler.sendProcessedTemplate
(Request.In event, IOSubchannel channel, freemarker.template.Template tpl) Render a response using the given template.protected boolean
FreeMarkerRequestHandler.sendProcessedTemplate
(Request.In event, IOSubchannel channel, String path) Render a response using the template obtained from the config withConfiguration.getTemplate(String)
and the given path. -
Uses of IOSubchannel in org.jgrapes.io
Modifier and TypeMethodDescriptionstatic IOSubchannel
IOSubchannel.create
(Component component, EventPipeline responsePipeline) Creates a new subchannel of the given component’s channel with the given event pipeline and a buffer pool with two buffers sized 4096.Modifier and TypeMethodDescriptionvoid
PurgeTerminator.onPurge
(Purge event, IOSubchannel channel) -
Uses of IOSubchannel in org.jgrapes.io.process
Modifier and TypeClassDescriptionfinal class
The Class ProcessChannel. -
Uses of IOSubchannel in org.jgrapes.io.util
Modifier and TypeClassDescriptionclass
Provides an I/O subchannel that is linked to another I/O subchannel.Modifier and TypeMethodDescriptionLinkedIOSubchannel.upstreamChannel()
Returns the upstream channel.Modifier and TypeMethodDescriptionstatic Optional
<? extends LinkedIOSubchannel> LinkedIOSubchannel.downstreamChannel
(Manager hub, IOSubchannel upstreamChannel) Returns the linked downstream channel that has been created for the given component and (upstream) subchannel.static <T extends LinkedIOSubchannel>
Optional<T> LinkedIOSubchannel.downstreamChannel
(Manager hub, IOSubchannel upstreamChannel, Class<T> clazz) LikeLinkedIOSubchannel.downstreamChannel(Manager, IOSubchannel)
, but with the return value of the specified type.void
OutputSupplier.emit
(IOSubchannel channel) Emit theOutput
events.ModifierConstructorDescriptionAbstractBufferWriter
(IOSubchannel channel) Creates a new instance that usesOutput
events to dispatch buffers on the given channel, using the channel’s response pipeline.AbstractBufferWriter
(IOSubchannel channel, EventPipeline eventPipeline) Creates a new instance that usesOutput
events to dispatch buffers on the given channel, using the given event pipeline.BufferedReaderPipeline
(BufferedReader in, IOSubchannel channel) Creates a new pipeline that sends the lines from the given reader as events on the given channel, using the channel’s response pipeline.BufferedReaderPipeline
(BufferedReader in, IOSubchannel channel, EventPipeline eventPipeline) Creates a new pipeline that sends the lines from the given reader as events on the given channel, using the given event pipeline.ByteBufferOutputStream
(IOSubchannel channel) Creates a new instance that usesOutput
events to dispatch buffers on the given channel, using the channel’s response pipeline.ByteBufferOutputStream
(IOSubchannel channel, EventPipeline eventPipeline) Creates a new instance that usesOutput
events to dispatch buffers on the given channel, using the given event pipeline.ByteBufferWriter
(IOSubchannel channel) Creates a new instance that usesOutput
events to dispatch buffers on the given channel, using the channel’s response pipeline.ByteBufferWriter
(IOSubchannel channel, EventPipeline eventPipeline) Creates a new instance that usesOutput
events to dispatch buffers on the given channel, using the given event pipeline.CharBufferWriter
(IOSubchannel channel) Creates a new instance that usesOutput
events to dispatch buffers on the given channel, using the channel’s response pipeline.CharBufferWriter
(IOSubchannel channel, EventPipeline eventPipeline) Creates a new instance that usesOutput
events to dispatch buffers on the given channel, using the given event pipeline.InputStreamPipeline
(InputStream in, IOSubchannel channel) Creates a new pipeline that sends the data from the given input stream as events on the given channel, using the channel’s response pipeline.InputStreamPipeline
(InputStream in, IOSubchannel channel, EventPipeline eventPipeline) Creates a new pipeline that sends the data from the given input stream as events on the given channel, using the given event pipeline.LinkedIOSubchannel
(Manager hub, Channel mainChannel, IOSubchannel upstreamChannel, EventPipeline responsePipeline) Creates a new LinkedIOSubchannel for a given main channel that links to the give I/O subchannel.LinkedIOSubchannel
(Manager hub, Channel mainChannel, IOSubchannel upstreamChannel, EventPipeline responsePipeline, boolean linkBack) Creates a new LinkedIOSubchannel for a given main channel that links to a given I/O subchannel. -
Uses of IOSubchannel in org.jgrapes.net
Modifier and TypeInterfaceDescriptioninterface
A special sub channel used for socket connections.Modifier and TypeMethodDescriptionvoid
SslCodec.onAccepted
(Accepted event, IOSubchannel encryptedChannel) Creates a new downstream connection asLinkedIOSubchannel
of the network connection together with anSSLEngine
.void
SslCodec.onClosed
(Closed<Void> event, IOSubchannel encryptedChannel) Handles a close event from the encrypted channel (client).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
SslCodec.onPurge
(Purge event, IOSubchannel encryptedChannel) Forwards aPurge
event downstream.