Suppose I'm writing some environment which execute clients code (Java). Clients send jar with manifest information. Environment creates some class instance from jar (suppose instance of Runnable) and run it in some thread. But I need guarantee that clients code will not start own threads or create own ExecutorService and so on.
Is there any possibility for security manager to do this level of restricting? And if so, how can I achieve this?