public abstract class TinyPlugzServletContextListener extends Object implements javax.servlet.ServletContextListener
#configure(DefineProperties, ServletContext). 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,
javax.servlet.ServletContext context)
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, javax.servlet.ServletContext context)
@Override
protected final DeployTinyPlugz configure(DefineProperties props,
ServletContext context) {
final String pathString = context.getRealPath("WEB-INF/plugins");
final Path pluginDir = Paths.get(pathString);
return props.withProperty(Options.FAIL_ON_MULTIPLE_PROVIDERS)
.withPlugins(source -> source.addAllPluginJars(pluginDir));
}
props - Builder object for specifying configuration properties.context - The current servlet context.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.