JVM instantiates SecurityManager on the first attempt of execution of secure operation (for example, working with files, network ...)
Explanantion
Objective: Security manager in J2EE applications
After calling System.setSecurityManager() method.
When running applet within Java Plugin.
When -Djava.security.manager option is specified.
System.setSecurityManager(SecurityManager sm) method sets the system security manager to the given object. When you specify the -Djava.security.manager option to a Java application, the virtual machine executes the setSecurityManager( ) method on your behalf, before it calls the main( ) method of your application.
The Java Plug-in and appletviewer use a modified implementation and install it before they load any applets.
After calling System.setSecurityManager() method.
JVM 1.2 and higher always has an instance of SecurityManager.
When running applet within Java Plugin.
When -Djava.security.manager option is specified.
|