Search code examples
javasecurityclasspluginsclassloader

Extending Java application with user plugins


I am interested in extending my application with plug-ins. I made the Application to download videos from websites but it needs a valid URL to do this. The users could create a new plug-in for specific URL/domain and feed my application with valid URL.

I was doing this using jar files and URLClassLoaders. The problem with this approach is, that loaded classes have elevated privileges when they should only have permission to read from an URL.

Which is the best way to extend Java Application with plug-ins?


Solution

  • OSGi might be the way to go, but it might also be a bit too advanced/complex for what you want to do. I used JPF in a small project a couple of years ago. I liked it.

    http://jpf.sourceforge.net/