public class Context extends Object implements IContext, org.springframework.context.ApplicationContextAware, ContextMXBean
This is basic context implementation used by Red5.
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
Context()
Initializes core context bean factory using red5.core bean factory from
red5.xml context
|
Context(org.springframework.context.ApplicationContext context,
String contextPath)
Initializes app context and context path from given parameters
|
| Modifier and Type | Method and Description |
|---|---|
static Context |
from(CompositeData cd)
Allows for reconstruction via CompositeData.
|
org.springframework.context.ApplicationContext |
getApplicationContext()
Return application context
|
Object |
getBean(String beanId)
Return bean instantiated by bean factory
|
ClassLoader |
getClassLoader()
Return current thread's context classloader
|
IClientRegistry |
getClientRegistry()
Return client registry
|
Object |
getCoreService(String beanId)
Return core Red5 service instantiated by core context bean factory
|
IGlobalScope |
getGlobalScope()
Return global scope
|
IMappingStrategy |
getMappingStrategy()
Return mapping strategy used by this context.
|
IPersistenceStore |
getPersistanceStore()
Return persistence store
|
org.springframework.core.io.Resource |
getResource(String path)
Return resouce by path
|
org.springframework.core.io.Resource[] |
getResources(String pattern)
Return array or resournce that match given pattern
|
IScope |
getScope()
Return scope
|
IScopeResolver |
getScopeResolver()
Return scope resolver
|
IServiceInvoker |
getServiceInvoker()
Return service invoker
|
boolean |
hasBean(String beanId)
Returns true if the context contains a certain bean,
false otherwise.
|
IScopeHandler |
lookupScopeHandler(String contextPath)
Look up scope handler for context path
|
Object |
lookupService(String serviceName)
Look up service by name
|
IScope |
resolveScope(IScope root,
String path)
Resolves scope from given root using scope resolver.
|
IScope |
resolveScope(String path)
Resolves scope using scope resolver collaborator
|
IScope |
resolveScope(String host,
String path)
Resolve scope from host and path
|
void |
setApplicationContext(org.springframework.context.ApplicationContext context)
Setter for application context
|
void |
setClientRegistry(IClientRegistry clientRegistry)
Setter for client registry
|
void |
setContextPath(String contextPath)
Setter for context path.
|
void |
setCoreBeanFactory(org.springframework.beans.factory.BeanFactory core) |
void |
setMappingStrategy(IMappingStrategy mappingStrategy)
Setter for mapping strategy
|
void |
setPersistanceStore(IPersistenceStore persistanceStore)
Setter for persistence store
|
void |
setScopeResolver(IScopeResolver scopeResolver)
Setter for scope resolver
|
void |
setServiceInvoker(IServiceInvoker serviceInvoker)
Setter for service invoker
|
@ConstructorProperties(value="") public Context()
@ConstructorProperties(value={"context","contextPath"}) public Context(org.springframework.context.ApplicationContext context, String contextPath)
context - Application contextcontextPath - Context pathpublic IGlobalScope getGlobalScope()
getGlobalScope in interface IContextgetGlobalScope in interface ContextMXBeanpublic IScopeResolver getScopeResolver()
public IScope resolveScope(String path)
resolveScope in interface IContextresolveScope in interface ContextMXBeanpath - Path to resolvepublic IScope resolveScope(IScope root, String path)
resolveScope in interface IContextresolveScope in interface ContextMXBeanroot - Scope to start from.path - Path to resolve.public void setClientRegistry(IClientRegistry clientRegistry)
clientRegistry - Client registrypublic void setMappingStrategy(IMappingStrategy mappingStrategy)
mappingStrategy - Mapping strategypublic void setScopeResolver(IScopeResolver scopeResolver)
scopeResolver - Scope resolver used to resolve scopespublic void setServiceInvoker(IServiceInvoker serviceInvoker)
serviceInvoker - Service invoker objectpublic IPersistenceStore getPersistanceStore()
getPersistanceStore in interface IContextgetPersistanceStore in interface ContextMXBeanpublic void setPersistanceStore(IPersistenceStore persistanceStore)
persistanceStore - Persistence storepublic void setApplicationContext(org.springframework.context.ApplicationContext context)
setApplicationContext in interface org.springframework.context.ApplicationContextAwarecontext - App contextpublic org.springframework.context.ApplicationContext getApplicationContext()
getApplicationContext in interface IContextgetApplicationContext in interface ContextMXBeanpublic void setContextPath(String contextPath)
setContextPath in interface ContextMXBeancontextPath - Context pathpublic IClientRegistry getClientRegistry()
getClientRegistry in interface IContextgetClientRegistry in interface ContextMXBeanpublic IScope getScope()
getScope in interface ContextMXBeanpublic IServiceInvoker getServiceInvoker()
getServiceInvoker in interface IContextgetServiceInvoker in interface ContextMXBeanpublic Object lookupService(String serviceName)
lookupService in interface IContextlookupService in interface ContextMXBeanserviceName - Service nameServiceNotFoundException - When service found but nullorg.springframework.beans.factory.NoSuchBeanDefinitionException - When bean with given name doesn't existpublic IScopeHandler lookupScopeHandler(String contextPath)
lookupScopeHandler in interface IContextlookupScopeHandler in interface ContextMXBeancontextPath - Context pathScopeHandlerNotFoundException - If there's no handler for given context pathpublic IMappingStrategy getMappingStrategy()
getMappingStrategy in interface IContextgetMappingStrategy in interface ContextMXBeanpublic org.springframework.core.io.Resource[] getResources(String pattern) throws IOException
getResources in interface ContextMXBeangetResources in interface org.springframework.core.io.support.ResourcePatternResolverpattern - Pattern to check againstIOException - On I/O exceptionResourcepublic org.springframework.core.io.Resource getResource(String path)
getResource in interface ContextMXBeangetResource in interface org.springframework.core.io.ResourceLoaderpath - Resource pathResourcepublic IScope resolveScope(String host, String path)
resolveScope in interface ContextMXBeanhost - Hostpath - PathIScope,
Scopepublic boolean hasBean(String beanId)
public Object getBean(String beanId)
getBean in interface IContextgetBean in interface ContextMXBeanbeanId - Bean nameBeanFactorypublic Object getCoreService(String beanId)
getCoreService in interface IContextgetCoreService in interface ContextMXBeanbeanId - Bean nameBeanFactorypublic void setCoreBeanFactory(org.springframework.beans.factory.BeanFactory core)
public ClassLoader getClassLoader()
getClassLoader in interface org.springframework.core.io.ResourceLoaderpublic static Context from(CompositeData cd)
cd - composite dataCopyright © 2006-2012 The Red5 Project