public abstract class AbstractProxyHandler extends AbstractStreamHandler
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractProxyHandler(ISessionConfig config,
ISessionStructureFactory factory)
Constructs a proxy connection handler with the default (10 seconds)
connection timeout, configuration and factory.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available(ByteBuffer data,
boolean flipped)
Determines how many bytes can be read from the input buffer after
receiving new data from the remote end.
|
AbstractProxyHandler |
connectionTimeout(long connectionTimeout)
Configures the proxy connection timeout.
|
void |
event(SessionEvent event)
Called to notify about a change of the associated session state.
|
ISessionStructureFactory |
getFactory()
Returns the factory object that will be used to configure the internal
structure of the associated session.
|
protected abstract void |
handleReady()
Called to initiate the connection process via a proxy protocol
|
void |
timer(Object event)
Called to notify about an expiration of the timer identified by the
specified event object.
|
available, getSession, setSessionevent, exception, getConfig, getName, incident, read, read, timerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitevent, exception, getConfig, getName, incident, read, read, read, timerread, readprotected AbstractProxyHandler(ISessionConfig config, ISessionStructureFactory factory)
NOTE: The connection timeout will have no effect if the associated session does not support a session timer.
config - the session configuration object, or null to use the
default configurationfactory - the factory that will be used to configure the internal
structure of the associated session, or null to use
the default factorypublic AbstractProxyHandler connectionTimeout(long connectionTimeout)
NOTE: The connection timeout will have no effect if the associated session does not support a session timer.
connectionTimeout - the proxy connection timeout in milliseconds, or 0
to wait an infinite amount of time for establishing
the HTTP tunnelIllegalArgumentException - if the connection timeout is negativepublic int available(ByteBuffer data, boolean flipped)
AbstractStreamHandlerread method.
This method is called only if the input buffer is not backed by an array.
The type of the input buffer is specified by the implementation of the
ISessionStructureFactory returned by the
getFactory method.
The inner state of the passed buffer cannot be changed by this method.
This implementation always returns total number of bytes in the buffer.
available in interface IStreamReaderavailable in class AbstractStreamHandlerdata - the input buffer.flipped - specifies the current mode of the bufferprotected abstract void handleReady()
throws Exception
Exception - if a failure occurredpublic void event(SessionEvent event)
IHandlerevent in interface IHandlerevent in class AbstractHandlerevent - an event related with the change of the session stateSessionEventpublic void timer(Object event)
IHandlertimer in interface IHandlertimer in class AbstractHandlerevent - the event object that identifies the timerpublic ISessionStructureFactory getFactory()
IHandlergetFactory in interface IHandlergetFactory in class AbstractHandlerISessionStructureFactoryCopyright © 2017–2022 SNF4J.ORG. All rights reserved.