|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.red5.server.ContextLoader
@ManagedResource(objectName="org.red5.server:name=contextLoader,type=ContextLoader", description="ContextLoader") public class ContextLoader
Red5 applications loader
Field Summary | |
---|---|
protected ApplicationContext |
applicationContext
Spring Application context |
protected ConcurrentMap<String,ApplicationContext> |
contextMap
Context map |
protected String |
contextsConfig
Context location files |
protected static Logger |
log
|
protected ApplicationContext |
parentContext
Spring parent app context |
Constructor Summary | |
---|---|
ContextLoader()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Registers with JMX and registers a shutdown hook. |
void |
destroy()
Un-loads or un-initializes the contexts; this is a shutdown method for this loader. |
ApplicationContext |
getContext(String name)
Return context by name |
String |
getContextsConfig()
|
ApplicationContext |
getParentContext()
Return parent context |
void |
init()
Loads context settings from ResourceBundle (.properties file) |
boolean |
isUseShutdownHook()
Whether or not the shutdown hook is enabled. |
void |
loadContext(String name,
String config)
Loads a context (Red5 application) and stores it in a context map, then adds it's beans to parent (that is, Red5) |
protected void |
registerJMX()
|
void |
setApplicationContext(ApplicationContext applicationContext)
|
void |
setContextsConfig(String contextsConfig)
Setter for context config name |
void |
setParentContext(ApplicationContext parentContext)
Setter for parent application context |
void |
setParentContext(String parentContextKey,
String appContextId)
Sets a parent context for child context based on a given key. |
void |
setUseShutdownHook(boolean useShutdownHook)
Enables or disables the shutdown hook. |
void |
shutdown()
Shut server down. |
void |
unloadContext(String name)
Unloads a context (Red5 application) and removes it from the context map, then removes it's beans from the parent (that is, Red5) |
protected void |
unregisterJMX()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static Logger log
protected ApplicationContext applicationContext
protected ApplicationContext parentContext
protected String contextsConfig
protected ConcurrentMap<String,ApplicationContext> contextMap
Constructor Detail |
---|
public ContextLoader()
Method Detail |
---|
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
- I/O exception, casting exception and otherspublic void destroy() throws Exception
destroy
in interface DisposableBean
Exception
public void init() throws IOException
init
in interface ContextLoaderMXBean
IOException
public void loadContext(String name, String config)
loadContext
in interface ContextLoaderMXBean
name
- Context nameconfig
- Filenamepublic void unloadContext(String name)
unloadContext
in interface ContextLoaderMXBean
name
- Context namepublic void shutdown()
shutdown
in interface ContextLoaderMXBean
shutdown
in interface ShutdownMXBean
public ApplicationContext getContext(String name)
name
- Context name
public void setParentContext(String parentContextKey, String appContextId)
setParentContext
in interface ContextLoaderMXBean
parentContextKey
- key for the parent contextappContextId
- id of the child contextprotected void registerJMX()
protected void unregisterJMX()
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext
in interface ApplicationContextAware
applicationContext
- Spring application context
BeansException
- Top level exception for app context (that is, in fact, beans
factory)public void setParentContext(ApplicationContext parentContext)
parentContext
- Parent Spring application contextpublic ApplicationContext getParentContext()
public void setContextsConfig(String contextsConfig)
setContextsConfig
in interface ContextLoaderMXBean
contextsConfig
- Context config namepublic String getContextsConfig()
getContextsConfig
in interface ContextLoaderMXBean
public boolean isUseShutdownHook()
public void setUseShutdownHook(boolean useShutdownHook)
useShutdownHook
- true to enable, false to disable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |