title: Securing Java application with trusted and untrusted code
body: <p>Suppose I want to ship a Java application that supports plugins.  For security reasons, I want the first party code (i.e. my code) to run basically unrestricted, but I want to limit the operations that the plugins would be able to perform.  What's the right way of doing this?  Is using the <code>SecurityManager</code> appropriate?  Secondarily, is there a way to enforce that the application is started with a particular policy file in place, or should I assume if the end user wants to hack another policy file into place, that's their prerogative (or at least, there's nothing I can do to prevent it?).</p>
  
  <p>The reason I have my doubts about the SecurityManager is because the goal of the class seems to be to prevent the entire application from doing things the end user doesn't want, whereas I'd like to use one to manage subsets of the application, completely opaquely to the end user, if possible.</p>