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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:19:38+00:00 2026-05-18T11:19:38+00:00

I have a defined idl file, which looks like this: module Banking { typedef

  • 0

I have a defined idl file, which looks like this:

module Banking {
    typedef string Transactions[5];
    typedef long AccountId;

    interface Account {
        exception InsufficientFunds {};

        readonly attribute double balance;
        long lodge(in double amount);
        long withdraw(in double amount) raises (InsufficientFunds);
        readonly attribute Transactions transactions;   
    };

    interface Bank {
        long accountCount();
        double totalMoney();
        Account account(in AccountId accNr);
    };
};

which I compile with idlj. I have defined a BankServant, used by the client to communicate with the server and I have a working program with almost all methods implemented. My only problem is that I don’t know how can I implement account(in AccountId accNr) method, which in turn will return the proper Account object. As I don’t know CORBA and I am just helping a friend, I would like to ask for some kind of solutions / examples / tutorialis which may help me to hack a simple yet working class layout for dealing with that kind of situations.

Thank you 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-05-18T11:19:38+00:00Added an answer on May 18, 2026 at 11:19 am

    It really depends on the policies you’re using for the POA (the Portable Object Adapter). Assuming you’re using the RootPOA in the server, you have to:

    1. Create an implementation object for the Account object. This is usually called AccountImpl or AccountServant as I see in the name of the bank servant.

      AccountServant as = new AccountServant(accNr);

    2. You have to register the object in the POA. This, again, has to do with the policies you’ve selected for your POA. using the default Root POA:

      org.omg.CORBA.Object o = rootPOA.servant_to_reference( as );

    3. Narrow it to the correct Account type using the IDL compiler generated AccountHelper:

      Account acc = AccountHelper.narrow(o);

    4. Return it

      return acc;

    This code assumes you’ve written a constructor for the AccountServant java object that accepts the account number as its first argument. You have to provide the BankServant also with a reference to the POA in which you want to register the newly created Account objects.

    There are lots of tutorials. See this one for example, as the set of options for the POA are so many that require a book to explain them all :).

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

Sidebar

Related Questions

We have an idl file with multiple interfaces defined, two of which have someting
I have defined an AIDL file with my interface. Something like this: interface IResPlugin
I have an interface defined in an IDL file that I would like to
I have a structure defined in IDL. This structure has following members: { BSTR
I have defined a module in a file mod.ml as follows: module Area =
I have a method defined in IDL as follows : interface IMyFunc : IDispatch
I have defined a ConfigurationProperty class, which is basicly a key-value pair (with key
I have defined some sprites in a class .as file and I want to
I have defined a Matrix module as follows: module Matrix = struct type 'a
I was about to create a user-defined language file for Notepad++ to syntax-highlight IDL

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.