|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.red5.server.Context
public class Context
This is basic context implementation used by Red5.
Field Summary | |
---|---|
static Logger |
logger
|
Fields inherited from interface org.red5.server.api.IContext |
---|
ID |
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 | |
---|---|
Context()
Initializes core context bean factory using red5.core bean factory from red5.xml context |
|
Context(ApplicationContext context,
String contextPath)
Initializes app context and context path from given parameters |
Method Summary | |
---|---|
static Context |
from(CompositeData cd)
Allows for reconstruction via CompositeData. |
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 |
Resource |
getResource(String path)
Return resouce by path |
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(ApplicationContext context)
Setter for application context |
void |
setClientRegistry(IClientRegistry clientRegistry)
Setter for client registry |
void |
setContextPath(String contextPath)
Setter for context path. |
void |
setCoreBeanFactory(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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static Logger logger
Constructor Detail |
---|
@ConstructorProperties(value="") public Context()
@ConstructorProperties(value={"context","contextPath"}) public Context(ApplicationContext context, String contextPath)
context
- Application contextcontextPath
- Context pathMethod Detail |
---|
public IGlobalScope getGlobalScope()
getGlobalScope
in interface IContext
getGlobalScope
in interface ContextMXBean
public IScopeResolver getScopeResolver()
public IScope resolveScope(String path)
resolveScope
in interface IContext
resolveScope
in interface ContextMXBean
path
- Path to resolve
public IScope resolveScope(IScope root, String path)
resolveScope
in interface IContext
resolveScope
in interface ContextMXBean
root
- 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 IContext
getPersistanceStore
in interface ContextMXBean
public void setPersistanceStore(IPersistenceStore persistanceStore)
persistanceStore
- Persistence storepublic void setApplicationContext(ApplicationContext context)
setApplicationContext
in interface ApplicationContextAware
context
- App contextpublic ApplicationContext getApplicationContext()
getApplicationContext
in interface IContext
getApplicationContext
in interface ContextMXBean
public void setContextPath(String contextPath)
setContextPath
in interface ContextMXBean
contextPath
- Context pathpublic IClientRegistry getClientRegistry()
getClientRegistry
in interface IContext
getClientRegistry
in interface ContextMXBean
public IScope getScope()
getScope
in interface ContextMXBean
public IServiceInvoker getServiceInvoker()
getServiceInvoker
in interface IContext
getServiceInvoker
in interface ContextMXBean
public Object lookupService(String serviceName)
lookupService
in interface IContext
lookupService
in interface ContextMXBean
serviceName
- Service name
ServiceNotFoundException
- When service found but null
NoSuchBeanDefinitionException
- When bean with given name doesn't existpublic IScopeHandler lookupScopeHandler(String contextPath)
lookupScopeHandler
in interface IContext
lookupScopeHandler
in interface ContextMXBean
contextPath
- Context path
ScopeHandlerNotFoundException
- If there's no handler for given context pathpublic IMappingStrategy getMappingStrategy()
getMappingStrategy
in interface IContext
getMappingStrategy
in interface ContextMXBean
public Resource[] getResources(String pattern) throws IOException
getResources
in interface ContextMXBean
getResources
in interface ResourcePatternResolver
pattern
- Pattern to check against
IOException
- On I/O exceptionResource
public Resource getResource(String path)
getResource
in interface ContextMXBean
getResource
in interface ResourceLoader
path
- Resource path
Resource
public IScope resolveScope(String host, String path)
resolveScope
in interface ContextMXBean
host
- Hostpath
- Path
IScope
,
Scope
public boolean hasBean(String beanId)
hasBean
in interface IContext
beanId
- The name of the bean to find.
public Object getBean(String beanId)
getBean
in interface IContext
getBean
in interface ContextMXBean
beanId
- Bean name
BeanFactory
public Object getCoreService(String beanId)
getCoreService
in interface IContext
getCoreService
in interface ContextMXBean
beanId
- Bean name
BeanFactory
public void setCoreBeanFactory(BeanFactory core)
public ClassLoader getClassLoader()
getClassLoader
in interface ResourceLoader
public static Context from(CompositeData cd)
cd
- composite data
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |