Class RTMPMinaTransport

java.lang.Object
org.red5.server.net.rtmp.RTMPMinaTransport
All Implemented Interfaces:
RTMPMinaTransportMXBean

public class RTMPMinaTransport extends Object implements RTMPMinaTransportMXBean
Transport setup class configures socket acceptor and thread pools for RTMP in Mina.
Note: This code originates from AsyncWeb. Originally modified by Luke Hubbard.
Author:
Luke Hubbard, Paul Gregoire
  • Field Details

    • log

      private static final org.slf4j.Logger log
    • executor

      private ThreadPoolExecutor executor
    • acceptor

      protected org.apache.mina.transport.socket.SocketAcceptor acceptor
    • addresses

      protected Set<String> addresses
    • ioHandler

      protected org.apache.mina.core.service.IoHandlerAdapter ioHandler
    • ioThreads

      protected int ioThreads
    • serviceManagerObjectName

      protected ObjectName serviceManagerObjectName
      MBean object name used for de/registration purposes.
    • stats

      protected org.apache.mina.core.service.IoServiceStatistics stats
    • enableMinaLogFilter

      protected boolean enableMinaLogFilter
    • enableMinaMonitor

      protected boolean enableMinaMonitor
    • minaPollInterval

      protected int minaPollInterval
    • tcpNoDelay

      protected boolean tcpNoDelay
    • useHeapBuffers

      protected boolean useHeapBuffers
    • sendBufferSize

      protected int sendBufferSize
    • receiveBufferSize

      protected int receiveBufferSize
    • readerIdleTime

      private int readerIdleTime
    • trafficClass

      private int trafficClass
    • backlog

      private int backlog
    • thoughputCalcInterval

      private int thoughputCalcInterval
    • executorKeepAliveTime

      private long executorKeepAliveTime
    • enableDefaultAcceptor

      private boolean enableDefaultAcceptor
    • initialPoolSize

      private int initialPoolSize
    • maxPoolSize

      private int maxPoolSize
    • maxProcessorPoolSize

      private int maxProcessorPoolSize
    • keepAlive

      private boolean keepAlive
  • Constructor Details

    • RTMPMinaTransport

      public RTMPMinaTransport()
  • Method Details

    • initIOHandler

      private void initIOHandler()
    • start

      public void start() throws Exception
      Specified by:
      start in interface RTMPMinaTransportMXBean
      Throws:
      Exception
    • stop

      public void stop()
      Specified by:
      stop in interface RTMPMinaTransportMXBean
    • setAddress

      public void setAddress(String address)
    • setAddresses

      public void setAddresses(List<String> addrs)
    • setIoHandler

      public void setIoHandler(org.apache.mina.core.service.IoHandlerAdapter rtmpIOHandler)
    • setIoThreads

      public void setIoThreads(int ioThreads)
      Specified by:
      setIoThreads in interface RTMPMinaTransportMXBean
    • setSendBufferSize

      public void setSendBufferSize(int sendBufferSize)
      Parameters:
      sendBufferSize - the sendBufferSize to set
    • setReceiveBufferSize

      public void setReceiveBufferSize(int receiveBufferSize)
      Parameters:
      receiveBufferSize - the receiveBufferSize to set
    • setTrafficClass

      public void setTrafficClass(int trafficClass)
      Parameters:
      trafficClass - the trafficClass to set
    • setBacklog

      public void setBacklog(int backlog)
      Parameters:
      backlog - the backlog to set
    • setThoughputCalcInterval

      public void setThoughputCalcInterval(int thoughputCalcInterval)
      Parameters:
      thoughputCalcInterval - the thoughputCalcInterval to set
    • setExecutorKeepAliveTime

      public void setExecutorKeepAliveTime(long executorKeepAliveTime)
      Parameters:
      executorKeepAliveTime - the executorKeepAliveTime to set
    • setEnableDefaultAcceptor

      public void setEnableDefaultAcceptor(boolean enableDefaultAcceptor)
    • setInitialPoolSize

      public void setInitialPoolSize(int initialPoolSize)
    • setMaxPoolSize

      public void setMaxPoolSize(int maxPoolSize)
    • setMaxProcessorPoolSize

      public void setMaxProcessorPoolSize(int maxProcessorPoolSize)
      Parameters:
      maxProcessorPoolSize - the maxProcessorPoolSize to set
    • setTcpNoDelay

      public void setTcpNoDelay(boolean tcpNoDelay)
      Specified by:
      setTcpNoDelay in interface RTMPMinaTransportMXBean
    • setKeepAlive

      public void setKeepAlive(boolean keepAlive)
      Parameters:
      keepAlive - the keepAlive to set
    • setUseHeapBuffers

      public void setUseHeapBuffers(boolean useHeapBuffers)
      Specified by:
      setUseHeapBuffers in interface RTMPMinaTransportMXBean
    • isEnableMinaLogFilter

      public boolean isEnableMinaLogFilter()
      Returns:
      the enableMinaLogFilter
    • setEnableMinaLogFilter

      public void setEnableMinaLogFilter(boolean enableMinaLogFilter)
      Parameters:
      enableMinaLogFilter - the enableMinaLogFilter to set
    • setEnableMinaMonitor

      public void setEnableMinaMonitor(boolean enableMinaMonitor)
      Parameters:
      enableMinaMonitor - the enableMinaMonitor to set
    • setMinaPollInterval

      public void setMinaPollInterval(int minaPollInterval)
    • setReaderIdleTime

      public void setReaderIdleTime(int readerIdleTime)
      Parameters:
      readerIdleTime - the readerIdleTime to set
    • getAddress

      public String getAddress()
      Returns all the bound addresses and ports as string.
      Specified by:
      getAddress in interface RTMPMinaTransportMXBean
      Returns:
      addresses
    • getStatistics

      public String getStatistics()
      Returns the current statistics as a json formatted string.
      Specified by:
      getStatistics in interface RTMPMinaTransportMXBean
      Returns:
      json
    • toString

      public String toString()
      Overrides:
      toString in class Object