java.lang.Object
net.i2p.router.web.WebAppConfiguration
- All Implemented Interfaces:
Configuration
Adds to the webapp classpath as specified in
webapps.config. This allows us to reference classes that are not in the classpath specified in wrapper.config, since old installations have individual jars and not lib/*.jar specified in wrapper.config. A sample line in webapps.config is: webapps.appname.classpath=foo.jar,$I2P/lib/bar.jar Unless $I2P is specified the path will be relative to $I2P/lib for webapps in the installation and appDir/plugins/appname/lib for plugins.
webapps.config is used because setting Class-Path in MANIFEST.MF does not work for jetty wars, and because WebAppContext.addClassPath() is not usable here. Jars that are already on the system class path are skipped to avoid duplicate statics; /susimail is the exception.
Nested Class Summary
Nested classes/interfaces inherited from interface Configuration
Configuration.ClassListField Summary
FieldsFields inherited from interface Configuration
ATTRConstructor Summary
ConstructorsConstructorDescriptionconfigure(WebAppContext)takes the WebAppContext it is configuring as an argument, so a bare instance is how Jetty creates it.Method Summary
Modifier and TypeMethodDescriptionvoidcloneConfigure(WebAppContext template, WebAppContext context) Apply the same settings to a cloned webapp.voidconfigure(WebAppContext context) Apply I2P security settings to the webapp.private voidThis was the interface in Jetty 5, in Jetty 6 was configureClassLoader(), now it's configure().voiddeconfigure(WebAppContext context) Jetty 7 Configuration hook.voiddestroy(WebAppContext context) Jetty 7 Configuration hook.Convert URL to URI so there's no blocking equals(), not that there's really any hostnames in here, but keep findbugs happy.voidpostConfigure(WebAppContext context) Jetty 7 Configuration hook.voidpreConfigure(WebAppContext context) Jetty 7 Configuration hook.
Field Details
CLASSPATH
Name of the file listing a webapp's extra classpath entries.- See Also:
Constructor Details
WebAppConfiguration
public WebAppConfiguration()configure(WebAppContext)takes the WebAppContext it is configuring as an argument, so a bare instance is how Jetty creates it.
Method Details
configureClassPath
This was the interface in Jetty 5, in Jetty 6 was configureClassLoader(), now it's configure().- Parameters:
wac- the web app context to set the extra classpath on- Throws:
Exception- if the plugin's webapp properties cannot be read
getSystemClassPath
Convert URL to URI so there's no blocking equals(), not that there's really any hostnames in here, but keep findbugs happy.- Parameters:
ctx- the context, used to locate the lib directory on Java 9 and later- Returns:
- the system class path
deconfigure
Jetty 7 Configuration hook. Nothing to undo - this configuration only adjusts the class path, which Jetty owns.- Specified by:
deconfigurein interfaceConfiguration
configure
Apply I2P security settings to the webapp.- Specified by:
configurein interfaceConfiguration- Throws:
Exception
cloneConfigure
Apply the same settings to a cloned webapp.- Specified by:
cloneConfigurein interfaceConfiguration
destroy
Jetty 7 Configuration hook. Nothing to destroy - this configuration holds no resources.- Specified by:
destroyin interfaceConfiguration
preConfigure
Jetty 7 Configuration hook. Runs beforeconfigure(WebAppContext)with no class path work to do, so this is an intentional no-op.- Specified by:
preConfigurein interfaceConfiguration
postConfigure
Jetty 7 Configuration hook. Runs afterconfigure(WebAppContext)with no follow-up work, so this is an intentional no-op.- Specified by:
postConfigurein interfaceConfiguration