An abstract implementation of
IoFilterChain
that provides
common operations for developers to implement their own transport layer.
Increases the internal reference count of this buffer to defer
automatic release.
Increases the internal reference count of this buffer to defer
automatic release.
Adds the specified filter with the specified name just after the filter whose name is
baseName
in this chain.
Adds the specified filter with the specified name just after the filter whose name is
baseName
in this chain.
Adds the specified filter with the specified name just before the filter whose name is
baseName
in this chain.
Adds the specified filter with the specified name just before the filter whose name is
baseName
in this chain.
Adds the specified filter with the specified name at the beginning of this chain.
Adds the specified filter with the specified name at the beginning of this chain.
add a logging filter at begining of the chain
Adds the specified filter with the specified name at the end of this chain.
Adds the specified filter with the specified name at the end of this chain.
add a logging filter at end of the chain
Adds an event listener which is notified when
the state of this future changes.
This mask resumes both reads and writes if any of them were suspended.
Returns the direct or heap buffer which is capable of the specified
size.
Returns the buffer which is capable of the specified size.
Returns the buffer which is capable of the specified size.
Returns the buffer which is capable of the specified size.
Peforms an AND operation on this mask with the specified
mask and returns the result.
A SocketAddress
which represents anonymous address.
Creates a new instance with the specifid port number.
Returns an InputStream
that reads the data from this buffer.
Returns an InputStream
that reads the data from this buffer.
Returns an OutputStream
that appends the data into this buffer.
Returns an OutputStream
that appends the data into this buffer.
Attach this filter to the specified builder.
Attach this filter to the specified filter chain.
A special line delimiter which is used for auto-detection of
EOL in
TextLineDecoder
.
This method forwards the call to
expand(int)
only when
autoExpand property is
true.
This method forwards the call to
expand(int)
only when
autoExpand property is
true.
Checks to see if a specific port is available.
Finds currently available server ports.
Changes the capacity of this buffer.
Changes the capacity of this buffer.
Changes the capacity of this buffer.
Implement this method to increase the capacity of this buffer.
Creates a new instance which executes the specified
IoHandlerChain
on a
messageReceived event.
Cleans up the resources used by the compression library.
Removes all filters added to this chain.
Removes all filters added to this chain.
Returns a deep clone of this configuration.
Returns a deep clone of this configuration.
Returns a deep clone of this configuration.
Returns a deep clone of this configuration.
Returns a deep clone of this configuration.
Closes this session immediately.
Implement this method to perform real close operation.
close all the managed sessions
An
IoFuture
for asynchronous close requests.
Start SSL shutdown process.
Requests this processor to close the specified session.
The default compression level used.
Provides the best speed at the price of a low compression ratio.
No compression done on the data.
Creates a new instance which compresses outboud data and decompresses
inbound data with default compression level.
Creates a new instance which compresses outboud data and decompresses
inbound data with the specified compressionLevel.
Connects to the specified address
.
Connects to the specified address
.
Connects to the specified address
.
Connects to the specified address
.
Connects to the specified address
.
Connects to the specified address
.
An
IoFuture
for asynchronous connect requests.
Returns
true if this chain contains an
IoFilter
of the
specified
filterType.
Returns
true if this chain contains an
IoFilter
of the
specified
filterType.
Returns true if this chain contains the specified filter.
Returns true if this chain contains the specified filter.
Returns
true if this chain contains an
IoFilter
with the
specified
name.
Returns
true if this chain contains an
IoFilter
with the
specified
name.
Returns true if this session contains the attribute with
the specified key.
Creates a new Mina byte buffer that is a deep copy of the remaining bytes
in the given buffer (between index buf.position() and buf.limit())
A
ProtocolDecoder
that cumulates the content of received
buffers to a
cumulative buffer to help users implement decoders.
The attribute name used when binding the InputStream
to the session.
Transport type: UDP/IP (Registry name: "DATAGRAM" or "UDP")
Creates a new instance using a NewThreadExecutor
Creates a new instance using a NewThreadExecutor
Checks the specified buffer is decodable by this decoder.
Decodes binary or protocol-specific content into higher-level message objects.
Decodes binary or protocol-specific content into higher-level message objects.
Decodes binary or protocol-specific content into higher-level message objects.
Decodes binary or protocol-specific content into higher-level message objects.
the line delimiter constant of the current O/S.
The default buffer size this filter uses for writing.
Creates a new instance which uses the specified object as a lock.
Creates a new instance which uses the specified object as a lock.
A default
ExceptionMonitor
implementation that logs uncaught
exceptions using
Logger
.
Creates a new instance with an empty filter list.
Creates a new instance which uses the specified object as a lock.
Release allocated ByteBuffers.
A flag that allows you to disable compression once.
A session attribute key that makes next one write request bypass
this filter (not encrypting the data).
Dispose of this allocator.
Stops the thread which releases unused buffers and make this allocator unusable from now on.
Dispose of this allocator.
Releases the cumulative buffer used by the specified session.
Releases all resources related with this decoder.
Override this method to dispose all resources related with this decoder.
Releases all resources related with this encoder.
Override this method dispose all resources related with this encoder.
Releases all resources related with this decoder.
Releases all resources related with this encoder.
Releases all resources related with this decoder.
Implement this method to release all resources acquired to perform
encoding and decoding messages for the specified session.
Implement this method to consume the specified cumulative buffer and
decode its content into message(s).
Returns the
IoFilter
with the specified
name in this chain.
Returns the
IoFilter
with the specified
name in this chain.
Returns the current allocator which manages the allocated buffers.
Get decrypted application data.
Returns an attachment of this session.
Returns the value of user-defined attribute of this session.
Returns the set of keys of all user-defined attributes.
Returns the Set
of currently available port numbers
(Integer
).
Returns the Set
of currently avaliable port numbers (Integer
)
between the specified port range.
average bytes read per seconds for all the managed sessions
average bytes written per seconds for all the managed sessions
average messages read per seconds for all the managed sessions
average messages written per seconds for all the managed sessions
get the read bytes per second throughput
works only if a stat collector is inspecting this session,
get the written bytes per second throughput
works only if a stat collector is inspecting this session,
Returns the
IoHandlerCommand
this handler will use to
handle
messageReceived events.
Returns the configuration of this session.
Returns the configuration of this session.
Returns the connect timeout in seconds.
Returns the connect timeout in seconds.
Returns the connect timeout in milliseconds.
Returns the connect timeout in milliseconds.
Returns the time in millis when this session is created.
when the session was created
Returns a new (or reusable) instance of
ProtocolDecoder
which
decodes binary or protocol-specific data into message objects.
Creates a new message decoder.
Returns a new (or reusable) instance of
ProtocolDecoder
which
decodes binary or protocol-specific data into message objects.
Returns a new (or reusable) instance of
ProtocolDecoder
which
decodes binary or protocol-specific data into message objects.
Returns the decoder this decoder is decorating.
Returns a new (or reusable) instance of
ProtocolDecoder
which
decodes binary or protocol-specific data into message objects.
Returns the allowed maximum size of the line to be decoded.
Returns the allowed maximum size of the object to be decoded.
Returns the default configuration which is used when you didn't specify
any configuration.
Returns the default configuration which is used when you didn't specify
any configuration.
Returne the destination of this write request.
Returns the list of cipher suites to be enabled when SSLEngine
is initialized.
Returns the list of protocols to be enabled when SSLEngine
is initialized.
Returns a new (or reusable) instance of
ProtocolEncoder
which
encodes message objects into binary or protocol-specific data.
Creates a new message encoder.
Returns a new (or reusable) instance of
ProtocolEncoder
which
encodes message objects into binary or protocol-specific data.
Returns a new (or reusable) instance of
ProtocolEncoder
which
encodes message objects into binary or protocol-specific data.
Returns the encoder this encoder is decorating.
Returns a new (or reusable) instance of
ProtocolEncoder
which
encodes message objects into binary or protocol-specific data.
Returns the allowed maximum size of the encoded line.
Returns the allowed maximum size of the encoded object.
Returns the underlying Executor
instance this filter uses.
Returns the underlying Executor
of this model.
Returns the filter chain that only affects this session.
Returns the filter chain that only affects this session.
Returns
WriteFuture
that is associated with this write request.
Returns the
IoHandler
which handles this session.
Returns the
IoHandler
which handles this session.
Returns hexdump of this buffer.
Returns hexdump of this buffer.
Returns the hexdump of the unknown message part.
Returns the number of the fired continuous
sessionIdle events
for the specified
IdleStatus
.
Returns idle time for the specified type of idleness in seconds.
Returns idle time for the specified type of idleness in milliseconds.
get the list of filters installed in the filter chain
Returns the current exception monitor.
Returns an appropriate
TrafficMask
instance from the
specified
interestOps.
Returns the transport type of the specified name.
Returns an interestOps of SelectionKey
for this mask.
Returns the time in millis when the last
sessionIdle event
is fired for the specified
IdleStatus
.
Returns the time in millis when I/O occurred lastly.
last time the session processed an IO
Returns the time in millis when read operation occurred lastly.
last time the session processed an read
Returns the time in millis when write operation occurred lastly.
last time the session processed a write
Returns the socket address of local machine which is associated with this
session.
Returns the socket address of local machine which is associated with this
session.
Returns the lock object this future acquires.
Returns all SocketAddress
es this service is managing.
Returns all SocketAddress
es this service is managing.
amount of session currently managed
Returns all sessions with the specified remote or local address,
which are currently managed by this service.
Returns all sessions with the specified remote or local address,
which are currently managed by this service.
Returns the allowed maximum size of the line to be decoded.
Returns the allowed maximum size of the encoded line.
Returns the allowed maximum size of the object to be decoded.
Returns the allowed maximum size of the encoded object.
Returns the allowed maximum size of the object to be decoded.
Returns the allowed maximum size of the encoded object.
Returns a message object to be written.
Returns the message and the hexdump of the unknown part.
get the read messages per second throughput
works only if a stat collector is inspecting this session, and only if a ProtocolDecoderFilter is used
Returns the set of message classes this encoder can encode.
Messages written per second
get the written messages per second throughput
works only if a stat collector is inspecting this session, and only if a ProtocolDecoderFilter is used
Returns the name of the filter.
Returns the name of the command.
Returns the name of this mask.
Returns the known names of this transport type.
Gets the next available port starting at the lowest port number.
Gets the next available port starting at a port.
Reads a Java object from the buffer using the context ClassLoader
of the current thread.
Reads a Java object from the buffer using the context ClassLoader
of the current thread.
Reads a Java object from the buffer using the specified classLoader.
Reads a Java object from the buffer using the specified classLoader.
Get encrypted data to be sent.
Reads a string which has a 16-bit length field before the actual
encoded string, using the specified decoder
and returns it.
Reads a string which has a 16-bit length field before the actual
encoded string, using the specified decoder
and returns it.
Reads a string which has a length field before the actual
encoded string, using the specified decoder
and returns it.
Reads a string which has a length field before the actual
encoded string, using the specified decoder
and returns it.
Returns the total number of bytes which were read from this session.
bytes read from the beginning
Returns the total number of messages which were read and decoded from this session.
PDU decoded from the beginning.
Returns read timeout in seconds.
Returns the socket address of remote peer.
Returns the socket address of remote peer.
Returns the number of bytes which are scheduled to be written to this
session.
Returns the number of write requests which are scheduled to be written
to this session.
Returns the
IoService
which provides I/O service to this session.
Returns the
IoService
which provides I/O service to this session.
Returns the socket address of the
IoService
listens to to manage
this session.
Returns the socket address of the
IoService
listens to to manage
this session.
Returns
IoSession
which is the result of connect operation.
Returns the
IoSession
which is associated with this future.
Retrieves the session to which this handler is assigned.
Resturns the default configuration of the new
IoSession
s.
Resturns the default configuration of the new
IoSession
s.
Resturns the default configuration of the new
IoSession
s.
Resturns the default configuration of the new
IoSession
s.
Resturns the default configuration of the new
IoSession
s.
Please note that enabling SO_LINGER in Java NIO can result
in platform-dependent behavior and unexpected blocking of I/O thread.
Returns the underlying SSLSession
for the specified session.
Reads a NUL
-terminated string from this buffer using the
specified decoder
and returns it.
Reads a NUL
-terminated string from this buffer using the
specified decoder
and returns it.
Reads a NUL
-terminated string from this buffer using the
specified decoder
and returns it.
Reads a NUL
-terminated string from this buffer using the
specified decoder
and returns it.
Returns the timeout value of this allocator in seconds.
Returns the timeout value of this allocator in milliseconds.
bytes read per seconds sum of all the managed sessions
bytes written per seconds sum for all the managed sessions
messages read per seconds sum of all the managed sessions
messages written per seconds sum for all the managed sessions
total number of sessions processed by the stat collector
Returns transport type of this session.
Returns transport type of this session.
Reads one unsigned byte as a short integer.
Reads one unsigned byte as a short integer.
Reads one byte as an unsigned short integer.
Reads one byte as an unsigned short integer.
Reads four bytes unsigned integer.
Reads four bytes unsigned integer.
Reads four bytes unsigned integer.
Reads four bytes unsigned integer.
Reads two bytes unsigned integer.
Reads two bytes unsigned integer.
Reads two bytes unsigned integer.
Reads two bytes unsigned integer.
Returns the result of the asynchronous operation.
Return the delimiter string.
How many seconds to keep the connection thread alive between connection requests
Returns the size of the write buffer in bytes.
Returns write timeout in seconds.
Returns write timeout in seconds.
Returns write timeout in milliseconds.
Returns the total number of bytes which were written to this session.
bytes written from the beginning
Returns the total number of messages which were written and encoded by this session.
PDU encoded from the beginning.
Returns the total number of write requests which were written to this session.
An IdentityHashMap
-backed Set
.
Accepts incoming connection, communicates with clients, and fires events to
IoHandler
s.
A configuration which is used to configure
IoAcceptor
.
Connects to endpoint, communicates with the server, and fires events to
IoHandler
s.
A configuration which is used to configure
IoConnector
.
A filter which intercepts
IoHandler
events like Servlet
filters.
Represents the result of an ashynchronous I/O operation.
Something interested in being notified when the result
of an
IoFuture
becomes available.
Handles all I/O events fired by MINA.
A
IoHandlerCommand
encapsulates a unit of processing work to be
performed, whose purpose is to examine and/or modify the state of a
transaction that is represented by custom attributes provided by
IoSession
.
A configuration which is used to configure
IoService
.
Something interested in being notified when the result
of an
IoFuture
becomes available.
A helper which provides addition and removal of
IoServiceListener
s and firing
events.
A handle which represents connection between two endpoints regardless of
transport types.
create the session manager
MBean interface for the session manager, it's used for instrumenting IoSession
An
OutputStream
that forwards all write operations to
the associated
IoSession
.
A connectionless transport can recycle existing sessions by assigning an
IoSessionRecyler to its
IoServiceConfig
.
The collected stats for a session.
Returns true if and only if autoExpand is turned on.
Returns true if and only if autoExpand is turned on.
Returns true if and only if autoExpand is turned on.
Returns true if the close request is finished and the session is closed.
Returns true if the close request is finished and the session is closed.
Returns true if and only if this session is being closed
(but not disconnected yet) or is closed.
Returns true if incoming data is being compressed.
Returns true if the filter is compressing data being written.
Returns true if the connect operation is finished successfully.
Returns true
if this session is connected with remote peer.
is the session is connected
Returns true
if the session of this transport type is
connectionless.
Returns true if and only if all clients are disconnected
when this acceptor unbinds the related local address.
Returns true
if the stack is empty.
Returns true
if the stack is empty.
Check if handshake is completed.
Returns
true
if this session is idle for the specified
IdleStatus
.
Returns true if this service is managing the specified serviceAddress.
Returns true if this service is managing the specified serviceAddress.
Returns true if the engine will require client authentication.
Returns true if and only if this buffer is returned back
to the buffer pool when released.
Returns true if and only if this buffer is returned back
to the buffer pool when released.
Returns true if this mask allows a read operation.
Returns if the asynchronous operation is finished.
Returns true if and only if the specified session is
encrypted/decrypted over SSL/TLS currently.
Returns true if the engine is set to use client mode
when handshaking.
Returns true if the engine will request client authentication.
Returns true if this mask allows a write operation.
Check we are writing encrypted data.
Returns true if the write operation is finished successfully.
Returns true if the write operation is finished successfully.
Creates a new instance with the default timeout.
Creates a new instance with the specified timeout.
pop() - method in class org.apache.mina.util.
Stack Pops from this stack.
Session attribute key: prefix string
Session attribute key: prefix string
Returns true if this buffer contains a data which has a data
length as a prefix and the buffer has remaining data as enough as
specified in the data length field.
Returns true if this buffer contains a data which has a data
length as a prefix and the buffer has remaining data as enough as
specified in the data length field.
Implement this method to execute your stream I/O logic;
please note that you must forward the process request to other
thread or thread pool.
Constructs a new instance.
Constructs a new instance with the specified message.
Constructs a new instance with the specified message and the specified
cause.
Constructs a new instance with the specified cause.
Decodes binary or protocol-specific data into higher-level message objects.
Constructs a new instance.
Constructs a new instance with the specified message.
Constructs a new instance with the specified message and the specified
cause.
Constructs a new instance with the specified cause.
Encodes higher-level message objects into binary or protocol-specific data.
An abstract
ProtocolEncoder
implementation for those who don't have any
resources to dispose.
An exception that is thrown when
ProtocolEncoder
cannot understand or failed to validate the specified message object.
Constructs a new instance.
Constructs a new instance with the specified message.
Constructs a new instance with the specified message and the specified
cause.
Constructs a new instance with the specified cause.
Writes the content of the specified src into this buffer.
Writes the content of the specified src into this buffer.
Writes the content of the specified src into this buffer.
Writes the content of the specified src into this buffer.
Writes the content of the specified src into this buffer.
Called when the underlying transport creates or writes a new
IoSession
.
Called when the underlying transport creates or writes a new
IoSession
.
Writes the specified Java object to the buffer.
Writes the specified Java object to the buffer.
Writes the content of in
into this buffer as a
string which has a 16-bit length field before the actual
encoded string, using the specified encoder
.
Writes the content of in
into this buffer as a
string which has a 16-bit length field before the actual
encoded string, using the specified encoder
.
Writes the content of in
into this buffer as a
string which has a 16-bit length field before the actual
encoded string, using the specified encoder
.
Writes the content of in
into this buffer as a
string which has a 16-bit length field before the actual
encoded string, using the specified encoder
.
Writes the content of in
into this buffer as a
string which has a 16-bit length field before the actual
encoded string, using the specified encoder
.
Writes the content of in
into this buffer as a
string which has a 16-bit length field before the actual
encoded string, using the specified encoder
.
Writes the content of in
into this buffer as a
string which has a 16-bit length field before the actual
encoded string, using the specified encoder
.
Writes the content of in
into this buffer as a
string which has a 16-bit length field before the actual
encoded string, using the specified encoder
.
Writes the content of in
into this buffer using the
specified encoder
.
Writes the content of in
into this buffer using the
specified encoder
.
Writes the content of in
into this buffer as a
NUL
-terminated string using the specified
encoder
.
Writes the content of in
into this buffer as a
NUL
-terminated string using the specified
encoder
.
Invoked when a new service is activated by an
IoService
.
Invoked when a service is deactivated by an
IoService
.
Invoked when the connection is closed.
Invoked when the connection is closed.
Forwards sessionClosed event to next filter.
Invoked when a connection is closed.
Invoked when a connection is closed.
Invoked when the session is created.
Invoked when the session is created.
Forwards sessionCreated event to next filter.
Invoked from an I/O processor thread when a new connection has been created.
Invoked from an I/O processor thread when a new connection has been created.
Invoked when a new session is created by an
IoService
.
Creates a new instance with the factory passed to the constructor of
this class.
Invoked when a session is being destroyed by an
IoService
.
Invoked when the connection is idle.
Invoked when the connection is idle.
Forwards sessionIdle event to next filter.
Invoked with the related
IdleStatus
when a connection becomes idle.
Invoked with the related
IdleStatus
when a connection becomes idle.
Provides utility methods to log protocol-specific messages.
Invoked when the connection is opened.
Invoked when the connection is opened.
Forwards sessionOpened event to next filter.
Invoked when a connection has been opened.
Invoked when a connection has been opened.
Initializes streams and timeout settings.
Changes the current allocator with the specified one to manage
the allocated buffers from now.
Sets an attachment of this session.
Sets a user defined attribute without a value.
Sets a user-defined attribute.
Turns on or off autoExpand.
Turns on or off autoExpand.
Turns on or off autoExpand.
Sets the addresses to be blacklisted.
Sets the addresses to be blacklisted.
Marks this future as closed and notifies all threads waiting for this
future.
Marks this future as closed and notifies all threads waiting for this
future.
Sets if incoming data has to be compressed.
Set if outgoing data has to be compressed.
Sets the connect timeout in seconds.
Sets the connect timeout in seconds.
Sets the allowed maximum size of the line to be decoded.
Sets the allowed maximum size of the object to be decoded.
Sets the config this acceptor will use by default.
Sets the config this acceptor will use by default.
Sets the default config this connector should use.
Sets the config this connector will use by default.
Sets the config this acceptor will use by default.
Sets the config this connector will use by default.
Sets whether all clients are disconnected when this acceptor unbinds the
related local address.
Sets the list of cipher suites to be enabled when SSLEngine
is initialized.
Sets the list of protocols to be enabled when SSLEngine
is initialized.
Sets the allowed maximum size of the encoded line.
Sets the allowed maximum size of the encoded object.
Sets the exception caught due to connection failure and notifies all
threads waiting for this future.
Changes the underlying Executor
of this model.
Sets the hexdump of the unknown message part.
Sets idle time for the specified type of idleness in seconds.
Sets the uncaught exception monitor.
Set the maximum amount of data to buffer in the ThreadPoolFilter prior to disabling
reads.
Sets the allowed maximum size of the line to be decoded.
Sets the allowed maximum size of the encoded line.
Sets the allowed maximum size of the object to be decoded.
Sets the allowed maximum size of the encoded object.
Sets the allowed maximum size of the object to be decoded.
Sets the allowed maximum size of the encoded object.
Configures the engine to require client authentication.
Sets whether this buffer is returned back to the buffer pool when released.
Sets whether this buffer is returned back to the buffer pool when released.
Sets read timeout in seconds.
Sets the newly connected session and notifies all threads waiting for
this future.
Please note that enabling SO_LINGER in Java NIO can result
in platform-dependent behavior and unexpected blocking of I/O thread.
Sets the timeout value of this allocator in seconds.
Sets the
TrafficMask
of this session which will result
the parent
IoService
to start to control the traffic
of this session immediately.
Configures the engine to use client (or server) mode when handshaking.
Sets the result of the asynchronous operation, and mark it as finished.
Configures the engine to request client authentication.
Set how many seconds the connection worker thread should remain alive once idle before terminating itself.
Sets the size of the write buffer in bytes.
Sets write timeout in seconds.
Sets write timeout in seconds.
Sets whether the message is written or not, and notifies all threads
waiting for this future.
Sets whether the message is written or not, and notifies all threads
waiting for this future.
A session handler without an
IoSession
parameter for simplicity.
Creates a new instance that is assigned to the passed in session.
Returns the number of elements in the stack.
Returns the number of elements in the stack.
Forwards the position of this buffer as the specified size
bytes.
Forwards the position of this buffer as the specified size
bytes.
Transport type: TCP/IP (Registry name: "SOCKET" or "TCP")
Create an acceptor with a single processing thread using a NewThreadExecutor
Create an acceptor with the desired number of processing threads
Create a connector with a single processing thread using a NewThreadExecutor
Create a connector with the desired number of processing threads
A session attribute key that stores underlying SSLSession
for each session.
An SSL filter that encrypts and decrypts the data exchanged in the session.
Creates a new SSL filter using the specified SSLContext
.
A message that is sent from
SSLFilter
when the connection became
secure or is not secure anymore.
A helper class using the SSLEngine API to decrypt/encrypt data.
Construct a new, empty stack.
Start collecting stats for the
IoSession
of the service.
start collecting throughput statistics for all the managed sessions
(Re)starts SSL session for the specified session if not started yet.
Create a stat collector for the given service with a default polling time of 5 seconds.
create a stat collector for the given given service
stop collecting throughput statistics
Stops the SSL session by sending TLS close_notify message to
initiate TLS closure.
A
IoHandler
that adapts asynchronous MINA events to stream I/O.
Clears this buffer and fills its content with NUL.
Clears this buffer and fills its content with NUL.
Clears this buffer and fills its content with value.
Clears this buffer and fills its content with value.
A
ProtocolDecoder
implementation which decorates an existing decoder
to be thread-safe.
Creates a new instance which decorates the specified decoder.
A
ProtocolEncoder
implementation which decorates an existing encoder
to be thread-safe.
Creates a new instance which decorates the specified encoder.