| Class Name: | DelegatingSecurityManager |
| Extends: | java.lang.SecurityManager |
| Implements: | n/a |
Purpose
To allow the HTML Component's security manager and a user written security manager to co-exist.Key Properties
Implemented as a Singleton.Creation
DelegatingSecurityManager.getDelegatingSecurityManager(SecurityManager userDefinedSecurityManager)Commonly Used Methods
The standard SecurityManager checkXXX() methods.
Audience
This document describes the DelegatingSecurityManager class. It is intended for advanced Java developers who will be programatically accessing the HotJava HTML Component. It assumes that you are already familiar with JavaBeans and feel comfortable writing your own SecurityManager.Table of Contents
Class At A Glance
About This Document
Class Description
Usage Notes
Runtime View
The DelegatingSecurityManager class is designed for application writers who want to embed the HotJava HTML Component into applications that have their own security manager, yet still preserve the component's security manager.The DelegatingSecurityManager is designed as a "Singleton," which means that you cannot directly instantiate it with its constructor, and only one may ever be instantiated. In order to instatiate it you have to call its static method getDelegatingSecurityManager(SecurityManager) which will return an instance of the DelegatingSecurityManager. The parameter that you must pass into this function is the SecurityManager that the developer has created. The resulting instance that is returned to you should then be set as the default system SecurityManager with the java.lang.System.setSecurityManager(SecurityManager) method call.
The resulting security policy becomes the intersection of the two security models that are implemented by the HotJava HTML Component's SecurityManager and the developer's SecurityManager. For every checkXXX() method called by the system of the DelegatingSecurityManager, the same method from both of the security managers (user defined and HTML component defined) are called in turn. For all practical purposes the DelegatingSecurityManager is just a shell that routes security checks to the user defined SecurityManager and the HTML Component's SecurityManager.
In order to use the DelegatingSecurityManager, the HotJava HTML Component must be on the CLASSPATH of the machine on which it is running. This is necessary because the DelegatingSecurityManager relies on some of the classes that exist in the HotJava HTML Component's Jar file, and it makes some assumptions based on this fact.
If you use the DelegatingSecurityManager you should set the system property "hotjava.hide.security.warning" to "true". This will avoid getting an error message when the bean attempts to install a security manager.