Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4013200
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:20:30+00:00 2026-05-20T09:20:30+00:00

This article about Java security says: Code in the Java library consults the Security

  • 0

This article about Java security says:

Code in the Java library consults the
Security Manager whenever a dangerous
operation is about to be attempted.

So, what does this exactly mean? Say, if I’ve implemented my own securitymanager and enabled it for the whole JVM. Now, does the java runtime consults my securitymanager for each and every java call(like System.out.println() etc) or it consults only for dangerous api calls like System.exit() ,file operations etc?

edit: let me clarify my question,

I’m not questioning the possiblities of the securitymanager. I’m just asking if the security checks are done for the dangerous api’s alone or it is done for each and every method call. Which inturn causes a huge performance degradation in case of applications with large amounts of code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:20:31+00:00Added an answer on May 20, 2026 at 9:20 am

    It will only consult the SecurityManager if the code says so. It won’t do it for every single operation.

    For example in Runtime.exit, you see that the SecurityManager is consulted:

    public void exit(int status) {
    SecurityManager security = System.getSecurityManager();
    if (security != null) {
        security.checkExit(status);
    }
    Shutdown.exit(status);
    }
    

    Similarly, in File, you will see that most methods consult the SecurityManager. Example:

    public boolean canWrite() {
    SecurityManager security = System.getSecurityManager();
    if (security != null) {
        security.checkWrite(path);
    }
    return fs.checkAccess(this, FileSystem.ACCESS_WRITE);
    }
    

    If you are writing a method which might be “dangerous” then you should also consult the SecurityManager.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Reading this DZone article about Java concurrency I was wondering if the following code:
I was reading this article about Double-Checked locking and out of the main topic
LearnWPF.com posted this article about converting bitmap images to XAML and using them in
I happened across this article about hardware based hard drive encryption and realized that
When I saw this article about using a python-like sintax (indentation based, without curly
I don't understand where the extra bits are coming from in this article about
I've been reading this article about closures in which they say: all the plumbing
I've read the Beautiful code with Google Collections, Guava and static imports article about
I was reading this MSDN article about the usage of properties and methods in
I have just read this interesting article about the implementation details for various languages

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.