Security Considerations

Reflection involves substantial discovery at runtime about code that has been loaded into the virtual machine. For an application such as an integrated development environment (IDE), virtually every aspect of a class must be accessible through Reflection to satisfy the needs of the program. However, from earlier chapters, you have seen that access to, and knowledge of, the methods and fields of a class are restricted through the use of access specifiers. Some of the uses of Reflection require that these restrictions be suspended, but this is done in a secure way.

The Java 2 security mechanisms are central to allowing or disallowing Reflection access to a requestor.

The Java 2 security model prevents classes that don't ...

Get Special Edition Using Java 2 Standard Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.