public class InfinispanLauncher extends Object implements javax.servlet.ServletContextListener
The name / path of the Infinispan configuration file is specified in a
servlet context init parameter 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 and Description |
---|---|
static class |
InfinispanLauncher.StartLogger
Logs Infinispan status and network topology after startup.
|
static class |
InfinispanLauncher.StopLogger
Logs Infinispan stop.
|
Modifier and Type | Field and Description |
---|---|
static String |
INFINISPAN_CONFIG_FILENAME
The name of the Infinispan configuration filename.
|
static String |
INFINISPAN_CTX_ATTRIBUTE_NAME
The name of the servlet context attribute for the launched
Infinispan cache manager.
|
Constructor and Description |
---|
InfinispanLauncher() |
Modifier and Type | Method and 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_FILENAME
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 © 2015 Connect2id. All Rights Reserved.