public interface TCPProxyFilter
In addition, filters are registered with a PicoContainer. They can learn
about a Logger, other filters, and custom components (see the
TCPProxy -component option) through constructor injection. Filters
can also implement the PicoContainer life cycle methods
Startable and Disposable.
Well behaved filters should not swallow InterruptedExceptions.
Ideally, they should convert InterruptedExceptions to
UncheckedInterruptedExceptions; but alternatively
they could reinstate the Thread's interrupted status.
The equality semantics of the
ConnectionDetails passed to each method can be used to uniquely
identify a connection.
| Modifier and Type | Interface and Description |
|---|---|
static class |
TCPProxyFilter.FilterException
Exception type for filter problems.
|
| Modifier and Type | Method and Description |
|---|---|
void |
connectionClosed(ConnectionDetails connectionDetails)
A connection has been closed.
|
void |
connectionOpened(ConnectionDetails connectionDetails)
A new connection has been opened.
|
byte[] |
handle(ConnectionDetails connectionDetails,
byte[] buffer,
int bytesRead)
Handle a message fragment from the stream.
|
byte[] handle(ConnectionDetails connectionDetails, byte[] buffer, int bytesRead) throws TCPProxyFilter.FilterException
connectionDetails - Describes the connection.buffer - Contains the data.bytesRead - How many bytes of data in buffer.byte[]
which will be transmitted to the server instead of
buffer.TCPProxyFilter.FilterException - If an error occurs.void connectionOpened(ConnectionDetails connectionDetails) throws TCPProxyFilter.FilterException
connectionDetails - Describes the connection.TCPProxyFilter.FilterException - If an error occurs.void connectionClosed(ConnectionDetails connectionDetails) throws TCPProxyFilter.FilterException
connectionDetails - Describes the connection.TCPProxyFilter.FilterException - If an error occurs.Copyright © 2000-2014. All Rights Reserved.