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

  • SEARCH
  • Home
  • 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 89523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:43:48+00:00 2026-05-10T22:43:48+00:00

I have a Java application and I would like to make it extensible. To

  • 0

I have a Java application and I would like to make it extensible. To create an extension, developers within our company will write a Java class that implements a certain interface. They may also wish to write associated helper classes. I would like to load these extensions into the application without an outage.

I would like to limit what this class can do to the following:

  1. Call methods in the application’s API (this will be a parameter to the constructor)
  2. Create instances of other objects within the same package (so the author of the extension class can use other classes to get the job done).

When the class is invoked the API object that is passed in will already have a ‘customer’ defined and stored as a member variable. It will use this to limit access via the API to that customer’s data.

I do not want these classes doing things such as accessing the database, writing to disk, or otherwise doing things etc. This is mostly an effort at dependency management and encapsulation as the same team of developers will have access to write both extensions and the core system.

Is there a pattern for this? Am I on the right track?

  • 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. 2026-05-10T22:43:48+00:00Added an answer on May 10, 2026 at 10:43 pm

    You don’t need to look for anything exotic. Handling this scenario is a fundamental feature of the Java security architecture.

    Every class has a ‘codebase’, the location from which it was loaded. So if you package each extension in a separate JAR (or exploded in a separate directory), you’ll be able tailor the permissions granted to that codebase.

    In your case, it sounds even simpler. If I understand correctly, all extensions will have the same privileges, which are less than those of the parent application. Thus, they can all share a codebase.

    Here’s an example of a policy file:

    grant codeBase 'file:/path/to/app/lib/*' {   permission java.io.FilePermission '/path/to/app/-', 'read';   permission java.io.FilePermission '/path/to/app/data/-', 'read,write,delete'; };  grant codeBase 'file:/path/to/app/ext/*' {   permission java.util.PropertyPermission 'java.io.tmpdir', 'read';   permission java.io.FilePermission '${java.io.tmpdir}/myapp/-', 'read,write,delete'; }; 

    This simple example should work in any version of Java. Newer versions have extended policy syntax to grant permissions to a subject authenticated by JAAS.

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

Sidebar

Ask A Question

Stats

  • Questions 67k
  • Answers 67k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer You can use Window.GetWindow. However, you might want to consider… May 11, 2026 at 11:44 am
  • added an answer It means your file has been added to the index.… May 11, 2026 at 11:44 am
  • added an answer Rules for naming objects, including tables in MySql: http://dev.mysql.com/doc/refman/5.1/en/identifiers.html Identifiers… May 11, 2026 at 11:44 am

Related Questions

I have a Java application and I would like to make it extensible. To
I am developing a Java desktop application and would like to have an external
I have a third party .NET Assembly and a large Java application. I need
I am making an application with Java Swing and i have a problem. I
I have a large tree of Java Objects in my Desktop Application and am
I have an application written in java, and I want to add a flash
I have an application that's a mix of Java and C++ on Solaris. The
I have a Java application that launches another java application. The launcher has a
I have a Java application which I want to shutdown 'nicely' when the user
I have a Java application that monitors a folder for incoming XML files. When

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.