Class java.rmi.server.StubSecurityManager
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.rmi.server.StubSecurityManager

java.lang.Object
   |
   +----java.lang.SecurityManager
           |
           +----java.rmi.server.StubSecurityManager

public class StubSecurityManager
extends SecurityManager
This class defines the RMI Stub security policy for applications (not applets). For code loaded as a Stub, the security manager disables all functions except class definition and access. To set a StubSecurityManager, add the following to an application's main () method:
System.setSecurityManager(New StubSecurityManager()); If no security manager has been set, RMI will load stub classes only from the local files as defined by CLASSPATH.


Constructor Index

 o StubSecurityManager()
Construct and initialize.

Method Index

 o checkAccept(String, int)
For now Stubs can't accept connections on any port.
 o checkAccess(Thread)
Stubs are not allowed to manipulate threads outside Stub thread groups.
 o checkAccess(ThreadGroup)
Stubs are not allowed to manipulate thread groups outside Stub thread groups.
 o checkConnect(String, int)
Check if a Stub can connect to the given host:port.
 o checkConnect(String, int, Object)
Checks to see if the Stub and the indicated execution context are both allowed to connect to the indicated host and port.
 o checkConnect(String, String)
Check if a Stub from a host can connect to another host.
 o checkCreateClassLoader()
Stubs are not allowed to create class loaders.
 o checkExec(String)
Stubs are not allowed to fork processes.
 o checkExit(int)
Stubs are not allowed to exit the VM.
 o checkLink(String)
Stubs are not allowed to link dynamic libraries.
 o checkListen(int)
For now Stubs can't listen on any port.
 o checkPackageAccess(String)
Check if a Stub can access a package.
 o checkPackageDefinition(String)
Check if a Stub can define classes in a package.
 o checkPropertiesAccess()
Stubs are not allowed to access any properties.
 o checkPropertyAccess(String)
Stubs are not allowed to access any properties.
 o checkRead(FileDescriptor)
Stubs are not allowed to open file descriptors.
 o checkRead(String)
Check if a Stub can read a particular file.
 o checkRead(String, Object)
No file reads are valid from a stub.
 o checkRead(String, URL)
 o checkSetFactory()
Check if a Stub can set a networking-related object factory.
 o checkTopLevelWindow(Object)
Disallow creating top-level windows by the caller.
 o checkWrite(FileDescriptor)
Stubs are not allowed to open file descriptors.
 o checkWrite(String)
Check if a Stub can write a particular file.
 o getSecurityContext()
The only variable that currently affects whether a Stub can perform certain operations is the host it came from.

Constructors

 o StubSecurityManager
  public StubSecurityManager()
Construct and initialize.

Methods

 o getSecurityContext
  public Object getSecurityContext()
The only variable that currently affects whether a Stub can perform certain operations is the host it came from.
Overrides:
getSecurityContext in class SecurityManager
 o checkCreateClassLoader
  public synchronized void checkCreateClassLoader()
Stubs are not allowed to create class loaders.
Overrides:
checkCreateClassLoader in class SecurityManager
 o checkAccess
  public synchronized void checkAccess(Thread t)
Stubs are not allowed to manipulate threads outside Stub thread groups.
Overrides:
checkAccess in class SecurityManager
 o checkAccess
  public synchronized void checkAccess(ThreadGroup g)
Stubs are not allowed to manipulate thread groups outside Stub thread groups.
Overrides:
checkAccess in class SecurityManager
 o checkExit
  public synchronized void checkExit(int status)
Stubs are not allowed to exit the VM.
Overrides:
checkExit in class SecurityManager
 o checkExec
  public synchronized void checkExec(String cmd)
Stubs are not allowed to fork processes.
Overrides:
checkExec in class SecurityManager
 o checkLink
  public synchronized void checkLink(String lib)
Stubs are not allowed to link dynamic libraries.
Overrides:
checkLink in class SecurityManager
 o checkPropertiesAccess
  public synchronized void checkPropertiesAccess()
Stubs are not allowed to access any properties.
Overrides:
checkPropertiesAccess in class SecurityManager
 o checkPropertyAccess
  public synchronized void checkPropertyAccess(String key)
Stubs are not allowed to access any properties.
Overrides:
checkPropertyAccess in class SecurityManager
 o checkRead
  public synchronized void checkRead(String file)
Check if a Stub can read a particular file.
Overrides:
checkRead in class SecurityManager
 o checkRead
  public synchronized void checkRead(String file,
                                     URL base)
 o checkRead
  public void checkRead(String file,
                        Object context)
No file reads are valid from a stub.
Parameters:
file - the system dependent file name
context - the alternate execution context which must also be checked
Throws: SecurityException
If the file is not found.
Overrides:
checkRead in class SecurityManager
 o checkWrite
  public synchronized void checkWrite(String file)
Check if a Stub can write a particular file.
Overrides:
checkWrite in class SecurityManager
 o checkRead
  public synchronized void checkRead(FileDescriptor fd)
Stubs are not allowed to open file descriptors.
Overrides:
checkRead in class SecurityManager
 o checkWrite
  public synchronized void checkWrite(FileDescriptor fd)
Stubs are not allowed to open file descriptors.
Overrides:
checkWrite in class SecurityManager
 o checkListen
  public synchronized void checkListen(int port)
For now Stubs can't listen on any port.
Overrides:
checkListen in class SecurityManager
 o checkAccept
  public synchronized void checkAccept(String host,
                                       int port)
For now Stubs can't accept connections on any port.
Overrides:
checkAccept in class SecurityManager
 o checkConnect
  public synchronized void checkConnect(String host,
                                        int port)
Check if a Stub can connect to the given host:port.
Overrides:
checkConnect in class SecurityManager
 o checkConnect
  public void checkConnect(String host,
                           int port,
                           Object context)
Checks to see if the Stub and the indicated execution context are both allowed to connect to the indicated host and port.
Overrides:
checkConnect in class SecurityManager
 o checkConnect
  public synchronized void checkConnect(String fromHost,
                                        String toHost)
Check if a Stub from a host can connect to another host. This usually means that you need to determine whether the hosts are inside or outside the firewall. For now Stubs can only access the host they came from.
 o checkTopLevelWindow
  public synchronized boolean checkTopLevelWindow(Object window)
Disallow creating top-level windows by the caller.
Overrides:
checkTopLevelWindow in class SecurityManager
 o checkPackageAccess
  public synchronized void checkPackageAccess(String pkg)
Check if a Stub can access a package.
Overrides:
checkPackageAccess in class SecurityManager
 o checkPackageDefinition
  public synchronized void checkPackageDefinition(String pkg)
Check if a Stub can define classes in a package.
Overrides:
checkPackageDefinition in class SecurityManager
 o checkSetFactory
  public synchronized void checkSetFactory()
Check if a Stub can set a networking-related object factory.
Overrides:
checkSetFactory in class SecurityManager

All Packages  Class Hierarchy  This Package  Previous  Next  Index