Execute plugins from a copy in $site_path/tmp

When starting a plugin its JAR is copied to a unique name in
$site_path/tmp. This avoids race conditions with administrators
installing a new version of a plugin while the JVM is still using
it to handle user current activities.

The temporary file copies are automatically deleted by the server only
after the URLClassLoader that wraps it has been reclaimed by the JVM
GC. By waiting until GC we can ensure the JAR exists on disk as long
as running code might need to use it.

Change-Id: I8e211592f8901bf44d66885409db4f7d6aaaaad3
6 files changed