BEA Logo BEA BEA Tuxedo Release [Release Number]

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

   BEA Tuxedo Doc Home   |   Using the CORBA Idltojava Compiler   |   Previous Topic   |   Next Topic   |   Contents   |   Index

Java IDL Examples

 

This topic includes the following sections:

 


Getting Started with a Simple Example of IDL

Listing 3-1 shows the OMG IDL to describe a CORBA object whose operations to_lower() and to_upper() each return a single string in which the letter case of the user input is changed accordingly. (Uppercase input is changed to lowercase, and vice versa.)

Listing 3-1 IDL Interface for the Simpapp Sample Application

#pragma prefix "beasys.com"
interface Simple
{
//Convert a string to lower case (return a new string)
string to_lower(in string val);
     //Convert a string to upper case (in place)
void to_upper(inout string val);
};
interface SimpleFactory
{
Simple find_simple();
};

If you were implementing this application from scratch, you would compile this IDL interface with the following command:

idltojava Simple.idl

This would generate stubs and skeletons and several other files.

For information on the options and flags on the idltojava compiler, refer to the topic Using the idltojava Command.

 


Callback Objects IDL Example

Listing 3-2 shows the OMG IDL to define the Callback, Simple, and SimpleFactory interfaces in the Callback sample application.

Listing 3-2 IDL Definition for the Callback Sample Application

#pragma prefix "beasys.com"

interface Callback

//This method prints the passed data in uppercase and lowercase
//letters.
{
void print_converted(in string message);
};

interface Simple

//Call the callback object in the joint client/server
//application
{
void call_callback(in string val, in Callback
callback_ref);
};

interface SimpleFactory
{
Simple find_simple();
};

For a complete explanation of the Java CORBA callbacks example as well as information on how to build and run the example, see Using CORBA Server-to-Server Communication in the BEA Tuxedo online documentation.

 

back to top previous page next page