org.netbeans.bootstrap/1 2.52

org.netbeans
Class TopSecurityManager

java.lang.Object
  extended by java.lang.SecurityManager
      extended by org.netbeans.TopSecurityManager

public class TopSecurityManager
extends SecurityManager

NetBeans security manager implementation.


Field Summary
 
Fields inherited from class java.lang.SecurityManager
inCheck
 
Constructor Summary
TopSecurityManager()
          constructs new TopSecurityManager
 
Method Summary
 void checkConnect(String host, int port)
          Checks connect
 void checkConnect(String s, int port, Object context)
           
 void checkDelete(String file)
          The method has awful performance in super class
 void checkExit(int status)
           
 void checkPermission(Permission perm)
           
 void checkPermission(Permission perm, Object context)
           
 void checkPropertyAccess(String x)
          Performance - all props accessible
 void checkRead(FileDescriptor fd)
           
 void checkRead(String file)
          The method is empty.
 boolean checkTopLevelWindow(Object window)
           
 void checkWrite(FileDescriptor fd)
           
 void checkWrite(String file)
          The method has awful performance in super class
static void exit(int status)
          Can be called from core classes to exit the system.
static void install()
           
static void makeSwingUseSpecialClipboard(Clipboard clip)
          Convinces Swing components that they should use special clipboard and not Toolkit.getSystemClipboard.
static void register(SecurityManager sm)
          Register a delegate security manager that can handle some checks for us.
static void unregister(SecurityManager sm)
          Unregister a delegate security manager.
 
Methods inherited from class java.lang.SecurityManager
checkAccept, checkAccess, checkAccess, checkAwtEventQueueAccess, checkCreateClassLoader, checkExec, checkLink, checkListen, checkMemberAccess, checkMulticast, checkMulticast, checkPackageAccess, checkPackageDefinition, checkPrintJobAccess, checkPropertiesAccess, checkRead, checkSecurityAccess, checkSetFactory, checkSystemClipboardAccess, classDepth, classLoaderDepth, currentClassLoader, currentLoadedClass, getClassContext, getInCheck, getSecurityContext, getThreadGroup, inClass, inClassLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopSecurityManager

public TopSecurityManager()
constructs new TopSecurityManager

Method Detail

register

public static void register(SecurityManager sm)
                     throws SecurityException
Register a delegate security manager that can handle some checks for us. Currently only checkExit and checkTopLevelWindow are supported.

Parameters:
sm - the delegate to register
Throws:
SecurityException - without RuntimePermission "TopSecurityManager.register"

unregister

public static void unregister(SecurityManager sm)
                       throws SecurityException
Unregister a delegate security manager.

Parameters:
sm - the delegate to unregister
Throws:
SecurityException - without RuntimePermission "TopSecurityManager.unregister"

checkExit

public void checkExit(int status)
               throws SecurityException
Overrides:
checkExit in class SecurityManager
Throws:
SecurityException

exit

public static void exit(int status)
Can be called from core classes to exit the system. Direct calls to System.exit will not be honored, for safety.

Parameters:
status - the status code to exit with
See Also:
"#20751"

checkTopLevelWindow

public boolean checkTopLevelWindow(Object window)
Overrides:
checkTopLevelWindow in class SecurityManager

checkPropertyAccess

public final void checkPropertyAccess(String x)
Performance - all props accessible

Overrides:
checkPropertyAccess in class SecurityManager

checkRead

public void checkRead(String file)
The method is empty. This is not "secure", but on the other hand, it reduces performance penalty of startup about 10%

Overrides:
checkRead in class SecurityManager

checkRead

public void checkRead(FileDescriptor fd)
Overrides:
checkRead in class SecurityManager

checkWrite

public void checkWrite(FileDescriptor fd)
Overrides:
checkWrite in class SecurityManager

checkDelete

public void checkDelete(String file)
The method has awful performance in super class

Overrides:
checkDelete in class SecurityManager

checkWrite

public void checkWrite(String file)
The method has awful performance in super class

Overrides:
checkWrite in class SecurityManager

checkConnect

public void checkConnect(String host,
                         int port)
Checks connect

Overrides:
checkConnect in class SecurityManager

checkConnect

public void checkConnect(String s,
                         int port,
                         Object context)
Overrides:
checkConnect in class SecurityManager

checkPermission

public void checkPermission(Permission perm)
Overrides:
checkPermission in class SecurityManager

checkPermission

public void checkPermission(Permission perm,
                            Object context)
Overrides:
checkPermission in class SecurityManager

install

public static void install()

makeSwingUseSpecialClipboard

public static void makeSwingUseSpecialClipboard(Clipboard clip)
Convinces Swing components that they should use special clipboard and not Toolkit.getSystemClipboard.

Parameters:
clip - clipboard to use

org.netbeans.bootstrap/1 2.52

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.