0

Before I was using;

public static void main(String args[]) 
{
   try 
   {
       ORB orb = ORB.init(args, null);
   }
}

and then having parameter argument

-ORBInitialPort 1050

I now want to remove the main section of the code and have the class being created inside another class, so is it possible to hardcode these arguments? Or do i have to pass the data from the new class into the class that needs it?

3
  • 7
    mmh maybe you need to rephrase a bit, not sure what you're asking here... Commented Apr 18, 2013 at 18:42
  • maybe you could create a wrapper class for that? Commented Apr 18, 2013 at 18:43
  • You can have global values passed with -Dfoo=bar to your program then you just need to get the value with System.getProperty("foo") if this is what you're asking. Commented Apr 18, 2013 at 18:44

1 Answer 1

4

Sure, you mean the static initializer method (for CORBA). You can do

String[] newArgs = {"-ORBInitialPort", "1050"}; 
ORB orb = ORB.init(newArgs, null);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.