|| At A Glance | About This Document | Class Description | Usage Notes | Runtime View | DSM Code ||


The HotJavaTM Component Series


HotJava Delegating Security Manager

Class At A Glance

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.


 
About This Document

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

Class Description
Overview
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.


Usage Notes
 
When developers write their security manager they should not impose any security policies on ClassLoaders that are instances of sun.applet.AppletClassloader or sunw.hotjava.applet.AppletClassloader.  These are the two class loaders for which the HTML Component claims responsibility.  If the user defined SecurityManager does impose security restrictions on either of those class loaders the HTML Component may not work correctly.  The user defined SecurityManager should be responsible for any other ClassLoaders.

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.


Runtime View

 


|| At A Glance | About This Document | Class Description | Usage Notes | Runtime View ||
HotJava Components version 1.1.2