Class WebSocketPlugin

  • All Implemented Interfaces:
    org.red5.server.api.plugin.IRed5Plugin

    public class WebSocketPlugin
    extends org.red5.server.plugin.Red5Plugin
    WebSocketPlugin - centralized WebSocket configuration and locator.
    This plugin will be called by Red5 plugin launcher to associate application components with WebSockets.
    Author:
    Paul Gregoire
    • Constructor Detail

      • WebSocketPlugin

        public WebSocketPlugin()
    • Method Detail

      • doStart

        public void doStart()
                     throws Exception
        Specified by:
        doStart in interface org.red5.server.api.plugin.IRed5Plugin
        Overrides:
        doStart in class org.red5.server.plugin.Red5Plugin
        Throws:
        Exception
      • doStop

        public void doStop()
                    throws Exception
        Specified by:
        doStop in interface org.red5.server.api.plugin.IRed5Plugin
        Overrides:
        doStop in class org.red5.server.plugin.Red5Plugin
        Throws:
        Exception
      • submit

        public static Future<?> submit​(Runnable task)
        Submit a task for execution.
        Parameters:
        task -
        Returns:
        Future
      • getName

        public String getName()
        Specified by:
        getName in interface org.red5.server.api.plugin.IRed5Plugin
        Overrides:
        getName in class org.red5.server.plugin.Red5Plugin
      • getServer

        public org.red5.server.Server getServer()
        Overrides:
        getServer in class org.red5.server.plugin.Red5Plugin
      • getApplicationScope

        public org.red5.server.api.scope.IScope getApplicationScope​(String path)
        Returns the application scope for a given path.
        Parameters:
        path -
        Returns:
        IScope
      • getManager

        public WebSocketScopeManager getManager​(org.red5.server.api.scope.IScope scope)
        Returns a WebSocketScopeManager for a given scope.
        Parameters:
        scope -
        Returns:
        WebSocketScopeManager if registered for the given scope and null otherwise
      • getManager

        public WebSocketScopeManager getManager​(String path)
        Returns a WebSocketScopeManager for a given path.
        Parameters:
        path -
        Returns:
        WebSocketScopeManager if registered for the given path and null otherwise
      • removeManager

        public WebSocketScopeManager removeManager​(org.red5.server.api.scope.IScope scope)
        Removes and returns the WebSocketScopeManager for the given scope if it exists and returns null if it does not.
        Parameters:
        scope - Scope for which the manager is registered
        Returns:
        WebSocketScopeManager if registered for the given path and null otherwise
      • getWsServerContainer

        public DefaultWsServerContainer getWsServerContainer​(String path)
        Returns a DefaultWsServerContainer for a given path.
        Parameters:
        path -
        Returns:
        DefaultWsServerContainer
      • setApplication

        public void setApplication​(org.red5.server.adapter.MultiThreadedApplicationAdapter application)
        Overrides:
        setApplication in class org.red5.server.plugin.Red5Plugin
      • isSameOriginPolicy

        public static boolean isSameOriginPolicy()
      • setSameOriginPolicy

        public void setSameOriginPolicy​(boolean sameOriginPolicy)
      • isCrossOriginPolicy

        public static boolean isCrossOriginPolicy()
      • setCrossOriginPolicy

        public void setCrossOriginPolicy​(boolean crossOriginPolicy)
      • getAllowedOrigins

        public static String[] getAllowedOrigins()
      • setAllowedOrigins

        public void setAllowedOrigins​(String[] allowedOrigins)
      • getWsConfiguratorInstance

        public static javax.websocket.server.ServerEndpointConfig.Configurator getWsConfiguratorInstance()
        Returns an new instance of the configurator.
        Returns:
        configurator
      • getWsServerContainerInstance

        public static javax.websocket.server.ServerContainer getWsServerContainerInstance​(javax.servlet.ServletContext servletContext)
        Returns a new instance of WsServerContainer if one does not already exist.
        Parameters:
        servletContext -
        Returns:
        WsServerContainer