Package org.jivesoftware.openfire.nio
Class ConnectionHandler
- java.lang.Object
-
- org.apache.mina.core.service.IoHandlerAdapter
-
- org.jivesoftware.openfire.nio.ConnectionHandler
-
- All Implemented Interfaces:
org.apache.mina.core.service.IoHandler
- Direct Known Subclasses:
ClientConnectionHandler
,ComponentConnectionHandler
,MultiplexerConnectionHandler
,ServerConnectionHandler
public abstract class ConnectionHandler extends org.apache.mina.core.service.IoHandlerAdapter
A ConnectionHandler is responsible for creating new sessions, destroying sessions and delivering received XML stanzas to the proper StanzaHandler.- Author:
- Gaston Dombiak
-
-
Field Summary
Fields Modifier and Type Field Description protected ConnectionConfiguration
configuration
The configuration for new connections.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ConnectionHandler(ConnectionConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
exceptionCaught(org.apache.mina.core.session.IoSession session, Throwable cause)
void
messageReceived(org.apache.mina.core.session.IoSession session, Object message)
void
messageSent(org.apache.mina.core.session.IoSession session, Object message)
void
sessionClosed(org.apache.mina.core.session.IoSession session)
void
sessionIdle(org.apache.mina.core.session.IoSession session, org.apache.mina.core.session.IdleStatus status)
Invoked when a MINA session has been idle for half of the allowed XMPP session idle time as specified bygetMaxIdleTime()
.void
sessionOpened(org.apache.mina.core.session.IoSession session)
-
-
-
Field Detail
-
configuration
protected final ConnectionConfiguration configuration
The configuration for new connections.
-
-
Constructor Detail
-
ConnectionHandler
protected ConnectionHandler(ConnectionConfiguration configuration)
-
-
Method Detail
-
sessionOpened
public void sessionOpened(org.apache.mina.core.session.IoSession session) throws Exception
- Specified by:
sessionOpened
in interfaceorg.apache.mina.core.service.IoHandler
- Overrides:
sessionOpened
in classorg.apache.mina.core.service.IoHandlerAdapter
- Throws:
Exception
-
sessionClosed
public void sessionClosed(org.apache.mina.core.session.IoSession session) throws Exception
- Specified by:
sessionClosed
in interfaceorg.apache.mina.core.service.IoHandler
- Overrides:
sessionClosed
in classorg.apache.mina.core.service.IoHandlerAdapter
- Throws:
Exception
-
sessionIdle
public void sessionIdle(org.apache.mina.core.session.IoSession session, org.apache.mina.core.session.IdleStatus status) throws Exception
Invoked when a MINA session has been idle for half of the allowed XMPP session idle time as specified bygetMaxIdleTime()
. This method will be invoked each time that such a period passes (even if no IO has occurred in between). Openfire will disconnect a session the second time this method is invoked, if no IO has occurred between the first and second invocation. This allows extensions of this class to use the first invocation to check for livelyness of the MINA session (e.g by polling the remote entity, asClientConnectionHandler
does).- Specified by:
sessionIdle
in interfaceorg.apache.mina.core.service.IoHandler
- Overrides:
sessionIdle
in classorg.apache.mina.core.service.IoHandlerAdapter
- Throws:
Exception
- See Also:
IoHandlerAdapter.sessionIdle(IoSession, IdleStatus)
-
exceptionCaught
public void exceptionCaught(org.apache.mina.core.session.IoSession session, Throwable cause) throws Exception
- Specified by:
exceptionCaught
in interfaceorg.apache.mina.core.service.IoHandler
- Overrides:
exceptionCaught
in classorg.apache.mina.core.service.IoHandlerAdapter
- Throws:
Exception
-
messageReceived
public void messageReceived(org.apache.mina.core.session.IoSession session, Object message) throws Exception
- Specified by:
messageReceived
in interfaceorg.apache.mina.core.service.IoHandler
- Overrides:
messageReceived
in classorg.apache.mina.core.service.IoHandlerAdapter
- Throws:
Exception
-
-