Serge Kabose
Serge Kabose

Reputation: 1

Dynamic argument pasing in corba

I'm new in building corba application. Presently I'm developping a corba application in java. The problem I have is that I should write a method that receive the name of the class, the method and the arguments to pass to the corba server as a string. Before invoking the remote method, I have to parse the string and obtain all the necessary information (class, method, arguments) There is no problem here. But now concerning the arguments i do not now in advance the type of the arguments, so I should be able to convert an argument by getting its type and insert it into a Any bject to be sent, is it possible? If Know in advance the type such as seq.insert_string("bum") it works but I want to do it dynamically.

Upvotes: 0

Views: 81

Answers (1)

Brian Kelly
Brian Kelly

Reputation: 19305

Use the DynAny interfaces, if your ORB supports them. They can do exactly what you want. From CORBA Explained Simply:

If an application wants to manipulate data embedded inside an any without being compiled with the relevant stub code then the application must convert the any into a DynAny. There are sub-types of DynAny for each IDL construct. For example, there are types called DynStruct, DynUnion, DynSequence and so on.

The operations on the DynAny interfaces allow a programmer to recursively drill down into a compound data-structure that is contained within the DynAny and, in so doing, decompose the compound type into its individual components that are built-in types. Operations on the DynAny interface can also be used to recursively build up a compound data-structure from built-in types.

Upvotes: 1

Related Questions