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.IoHandlerAdapterA 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 ConnectionConfigurationconfigurationThe configuration for new connections.
-
Constructor Summary
Constructors Modifier Constructor Description protectedConnectionHandler(ConnectionConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexceptionCaught(org.apache.mina.core.session.IoSession session, Throwable cause)voidmessageReceived(org.apache.mina.core.session.IoSession session, Object message)voidmessageSent(org.apache.mina.core.session.IoSession session, Object message)voidsessionClosed(org.apache.mina.core.session.IoSession session)voidsessionIdle(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().voidsessionOpened(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:
sessionOpenedin interfaceorg.apache.mina.core.service.IoHandler- Overrides:
sessionOpenedin classorg.apache.mina.core.service.IoHandlerAdapter- Throws:
Exception
-
sessionClosed
public void sessionClosed(org.apache.mina.core.session.IoSession session) throws Exception- Specified by:
sessionClosedin interfaceorg.apache.mina.core.service.IoHandler- Overrides:
sessionClosedin 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 ExceptionInvoked 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, asClientConnectionHandlerdoes).- Specified by:
sessionIdlein interfaceorg.apache.mina.core.service.IoHandler- Overrides:
sessionIdlein 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:
exceptionCaughtin interfaceorg.apache.mina.core.service.IoHandler- Overrides:
exceptionCaughtin 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:
messageReceivedin interfaceorg.apache.mina.core.service.IoHandler- Overrides:
messageReceivedin classorg.apache.mina.core.service.IoHandlerAdapter- Throws:
Exception
-
-