## org.red5.server
Class WebScope

    java.lang.Object
      org.red5.server.AttributeStore
          org.red5.server.PersistableAttributeStore
              org.red5.server.BasicScope
                  org.red5.server.Scope
                      org.red5.server.WebScope

All Implemented Interfaces:
  Iterable<IBasicScope>, AttributeStoreMBean, IEventDispatcher, IEventHandler, IEventListener, IEventObservable, IAttributeStore, IBasicScope, ICastingAttributeStore, ICoreObject, IScope, IPersistable, IServiceHandlerProvider, IScopeStatistics, IStatisticsBase, ScopeMBean, ResourceLoader, ResourcePatternResolver, ServletContextAware

    public class WebScope

extends Scope
implements ServletContextAware

Web scope is special scope that is aware of servlet context and represents scope of Red5 application in servlet container (or application server) like Tomcat, Jetty or JBoss. Web scope is aware of virtual hosts configuration for Red5 application and is the first scope that instantiated after Red5 application gets started. Then it loads virtual hosts configuration, adds mappings of paths to global scope that is injected thru Spring IoC context file and runs initialization process. Red5 server implementation instance and ServletContext are injected as well.

Nested Class Summary

Nested classes/interfaces inherited from class org.red5.server.Scope
`Scope.Builder`

Nested classes/interfaces inherited from class org.red5.server.BasicScope
`BasicScope.EmptyBasicScopeIterator`

Field Summary
`protected IApplicationContext` `appContext` The application context this webscope is running in.
`protected IApplicationLoader` `appLoader` Loader for new applications.
`protected String` `contextPath` Context path
`protected String[]` `hostnames` Hostnames
`protected static Logger` `log` Logger
`protected AtomicBoolean` `registered` Has the web scope been registered?
`protected IServer` `server` Server instance
`protected javax.servlet.ServletContext` `servletContext` Servlet context
`protected AtomicBoolean` `shuttingDown` Is the scope currently shutting down?
`protected String` `virtualHosts` Virtual hosts list as string

Fields inherited from class org.red5.server.Scope
`clientStats, connectionStats, lock, oName, subscopeStats`

Fields inherited from class org.red5.server.BasicScope
`keepDelay, keepOnDisconnect, listeners, parent, persistenceClass`

Fields inherited from class org.red5.server.PersistableAttributeStore
`lastModified, name, path, persistent, store, type`

Fields inherited from class org.red5.server.AttributeStore
`attributes`

Fields inherited from interface org.red5.server.api.IScope
`ID, SEPARATOR`

Fields inherited from interface org.red5.server.api.persistence.IPersistable
`TRANSIENT_PREFIX`

Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
`CLASSPATH_ALL_URL_PREFIX`

Fields inherited from interface org.springframework.core.io.ResourceLoader
`CLASSPATH_URL_PREFIX`

Constructor Summary
`WebScope()`

Method Summary
`IApplicationLoader` `getApplicationLoader()` Return object that can be used to load new applications.
`IServer` `getServer()` Return the server instance connected to this scope.
`boolean` `isShuttingDown()` Is the scope currently shutting down?
`void` `register()` Map all vhosts to global scope then initialize
`void` `setContextPath(String contextPath)` Setter for context path
`void` `setGlobalScope(IGlobalScope globalScope)` Setter for global scope.
`void` `setName()` Web scope has no name
`void` `setParent()` Can't set parent to Web scope.
`void` `setServer(IServer server)` Setter for server
`void` `setServletContext(javax.servlet.ServletContext servletContext)` Servlet context
`void` `setVirtualHosts(String virtualHosts)` Setter for virtual hosts.
`void` `unregister()` Uninitialize and remove all vhosts from the global scope.

Methods inherited from class org.red5.server.Scope

`addChildScope, connect, connect, createChildScope, destroy, disconnect, dispatchEvent, dump, getActiveClients, getActiveConnections, getActiveSubscopes, getBasicScope, getBasicScopeNames, getClassLoader, getClients, getConnections, getContext, getContextPath, getCreationTime, getDepth, getEnabled, getHandler, getMaxClients, getMaxConnections, getMaxSubscopes, getParent, getPath, getResource, getResources, getRunning, getScope, getScopeNames, getServiceHandler, getServiceHandlerNames, getServiceHandlers, getServiceHandlers, getStatistics, getTotalClients, getTotalConnections, getTotalSubscopes, handleEvent, hasChildScope, hasChildScope, hasContext, hasHandler, hasParent, init, isEnabled, isRunning, iterator, lock, lookupConnections, registerServiceHandler, removeChildScope, setAutoStart, setChildLoadPath, setContext, setDepth, setEnabled, setHandler, setName, setParent, setPersistenceClass, start, stop, toString, uninit, unlock, unregisterServiceHandler`

Methods inherited from class org.red5.server.BasicScope
`addEventListener, getEventListeners, hasEventListeners, notifyEvent, removeEventListener, setKeepDelay`

Methods inherited from class org.red5.server.PersistableAttributeStore
`deserialize, getAttribute, getLastModified, getName, getStore, getType, isPersistent, modified, removeAttribute, removeAttributes, serialize, setAttribute, setAttributes, setAttributes, setPath, setPersistent, setStore`

Methods inherited from class org.red5.server.AttributeStore
`filterNull, getAttribute, getAttributeNames, getAttributes, getBoolAttribute, getByteAttribute, getDoubleAttribute, getIntAttribute, getListAttribute, getLongAttribute, getMapAttribute, getSetAttribute, getShortAttribute, getStringAttribute, hasAttribute`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.red5.server.api.IBasicScope
`getName, getType, setKeepDelay`

Methods inherited from interface org.red5.server.api.ICastingAttributeStore
`getBoolAttribute, getByteAttribute, getDoubleAttribute, getIntAttribute, getListAttribute, getLongAttribute, getMapAttribute, getSetAttribute, getShortAttribute, getStringAttribute`

Methods inherited from interface org.red5.server.api.IAttributeStore
`getAttribute, getAttribute, getAttributeNames, getAttributes, hasAttribute, removeAttribute, removeAttributes, setAttribute, setAttributes, setAttributes`

Methods inherited from interface org.red5.server.api.event.IEventListener
`notifyEvent`

Methods inherited from interface org.red5.server.api.event.IEventObservable
`addEventListener, getEventListeners, removeEventListener`

Methods inherited from interface org.red5.server.api.persistence.IPersistable
`deserialize, getLastModified, getStore, isPersistent, serialize, setPath, setPersistent, setStore`

Methods inherited from interface org.red5.server.api.statistics.IScopeStatistics
`getName`

Field Detail

### log

    protected static Logger log

  Logger

### server

    protected IServer server

  Server instance

### servletContext

    protected javax.servlet.ServletContext servletContext

  Servlet context

### contextPath

    protected String contextPath

  Context path

### virtualHosts

    protected String virtualHosts

  Virtual hosts list as string

### hostnames

    protected String[] hostnames

  Hostnames

### registered

    protected AtomicBoolean registered

  Has the web scope been registered?

### appContext

    protected IApplicationContext appContext

  The application context this webscope is running in.

### appLoader

    protected IApplicationLoader appLoader

  Loader for new applications.

### shuttingDown

    protected AtomicBoolean shuttingDown

  Is the scope currently shutting down?

Constructor Detail

### WebScope

    public WebScope()

Method Detail

### setGlobalScope

    public void setGlobalScope(IGlobalScope globalScope)

  Setter for global scope. Sets persistence class.

  Parameters:
    `globalScope` - Red5 global scope

### setName

    public void setName()

  Web scope has no name

### setParent

    public void setParent()

  Can't set parent to Web scope. Web scope is top level.

### setServer

    public void setServer(IServer server)

  Setter for server

  Parameters:
    `server` - Server instance

### setServletContext

    public void setServletContext(javax.servlet.ServletContext servletContext)

  Servlet context

  Specified by:
    `setServletContext` in interface `ServletContextAware`
  Parameters:
    `servletContext` - Servlet context

### setContextPath

    public void setContextPath(String contextPath)

  Setter for context path

  Parameters:
    `contextPath` - Context path

### setVirtualHosts

    public void setVirtualHosts(String virtualHosts)

  Setter for virtual hosts. Creates array of hostnames.

  Parameters:
    `virtualHosts` - Virtual hosts list as string

### register

    public void register()

  Map all vhosts to global scope then initialize

### unregister

    public void unregister()

  Uninitialize and remove all vhosts from the global scope.

### getServer

    public IServer getServer()

  Return the server instance connected to this scope.

  Overrides:
    `getServer` in class `Scope`
  Returns:
    the server instance

### getApplicationLoader

    public IApplicationLoader getApplicationLoader()

  Return object that can be used to load new applications.

  Returns:
    the application loader

### isShuttingDown

    public boolean isShuttingDown()

  Is the scope currently shutting down?

  Returns:
    is shutting down

Copyright © 2006-2010 The Red5 Project