EventListener
, javax.servlet.ServletContextListener
public class InfinispanLauncher extends Object implements javax.servlet.ServletContextListener
The location of the Infinispan configuration file in web application (WAR) is specified as follows:
infinispan.configurationFile
infinispan.configurationFile
.
The launched Infinispan cache manager will be exported to the servlet
context as an org.infinispan.manager.EmbeddedCacheManager
, under a
key that bears the interface name.
Modifier and Type | Class | Description |
---|---|---|
static class |
InfinispanLauncher.StartLogger |
Logs Infinispan status and network topology after startup.
|
static class |
InfinispanLauncher.StopLogger |
Logs Infinispan stop.
|
Modifier and Type | Field | Description |
---|---|---|
static String |
INFINISPAN_CONFIG_FILE_SETTING |
The name of the setting for the Infinispan configuration filename.
|
static String |
INFINISPAN_CTX_ATTRIBUTE_NAME |
The name of the servlet context attribute for the launched
Infinispan cache manager.
|
Constructor | Description |
---|---|
InfinispanLauncher() |
Modifier and Type | Method | Description |
---|---|---|
void |
contextDestroyed(javax.servlet.ServletContextEvent sce) |
Handler for servlet context shutdown events.
|
void |
contextInitialized(javax.servlet.ServletContextEvent sce) |
Handler for servlet context startup events; configures and launches
an Infinispan cache manager using the configuration file specified
in the servlet context parameter
infinispan.configurationFile . |
public static final String INFINISPAN_CONFIG_FILE_SETTING
public static final String INFINISPAN_CTX_ATTRIBUTE_NAME
public InfinispanLauncher()
public void contextInitialized(javax.servlet.ServletContextEvent sce)
infinispan.configurationFile
.
The configuration file location must be relative to the web
application directory, e.g. /WEB-INF/infinispan.xml
.
Exceptions are logged at ERROR level using Log4j.
contextInitialized
in interface javax.servlet.ServletContextListener
sce
- A servlet context event.public void contextDestroyed(javax.servlet.ServletContextEvent sce)
contextDestroyed
in interface javax.servlet.ServletContextListener
sce
- A servlet context event.Copyright © 2018 Connect2id. All rights reserved.