demo corba on local machine n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Demo CORBA on local machine PowerPoint Presentation
Download Presentation
Demo CORBA on local machine

Loading in 2 Seconds...

play fullscreen
1 / 20

Demo CORBA on local machine - PowerPoint PPT Presentation


  • 163 Views
  • Uploaded on

Demo CORBA on local machine. IDL – to – Java Compiler. Check in folder C:\Program Files\Java\jdk1.6.0_05\bin, measure there has idlj.exe, java.exe, javac.exe and orbd.exe. module HelloApp { interface Hello { string sayHello(); oneway void shutdown(); }; };

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Demo CORBA on local machine' - ena


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
idl to java compiler
IDL – to – Java Compiler

Check in folder C:\Program Files\Java\jdk1.6.0_05\bin, measure there has idlj.exe, java.exe, javac.exe and orbd.exe.

writing hello idl
module HelloApp

{

interface Hello

{

string sayHello();

oneway void shutdown();

};

};

Each interface statement in the IDL will map to a Java interface statement when mapped.

Writing hello.idl
mapping hello idl to java

The tool idlj reads OMG IDL files and creates the required Java files.

Go to a command line prompt.

Change to the directory containing your Hello.idl file.

Enter the compiler command: idlj -fall hello.idl

It will generate a directory called HelloApp and inside it contains six files.

Mapping hello.idl to Java
hello java

Open Hello.java in text editor.

Hello.java is the signature interface and is used as the signature type in method declarations when interfaces of the specified type are used in other interfaces.

IDL statements map to the generated Java statements :

The extends statement showed that all CORBA objects are derived from org.omg.CORBA.Object to require CORBA functionality.

Hello.java
hellooperations java

IDL-to-Java mapping puts all of the operations defined on the IDL interface in the operations interface, HelloOperations.java.

The operations interface is used in the server-side mapping and as a mechanism for providing optimized calls for co-located clients and servers.

The IDL statements map to the generated Java statements the two operations defined in this interface.

HelloOperations.java
hellopoa java

This abstract class is the stream-based server skeleton, providing basic CORBA functionality for the server.

  • It extends org.omg.PortableServer.Servant, and implements the InvokeHandler interface and the HelloOperations interface.
  • The server class, HelloServant, extends HelloPOA.
  • The IDL-to-Java mapping puts all of the operations defined on the IDL interface into this file, which is shared by both the stubs and skeletons.
HelloPOA.java
hellostub java

This class is the client stub, providing CORBA functionality for the client.

It extends org.omg.CORBA.portable.ObjectImpl and implements the Hello.java interface.

_HelloStub.java
hellohelper java

This class provides the narrow() method required to cast CORBA object references to their proper types.

The Helper class is responsible for reading and writing the data type to CORBA streams, and inserting and extracting the data type from Anys.

HelloHelper.java
helloholder java

This final class holds a public instance member of type Hello.

  • Whenever the IDL type is an out or an inout parameter, the Holder class is used.
  • It provides operations for org.omg.CORBA.portable.OutputStream and org.omg.CORBA.portable.InputStream arguments, which CORBA allows, but which do not map easily to Java's semantics.
  • It implements org.omg.CORBA.portable.Streamable.
HelloHolder.java
compile helloserver java
Compile helloServer.java

1. Run the Java compiler on HelloServer.java: javac HelloServer.java HelloApp\*.java

2. The files HelloServer.class and HelloImpl.class are generated in the Hello directory.

compile helloclient java
Compile helloClient.java

Run the Java compiler on HelloClient.java: javac HelloClient.java HelloApp\*.java

The HelloClient.class is generated to the Hello directory.

running the hello world application start orbd

Enter in cmd:

start orbd -ORBInitialPort 1050 -ORBInitialHost localhost

It will generate a folder named orb.db and running on background

Running the Hello World Application Start orbd..
running the hello world application start the hello server

Enter at cmd:

start java HelloServer -ORBInitialPort 1050 -ORBInitialHost localhost

Running background

Running the Hello World Application Start the Hello Server..
running the hello world application run the hello client

Enter at cmd:

java HelloClient -ORBInitialPort 1050 –ORBInitialHost localhost

Running the Hello World Application Run the Hello Client..