org.red5.server
public class Server extends Object implements IServer, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
Modifier and Type | Field and Description |
---|---|
protected org.springframework.context.ApplicationContext |
applicationContext
Spring application context
|
Set<IConnectionListener> |
connectionListeners |
protected static String |
EMPTY
Constant for empty string
|
protected ConcurrentMap<String,IGlobalScope> |
globals
List of global scopes
|
protected static org.slf4j.Logger |
log |
protected ConcurrentMap<String,String> |
mapping
Mappings
|
Set<IScopeListener> |
scopeListeners |
protected static String |
SLASH
Constant for slash
|
Constructor and Description |
---|
Server() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(IConnectionListener listener)
Add listener to get notified about connection events.
|
void |
addListener(IScopeListener listener)
Add listener to get notified about scope events.
|
boolean |
addMapping(String hostName,
String contextPath,
String globalName)
Map key (host + / + context path) and global scope name
|
void |
afterPropertiesSet()
Initialization section.
|
void |
destroy()
Destruction section.
|
IGlobalScope |
getGlobal(String name)
Return global scope by name
|
Iterator<String> |
getGlobalNames()
Return global scope names set iterator
|
Iterator<IGlobalScope> |
getGlobalScopes()
Return global scopes set iterator
|
protected String |
getKey(String hostName,
String contextPath)
Return scope key.
|
Map<String,String> |
getMappingTable()
Return mapping
|
int |
getNotifierThreadPoolSize() |
IGlobalScope |
lookupGlobal(String hostName,
String contextPath)
Does global scope lookup for host name and context path
|
void |
notifyConnected(IConnection conn)
Notify listeners that a new connection was established.
|
void |
notifyDisconnected(IConnection conn)
Notify listeners that a connection was disconnected.
|
void |
notifyScopeCreated(IScope scope)
Notify listeners about a newly created scope.
|
void |
notifyScopeRemoved(IScope scope)
Notify listeners that a scope was removed.
|
void |
registerGlobal(IGlobalScope scope)
Register global scope
|
void |
removeListener(IConnectionListener listener)
Remove listener that got notified about connection events.
|
void |
removeListener(IScopeListener listener)
Remove listener that got notified about scope events.
|
boolean |
removeMapping(String contextPath)
Remove all mappings with given context path
|
boolean |
removeMapping(String hostName,
String contextPath)
Remove mapping with given key
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
Setter for Spring application context
|
void |
setNotifierThreadPoolSize(int notifierThreadPoolSize) |
String |
toString()
String representation of server
|
protected static org.slf4j.Logger log
protected ConcurrentMap<String,IGlobalScope> globals
protected ConcurrentMap<String,String> mapping
protected org.springframework.context.ApplicationContext applicationContext
protected static final String SLASH
protected static final String EMPTY
public Set<IScopeListener> scopeListeners
public Set<IConnectionListener> connectionListeners
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
applicationContext
- Application contextpublic void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public void destroy() throws Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
Exception
protected String getKey(String hostName, String contextPath)
hostName
- Host namecontextPath
- Context pathpublic IGlobalScope lookupGlobal(String hostName, String contextPath)
lookupGlobal
in interface IServer
hostName
- Host namecontextPath
- Context pathpublic IGlobalScope getGlobal(String name)
public void registerGlobal(IGlobalScope scope)
registerGlobal
in interface IServer
scope
- Global scope to registerpublic boolean addMapping(String hostName, String contextPath, String globalName)
addMapping
in interface IServer
hostName
- Host namecontextPath
- Context pathglobalName
- Global scope namepublic boolean removeMapping(String hostName, String contextPath)
removeMapping
in interface IServer
hostName
- Host namecontextPath
- Context pathpublic boolean removeMapping(String contextPath)
contextPath
- Context pathpublic Map<String,String> getMappingTable()
getMappingTable
in interface IServer
public Iterator<String> getGlobalNames()
getGlobalNames
in interface IServer
public Iterator<IGlobalScope> getGlobalScopes()
getGlobalScopes
in interface IServer
public String toString()
public void addListener(IScopeListener listener)
addListener
in interface IServer
listener
- the listener to addpublic void addListener(IConnectionListener listener)
addListener
in interface IServer
listener
- the listener to addpublic void removeListener(IScopeListener listener)
removeListener
in interface IServer
listener
- the listener to removepublic void removeListener(IConnectionListener listener)
removeListener
in interface IServer
listener
- the listener to removepublic void notifyScopeCreated(IScope scope)
scope
- the scope that was createdpublic void notifyScopeRemoved(IScope scope)
scope
- the scope that was removedpublic void notifyConnected(IConnection conn)
conn
- the new connectionpublic void notifyDisconnected(IConnection conn)
conn
- the disconnected connectionpublic int getNotifierThreadPoolSize()
public void setNotifierThreadPoolSize(int notifierThreadPoolSize)
Copyright © 2006-2012 The Red5 Project