Yoann Chambonnet
Yoann Chambonnet

Reputation: 1333

Is there a way to use multiple SecurityManager(s) in Java?

I'd like to know if there is a way to use multiple security managers in java, and if so, how to specify them a particular .policy file?

I've been looking at the java se 6 doc about Security, but couldn't find any answer there...

Thanks everyone for help!

Upvotes: 0

Views: 468

Answers (1)

Donal Fellows
Donal Fellows

Reputation: 137567

The design of Java is such that only one SecurityManager can be installed at a time (but I suppose you could write your own composite that requires all its atomic managers to agree… but why?)

However, it is possible to have many different policies applied by the security manager so that code that is from one location or which is published by a particular individual has access to one set of capabilities, and code from elsewhere can do something else.

Upvotes: 2

Related Questions