Microsoft SDK for Java

checkPackageDefinition

This method of the StandardSecurityManager Class determines whether classes within the specified package can be defined.

Syntax

public synchronized void checkPackageDefinition(String pkg);

Parameters

pkg The name of the package that determines which package to check.

Remarks

The package definition is denied if a system property of the form package.restrict.definition.packagename exists. This method overrides the java.lang.SecurityManager.checkPackageAccess(String) method.

Note   Because of both the nature of class loaders and the fact that this check is made at load time instead of class resolution time, no specific contextual information can be extrapolated to determine who is attempting to define a class in the specified package. Therefore, this check cannot fit into the class-granular permissions model. This check is based on a global state, and will always return the same result, independent of the current execution context.

Exceptions

SecurityException if the package definition is prohibited.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.