|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.init.MagnoliaServletContextListener
@Singleton public class MagnoliaServletContextListener
Point of entry for Magnolia CMS, initializes the component providers, starts logging, triggers loading of
properties and finally delegates to ConfigLoader
for completing initialization.
When Magnolia starts up the first thing that happens is the creation of the platform component provider. It
contains the essential singletons that constitutes the platform on which the rest of the system builds. These
components are defined in a file called platform-components.xml
, it's on the classpath in package
/info/magnolia/init.
The location can be customized using a servlet context parameter called
magnolia.platform.components.config.location
. It's specified as a list of comma-separated files on the
classpath. The files are loaded in the specified order allowing definitions to override definitions from earlier
files.
<context-param> <param-name>magnolia.platform.components.config.location</param-name> <param-value>/info/magnolia/init/platform-components.xml,/com/mycompany/custom-platform-components.xml</param-value> </context-param>
The platform components include the ModuleManager
which is called by this listener to load the descriptors of
all the modules present. Modules define additional components that are loaded into a second component provider called
system.
When ConfigLoader
takes over the initialization procedure it will create a third component provider called
main which contain components defined in modules as belonging to the main component provider.
Properties are loaded by an implementation of MagnoliaConfigurationProperties
. It's configured as a platform
component and is called by this class to do initialization. See DefaultMagnoliaPropertiesResolver
and
DefaultMagnoliaInitPaths
for details on how to customize the default behavior.
ModuleManager
,
MagnoliaInitPaths
,
MagnoliaPropertiesResolver
,
DefaultMagnoliaPropertiesResolver
,
DefaultMagnoliaConfigurationProperties
,
DefaultMagnoliaInitPaths
,
ConfigLoader
,
Log4jConfigurer
Field Summary | |
---|---|
static String |
DEFAULT_PLATFORM_COMPONENTS_CONFIG_LOCATION
|
static String |
PLATFORM_COMPONENTS_CONFIG_LOCATION_NAME
|
Constructor Summary | |
---|---|
MagnoliaServletContextListener()
|
Method Summary | |
---|---|
void |
contextDestroyed(javax.servlet.ServletContextEvent sce)
|
void |
contextInitialized(javax.servlet.ServletContextEvent sce)
|
void |
contextInitialized(javax.servlet.ServletContextEvent sce,
boolean startServer)
|
protected ComponentProviderConfiguration |
getPlatformComponents()
|
protected List<String> |
getPlatformComponentsResources()
Returns a list of resources that contain platform components. |
protected ComponentProviderConfiguration |
getSystemComponents()
|
protected String |
initRootPath(javax.servlet.ServletContext context)
Deprecated. since 4.5, use or subclass MagnoliaInitPaths . |
protected String |
initServername(boolean unqualified)
Deprecated. since 4.5, use or subclass MagnoliaInitPaths . |
protected String |
initWebappName(String rootPath)
Deprecated. since 4.5, use or subclass MagnoliaInitPaths . |
protected void |
startServer()
|
protected void |
stopServer()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PLATFORM_COMPONENTS_CONFIG_LOCATION_NAME
public static final String DEFAULT_PLATFORM_COMPONENTS_CONFIG_LOCATION
Constructor Detail |
---|
public MagnoliaServletContextListener()
Method Detail |
---|
public void contextInitialized(javax.servlet.ServletContextEvent sce)
contextInitialized
in interface javax.servlet.ServletContextListener
public void contextInitialized(javax.servlet.ServletContextEvent sce, boolean startServer)
public void contextDestroyed(javax.servlet.ServletContextEvent sce)
contextDestroyed
in interface javax.servlet.ServletContextListener
protected ComponentProviderConfiguration getPlatformComponents()
protected List<String> getPlatformComponentsResources()
protected ComponentProviderConfiguration getSystemComponents()
protected void startServer()
protected void stopServer()
protected String initWebappName(String rootPath)
MagnoliaInitPaths
.
protected String initRootPath(javax.servlet.ServletContext context)
MagnoliaInitPaths
.
protected String initServername(boolean unqualified)
MagnoliaInitPaths
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |