org.red5.server.net.rtmp
Class RTMPMinaIoHandler

java.lang.Object
  extended by org.apache.mina.core.service.IoHandlerAdapter
      extended by org.red5.server.net.rtmp.RTMPMinaIoHandler
All Implemented Interfaces:
org.apache.mina.core.service.IoHandler, ApplicationContextAware
Direct Known Subclasses:
EdgeRTMPMinaIoHandler

public class RTMPMinaIoHandler
extends org.apache.mina.core.service.IoHandlerAdapter
implements ApplicationContextAware

Handles all RTMP protocol events fired by the MINA framework.


Constructor Summary
RTMPMinaIoHandler()
           
 
Method Summary
protected  RTMPMinaConnection createRTMPMinaConnection()
           
 void exceptionCaught(org.apache.mina.core.session.IoSession session, Throwable cause)
          
protected  IRTMPConnManager getRtmpConnManager()
           
 void messageReceived(org.apache.mina.core.session.IoSession session, Object in)
          
 void messageSent(org.apache.mina.core.session.IoSession session, Object message)
          
protected  void rawBufferRecieved(ProtocolState state, org.apache.mina.core.buffer.IoBuffer in, org.apache.mina.core.session.IoSession session)
          Handle raw buffer receiving event.
 void sessionClosed(org.apache.mina.core.session.IoSession session)
          
 void sessionCreated(org.apache.mina.core.session.IoSession session)
          
 void sessionOpened(org.apache.mina.core.session.IoSession session)
          
 void setApplicationContext(ApplicationContext appCtx)
          
 void setCodecFactory(ProtocolCodecFactory codecFactory)
          Setter for codec factory.
 void setHandler(IRTMPHandler handler)
          Setter for handler.
 void setMode(boolean mode)
          Setter for mode.
 void setRtmpConnManager(IRTMPConnManager rtmpConnManager)
           
 
Methods inherited from class org.apache.mina.core.service.IoHandlerAdapter
sessionIdle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RTMPMinaIoHandler

public RTMPMinaIoHandler()
Method Detail

setHandler

public void setHandler(IRTMPHandler handler)
Setter for handler.

Parameters:
handler - RTMP events handler

setMode

public void setMode(boolean mode)
Setter for mode.

Parameters:
mode - true if handler should work in server mode, false otherwise

setCodecFactory

public void setCodecFactory(ProtocolCodecFactory codecFactory)
Setter for codec factory.

Parameters:
codecFactory - RTMP protocol codec factory

setRtmpConnManager

public void setRtmpConnManager(IRTMPConnManager rtmpConnManager)

getRtmpConnManager

protected IRTMPConnManager getRtmpConnManager()

exceptionCaught

public void exceptionCaught(org.apache.mina.core.session.IoSession session,
                            Throwable cause)
                     throws Exception

Specified by:
exceptionCaught in interface org.apache.mina.core.service.IoHandler
Overrides:
exceptionCaught in class org.apache.mina.core.service.IoHandlerAdapter
Throws:
Exception

messageReceived

public void messageReceived(org.apache.mina.core.session.IoSession session,
                            Object in)
                     throws Exception

Specified by:
messageReceived in interface org.apache.mina.core.service.IoHandler
Overrides:
messageReceived in class org.apache.mina.core.service.IoHandlerAdapter
Throws:
Exception

rawBufferRecieved

protected void rawBufferRecieved(ProtocolState state,
                                 org.apache.mina.core.buffer.IoBuffer in,
                                 org.apache.mina.core.session.IoSession session)
Handle raw buffer receiving event.

Parameters:
state - Protocol state
in - Data buffer
session - I/O session, that is, connection between two endpoints

messageSent

public void messageSent(org.apache.mina.core.session.IoSession session,
                        Object message)
                 throws Exception

Specified by:
messageSent in interface org.apache.mina.core.service.IoHandler
Overrides:
messageSent in class org.apache.mina.core.service.IoHandlerAdapter
Throws:
Exception

sessionOpened

public void sessionOpened(org.apache.mina.core.session.IoSession session)
                   throws Exception

Specified by:
sessionOpened in interface org.apache.mina.core.service.IoHandler
Overrides:
sessionOpened in class org.apache.mina.core.service.IoHandlerAdapter
Throws:
Exception

sessionClosed

public void sessionClosed(org.apache.mina.core.session.IoSession session)
                   throws Exception

Specified by:
sessionClosed in interface org.apache.mina.core.service.IoHandler
Overrides:
sessionClosed in class org.apache.mina.core.service.IoHandlerAdapter
Throws:
Exception

sessionCreated

public void sessionCreated(org.apache.mina.core.session.IoSession session)
                    throws Exception

Specified by:
sessionCreated in interface org.apache.mina.core.service.IoHandler
Overrides:
sessionCreated in class org.apache.mina.core.service.IoHandlerAdapter
Throws:
Exception

setApplicationContext

public void setApplicationContext(ApplicationContext appCtx)
                           throws BeansException

Specified by:
setApplicationContext in interface ApplicationContextAware
Throws:
BeansException

createRTMPMinaConnection

protected RTMPMinaConnection createRTMPMinaConnection()


Copyright © 2006-2009 The Red5 Project