Package org.apache.mina.proxy.event
Class IoSessionEventQueue
- java.lang.Object
-
- org.apache.mina.proxy.event.IoSessionEventQueue
-
public class IoSessionEventQueue extends java.lang.ObjectIoSessionEventQueue.java - Queue that contains filtered session events while handshake isn't done.- Since:
- MINA 2.0.0-M3
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.LoggerLOGGERprivate ProxyIoSessionproxyIoSessionThe proxy session object.private java.util.Queue<IoSessionEvent>sessionEventsQueueQueue of session events which occurred before the proxy handshake had completed.
-
Constructor Summary
Constructors Constructor Description IoSessionEventQueue(ProxyIoSession proxyIoSession)Creates a new proxyIoSession instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voiddiscardSessionQueueEvents()Discard all events from the queue.voidenqueueEventIfNecessary(IoSessionEvent evt)Event is enqueued only if necessary : - socks proxies do not need the reconnection feature so events are always forwarded for these.private voidenqueueSessionEvent(IoSessionEvent evt)Enqueue an event to be delivered once handshaking is complete.voidflushPendingSessionEvents()Send any session event which were queued while waiting for handshaking to complete.
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
proxyIoSession
private ProxyIoSession proxyIoSession
The proxy session object.
-
sessionEventsQueue
private java.util.Queue<IoSessionEvent> sessionEventsQueue
Queue of session events which occurred before the proxy handshake had completed.
-
-
Constructor Detail
-
IoSessionEventQueue
public IoSessionEventQueue(ProxyIoSession proxyIoSession)
Creates a new proxyIoSession instance- Parameters:
proxyIoSession- The proxy session instance
-
-
Method Detail
-
discardSessionQueueEvents
private void discardSessionQueueEvents()
Discard all events from the queue.
-
enqueueEventIfNecessary
public void enqueueEventIfNecessary(IoSessionEvent evt)
Event is enqueued only if necessary : - socks proxies do not need the reconnection feature so events are always forwarded for these. - http proxies events will be enqueued while handshake has not been completed or until connection was closed. If connection was prematurely closed previous events are discarded and only the session closed is delivered.- Parameters:
evt- the event to enqueue
-
flushPendingSessionEvents
public void flushPendingSessionEvents() throws java.lang.ExceptionSend any session event which were queued while waiting for handshaking to complete. Please note this is an internal method. DO NOT USE it in your code.- Throws:
java.lang.Exception- If something went wrong while flushing the pending events
-
enqueueSessionEvent
private void enqueueSessionEvent(IoSessionEvent evt)
Enqueue an event to be delivered once handshaking is complete.- Parameters:
evt- the session event to enqueue
-
-