views:

40

answers:

3

Hi, all.

I want to enable the users of my website to upload their Java programs as a set of jar files. Of course I want to restrict the classes they can see or use, along with the underlying machine resources such as the heap, the threads, the disk, the consumed processor, etc, etc.

I want a server to manage, store and run those user programs, and also to allow them to create accounts and configure they runtime environments. Let's say I want to allow them to pick one of a set of predefined environments: JRE 5, JRE 6, Groovy, etc. And also to let them configure some variables.

So, the question is do you know something similar to what I've described already done? is it open source?

Developing such a thing could take years. I know that something could be done starting different processes and configuring security managers. But since the programs I expect to allow would be very simple, maybe this could not be the best approach (expensive to the server host). Besides, I guess this complicates potential execution distribution.

Additional features would be:

  • users would have to purchase additional resources or features.

  • execution distribution over a cluster of hosts (not an initial requirement, but would be a great additional feature).

If you still don't have a clue of what I'm talking about, take a look to Google App Engine. They allow you to upload applications in a managed and very restrictive runtime environment.

Regards.

A: 

I've seen app engines that allow you to write server-side apps in Javascript based on Rhino. However, I don't know of any open-source app engine that runs Java or Groovy.

dragisak
Well, although we could compile Javascript, compiling is not my concern. My concern is controlling the RTE to prevent users declare a huge array or start an infinite loop, for instance.I will add Rhino to the set of predefined environments I spoke above :). Thanks for your answer.
mrrtnn
A: 

Sounds like a JEE application server with some restrictions (custom classloader) attached to the app deployment. Maybe GlassFish v3 can be used as a starting point?

mjustin
Yes, probably an application server is a good starting point to share resources. However, that custom classloader you mention is the tough part that I want to save implementing. I think, we would have to instrument the loaded code to limit the heap, for instance.But maybe I'm missing some detail about it. Can you add a link to clarify your answer in this matter? Thanks for your answer.
mrrtnn
A: 

I think I asked for this in a complex way. Maybe I should re-ask for more simple concepts. Anyway. The most accurate answer of I wanted to ask was mjustin's. Thanks!

mrrtnn