Package com.hybris.cockpitng.core.spring
Interface CockpitApplicationContext
-
- All Superinterfaces:
org.springframework.context.ApplicationContext,org.springframework.context.ApplicationEventPublisher,org.springframework.beans.factory.BeanFactory,org.springframework.core.env.EnvironmentCapable,org.springframework.beans.factory.HierarchicalBeanFactory,org.springframework.beans.factory.ListableBeanFactory,org.springframework.context.MessageSource,org.springframework.core.io.ResourceLoader,org.springframework.core.io.support.ResourcePatternResolver
- All Known Implementing Classes:
DefaultDelegatingCockpitApplicationContext
public interface CockpitApplicationContext extends org.springframework.context.ApplicationContextAn application context providing CockpitNG features.CockpitNG-based applications should be run using an application context implementing this interface. It also should be a context available under
org.springframework.web.context.WebApplicationContext.ROOTattribute in servlet context.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description CockpitClassLoadergetClassLoader()Retrieves a class loader aware of all fetched modulesstatic CockpitApplicationContextgetCockpitApplicationContext(org.springframework.context.ApplicationContext applicationContext)Extracts the cockpit application context out of the provided onejava.io.FilegetDataRootDir()Retrieves a root directory for all the application datajava.util.List<java.lang.String>getLoadedModulesNames()Retrieves a collection of names all the loaded modules.java.util.Optional<ModuleInfo>getModuleInfo(java.lang.String moduleName)Retrieves information about modulejava.util.Optional<java.lang.String>getModuleName(java.net.URI moduleURI)Returns a fetched module namejava.util.Optional<java.net.URI>getModuleURI(java.lang.String moduleName)Retrieves a URI to source of modulebooleanisReady()voidrefresh()Reloads all modules and beansvoidregisterNewModule(java.lang.String moduleName, ModuleContentProvider contentsProvider)Creates a new module library, if it does not exist already.voidunregisterModule(java.lang.String moduleName)Removes a module library if such exists.-
Methods inherited from interface org.springframework.context.ApplicationContext
getApplicationName, getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDate
-
Methods inherited from interface org.springframework.context.ApplicationEventPublisher
publishEvent, publishEvent
-
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getBean, getBeanProvider, getBeanProvider, getType, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatch
-
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
-
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation
-
-
-
-
Method Detail
-
getCockpitApplicationContext
static CockpitApplicationContext getCockpitApplicationContext(org.springframework.context.ApplicationContext applicationContext)
Extracts the cockpit application context out of the provided one- Parameters:
applicationContext- base application context- Returns:
- cockpit application context
- Throws:
org.springframework.beans.FatalBeanException- if the cockpit application context cannot be extracted
-
getDataRootDir
java.io.File getDataRootDir()
Retrieves a root directory for all the application data- Returns:
- root directory for application data
-
getLoadedModulesNames
java.util.List<java.lang.String> getLoadedModulesNames()
Retrieves a collection of names all the loaded modules.List should contain only unique values in same order that modules has been loaded.
- Returns:
- names of modules
-
getModuleName
java.util.Optional<java.lang.String> getModuleName(java.net.URI moduleURI)
Returns a fetched module name- Parameters:
moduleURI- URI to module source- Returns:
- module name
-
getModuleURI
java.util.Optional<java.net.URI> getModuleURI(java.lang.String moduleName)
Retrieves a URI to source of module- Parameters:
moduleName- name of module- Returns:
- source URI
-
getModuleInfo
java.util.Optional<ModuleInfo> getModuleInfo(java.lang.String moduleName)
Retrieves information about module- Parameters:
moduleName- module name- Returns:
- information about module
- See Also:
getLoadedModulesNames()
-
registerNewModule
void registerNewModule(java.lang.String moduleName, ModuleContentProvider contentsProvider) throws CockpitApplicationExceptionCreates a new module library, if it does not exist already. The library is automatically added to application context after consumed.- Parameters:
moduleName- name of the module for which a library will be registeredcontentsProvider- functional object capable of providing contents for the library- Throws:
CockpitApplicationException
-
unregisterModule
void unregisterModule(java.lang.String moduleName) throws CockpitApplicationExceptionRemoves a module library if such exists. The library is automatically removed from application context.- Parameters:
moduleName- name of the module for which the library will be unregistered- Throws:
CockpitApplicationException
-
getClassLoader
CockpitClassLoader getClassLoader()
Retrieves a class loader aware of all fetched modules- Specified by:
getClassLoaderin interfaceorg.springframework.core.io.ResourceLoader- Returns:
- class loader
-
refresh
void refresh()
Reloads all modules and beans- Throws:
org.springframework.beans.BeansException- if any problems with context refresh has occurred
-
isReady
boolean isReady()
- Returns:
-
-