133 views
sandbox in java??
Category
edited Dec 24, 2015 | 133 views
kindly edit details part of the question..are you asking sandbox in java ? as it was not clear for me :)
always add necessary details at question details section so that users dont get confused..:) rather just 2 - 3 words details

+1 vote

In computer security, a sandbox is a security mechanism for separating running programs. It is often used to execute untested code, or untrusted programs from unverified third parties, suppliers, untrusted users and untrusted websites.

Java platform too has a security model known as sandbox model.

There may be applications that need CPU, the screen, keyboard, and mouse, and to its own memory.
System requirements vary from application to application.

We can handle the security in Java using SecurityManager Class.

The security manager is a class that allows applications to implement a security policy. It allows an application to determine, before performing a possibly unsafe or sensitive operation, what the operation is and whether it is being attempted in a security context that allows the operation to be performed..

The SecurityManager class contains many methods with names that begin with the word check. These methods are called by various methods in the Java libraries before those methods perform certain potentially sensitive operations. The invocation of such a check method typically looks like this:

     SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkXXX(argument,  . . . );
}

More at :

http://docs.oracle.com/javase/6/docs/api/java/lang/SecurityManager.html