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 7711445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:22:39+00:00 2026-06-01T01:22:39+00:00

Let’s assume I have a framework written in Java and some C++ code which

  • 0

Let’s assume I have a framework written in Java and some C++ code which does resource intensive work. — The framework initializes a processing chain based on a database configuration. The processing units (of this chain) are written in C++. Every unit implements the following interface:

class IModule {
public:
    virtual ~IModule() {};
    virtual bool setConfig(ModConfig* config) = 0;
    virtual map<string*,string*>* getStatus() = 0;
};

I want that developers are able to implement the interface IModule in C++ and make a database entry containing the name of the class. The Java framework then automatically loads that class. — The objective must not be to write additional binding code neither in C++ nor in Java.
As you can see in the interface the method setConfig() receives an object of type ModConfig. Meaning that it must be possible to make an instance of that C++ object in Java.

I evaluated the following technologies:
– JNA: C only -> needs addition binding code
– JNIEasy: maps object to object directly
– SWIG: maps object to object directly
– BridJ: maps object to object directly
– JNI: maybe a solution for the problem?

Summary:
– Load C++ class by name from Java.
– Instantiate C++ object in Java.

I don’t expect anybody to provide me with code. Just point me in the right direction (technology).

Thanks in advance

  • 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-06-01T01:22:40+00:00Added an answer on June 1, 2026 at 1:22 am

    Your question is deeply operating system specific (or I misunderstood it). I don’t understand what loading a C++ class at runtime means to you (it certainly is not possible in pure C++11, you need operating system support).

    You could load a dynamically linkable shared object on Posix systems with dlopen then get a symbol’s address in it with dlsym. Don’t forget to declare extern "C"the C++ functions you want to find.

    If you are concerned about C++ classes, then look perhaps also in Qt’s Qlibrary and QPluginLoader for inspiration.

    Read more about plug-ins.

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

Sidebar

Related Questions

Let say I have some code HTML code: <ul> <li> <h1>Title 1</h1> <p>Text 1</p>
Let's say i have this block of code, <div id=id1> This is some text
let us suppose some (legacy) code, which cannot be touched, declare struct B{ public:
Let's consider the following scenario: a function which can generate code colors from white
Let's assume we have the following structure: index.php config.inc.php \ lib \ lib \
Let's say I have this code: <p dataname=description> Hello this is a description. <a
Let's assume that a user votes for some movies in a scale of 1
Let's say you have a class called Customer, which contains the following fields: UserName
Let's say I have the string: hello world; some random text; foo; How could
Let's suppose I have this piece of code. foreach(string value in myList) { string

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.