Skip to Content
Java Security
book

Java Security

by Scott Oaks
May 1998
Intermediate to advanced
469 pages
14h 57m
English
O'Reilly Media, Inc.
Content preview from Java Security

Name

Class java.security.PermissionCollection

Synopsis

As you might infer, a permission collection is a collection of permission objects. In theory, a permission collection can be a set of arbitrary, unrelated permission objects; however, that usage is best avoided and left to the Permissions class. Hence, a permission collection should be thought of as a collection of one type of permission: a set of file permissions, a set of socket permissions, etc. A permission collection is responsible for determining if an individual permission (passed as a parameter to the implies() method) is contained in the set of permissions in the object; presumably, it will do that more efficiently than by calling the implies() method on each permission in the collection. If you implement a new permission class that has wildcard semantics for its names, then you must implement a corresponding permission collection to aggregate instances of that class (if you don’t need wildcard matching, the default implementation of the Permission class will provide an appropriate collection).

Class Definition

public abstract class java.security.PermissionCollection
	extends java.lang.Object
	implements java.io.Serializable {

	// Constructors
	public PermissionCollection();

	// Instance Methods
	public abstract void add(Permission);
	public abstract Enumeration elements();
	public abstract boolean implies(Permission);
	public boolean isReadOnly();
	public void setReadOnly();
	public String toString();
}

See also:

Permission, Permissions ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Security Handbook

Java Security Handbook

Jamie Jaworski, Paul J. Perrone, Venkata S.R. Krishna Chaganti

Publisher Resources

ISBN: 1565924037Supplemental ContentCatalog PageErrata