public abstract class TinyPlugzServletContextListener extends Object implements javax.servlet.ServletContextListener
#configure(DefineProperties, Path). You then need to
register the listener in your web.xml:
<listener>
<listener-class>com.your.domain.TinyPlugzServletContextListenerImpl</listener-class>
</listener>
TinyPlugz will then be deployed when this listener receives the
contextInitialized event and will be undeployed when the listener receives
the contextDestroyed event.| Constructor and Description |
|---|
TinyPlugzServletContextListener() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract TinyPlugzConfigurator.DeployTinyPlugz |
configure(TinyPlugzConfigurator.DefineProperties props,
Path webInfDir)
Provides settings for deploying TinyPlugz.
|
void |
contextDestroyed(javax.servlet.ServletContextEvent sce) |
void |
contextInitialized(javax.servlet.ServletContextEvent sce) |
protected abstract TinyPlugzConfigurator.DeployTinyPlugz configure(TinyPlugzConfigurator.DefineProperties props, Path webInfDir)
@Override
protected final DeployTinyPlugz configure(DefineProperties props, Path webInfDir) {
final Path pluginDir = webInfDir.resolve("plugins");
return props.withProperty(Options.FAIL_ON_MULTIPLE_PROVIDERS)
.withPlugins(source -> source.addAllPluginJars(pluginDir));
}
props - Builder object for specifying configuration properties.webInfDir - The location of the WEB-INF directory.TinyPlugzConfigurator.DeployTinyPlugz instance which is returned by the
given builder's
withPlugins method.public final void contextInitialized(javax.servlet.ServletContextEvent sce)
contextInitialized in interface javax.servlet.ServletContextListenerpublic final void contextDestroyed(javax.servlet.ServletContextEvent sce)
contextDestroyed in interface javax.servlet.ServletContextListenerCopyright © 2014–2015. All rights reserved.