Top Description Inners Fields Constructors Methods
org.glassfish.grizzly.filterchain

public Class TransportFilter

extends BaseFilter
Class Inheritance
Known Direct Subclasses
org.glassfish.grizzly.ssl.SSLBaseFilter.SSLTransportFilterWrapper
Imports
java.io.IOException, org.glassfish.grizzly.Buffer, .CompletionHandler, .Connection, .Transport, org.glassfish.grizzly.nio.transport.TCPNIOTransport, .UDPNIOTransport

Transport Filter implementation, which should work with any Transport. This Filter tries to delegate I/O event processing to the Transport's specific transport Filter. If Transport doesn't have own implementation - uses common I/O event processing logic. TransportFilter could be set to work in 2 modes: stream or message. In stream mode, TransportFilter produces/consumes the socket channel directly. In message mode, TransportFilter represents Connection data as Buffer, using FilterChainContext#getMessage()}, FilterChainContext#setMessage(Object). For specific Transport, one mode could be more preferable than another. For example TCPNIOTransport works just in stream mode. UDPNIOTransport prefers message mode, but could also work in stream mode.
Author
Alexey Stashok

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private static final TransportFilter.FlushEvent
FLUSH_EVENT

TransportFilter flush command event

Constructor Summary

AccessConstructor and Description
public
TransportFilter()

Create TransportFilter.

Method Summary

Modifier and TypeMethod and Description
public static FilterChainEvent
public static FilterChainEvent
createFlushEvent(final CompletionHandler<E> completionHandler)

public void
protected Filter

Returns:

default Transport specific transport filter.
getTransportFilter0
(final Transport transport)

Get default Transport specific transport filter.

public NextAction
public NextAction
public NextAction
public NextAction
handleEvent(final FilterChainContext ctx, final FilterChainEvent event)

Overrides org.glassfish.grizzly.filterchain.BaseFilter.handleEvent.

Implements org.glassfish.grizzly.filterchain.Filter.handleEvent.

Delegates event operation to Transport's specific transport filter.

public NextAction
handleRead(final FilterChainContext ctx)

Overrides org.glassfish.grizzly.filterchain.BaseFilter.handleRead.

Implements org.glassfish.grizzly.filterchain.Filter.handleRead.

Delegates reading operation to Transport's specific transport filter.

public NextAction
handleWrite(final FilterChainContext ctx)

Overrides org.glassfish.grizzly.filterchain.BaseFilter.handleWrite.

Implements org.glassfish.grizzly.filterchain.Filter.handleWrite.

Delegates writing operation to Transport's specific transport filter.

Inherited from org.glassfish.grizzly.filterchain.BaseFilter:
createContextonAddedonFilterChainChangedonRemovedtoString

Field Detail

FLUSH_EVENTback to summary
private static final TransportFilter.FlushEvent FLUSH_EVENT

TransportFilter flush command event

Constructor Detail

TransportFilterback to summary
public TransportFilter()

Create TransportFilter.

Method Detail

createFlushEventback to summary
public static FilterChainEvent createFlushEvent()
Annotations
@SuppressWarnings:UnusedDeclaration
createFlushEventback to summary
public static FilterChainEvent createFlushEvent(final CompletionHandler<E> completionHandler)
exceptionOccurredback to summary
public void exceptionOccurred(FilterChainContext ctx, Throwable error)

Overrides org.glassfish.grizzly.filterchain.BaseFilter.exceptionOccurred.

Implements org.glassfish.grizzly.filterchain.Filter.exceptionOccurred.

Delegates exception operation to Transport's specific transport filter.

Annotations
@Override
getTransportFilter0back to summary
protected Filter getTransportFilter0(final Transport transport)

Get default Transport specific transport filter.

Parameters
transport:Transport

Transport.

Returns:Filter

default Transport specific transport filter.

handleAcceptback to summary
public NextAction handleAccept(final FilterChainContext ctx) throws IOException

Overrides org.glassfish.grizzly.filterchain.BaseFilter.handleAccept.

Implements org.glassfish.grizzly.filterchain.Filter.handleAccept.

Delegates accept operation to Transport's specific transport filter.

Annotations
@Override
handleCloseback to summary
public NextAction handleClose(final FilterChainContext ctx) throws IOException

Overrides org.glassfish.grizzly.filterchain.BaseFilter.handleClose.

Implements org.glassfish.grizzly.filterchain.Filter.handleClose.

Delegates close operation to Transport's specific transport filter.

Annotations
@Override
handleConnectback to summary
public NextAction handleConnect(final FilterChainContext ctx) throws IOException

Overrides org.glassfish.grizzly.filterchain.BaseFilter.handleConnect.

Implements org.glassfish.grizzly.filterchain.Filter.handleConnect.

Delegates connect operation to Transport's specific transport filter.

Annotations
@Override
handleEventback to summary
public NextAction handleEvent(final FilterChainContext ctx, final FilterChainEvent event) throws IOException

Overrides org.glassfish.grizzly.filterchain.BaseFilter.handleEvent.

Implements org.glassfish.grizzly.filterchain.Filter.handleEvent.

Delegates event operation to Transport's specific transport filter.

Annotations
@Override
handleReadback to summary
public NextAction handleRead(final FilterChainContext ctx) throws IOException

Overrides org.glassfish.grizzly.filterchain.BaseFilter.handleRead.

Implements org.glassfish.grizzly.filterchain.Filter.handleRead.

Delegates reading operation to Transport's specific transport filter.

Annotations
@Override
handleWriteback to summary
public NextAction handleWrite(final FilterChainContext ctx) throws IOException

Overrides org.glassfish.grizzly.filterchain.BaseFilter.handleWrite.

Implements org.glassfish.grizzly.filterchain.Filter.handleWrite.

Delegates writing operation to Transport's specific transport filter.

Annotations
@Override
org.glassfish.grizzly.filterchain back to summary

public final Class TransportFilter.FlushEvent

extends Object
implements FilterChainEvent
Class Inheritance
All Implemented Interfaces
org.glassfish.grizzly.filterchain.FilterChainEvent

Field Summary

Modifier and TypeField and Description
pack-priv final CompletionHandler<E>
public static final Object

Constructor Summary

AccessConstructor and Description
private
private
FlushEvent(final CompletionHandler<E> completionHandler)

Method Summary

Modifier and TypeMethod and Description
public CompletionHandler<E>
public Object
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

completionHandlerback to summary
pack-priv final CompletionHandler<E> completionHandler
TYPEback to summary
public static final Object TYPE

Constructor Detail

FlushEventback to summary
private FlushEvent()
FlushEventback to summary
private FlushEvent(final CompletionHandler<E> completionHandler)

Method Detail

getCompletionHandlerback to summary
public CompletionHandler<E> getCompletionHandler()
typeback to summary
public Object type()

Implements org.glassfish.grizzly.filterchain.FilterChainEvent.type.

Annotations
@Override