1 / 20

Demo CORBA on local machine

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

ena
Download Presentation

Demo CORBA on local machine

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Demo CORBA on local machine

  2. 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.

  3. 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

  4. 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

  5. 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

  6. Hello.java

  7. 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

  8. HelloOperations.java

  9. 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

  10. 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

  11. 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

  12. 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

  13. Writing helloServer.java

  14. 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.

  15. Writing helloClient.java

  16. Compile helloClient.java Run the Java compiler on HelloClient.java: javac HelloClient.java HelloApp\*.java The HelloClient.class is generated to the Hello directory.

  17. 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..

  18. Enter at cmd: start java HelloServer -ORBInitialPort 1050 -ORBInitialHost localhost Running background Running the Hello World Application Start the Hello Server..

  19. Enter at cmd: java HelloClient -ORBInitialPort 1050 –ORBInitialHost localhost Running the Hello World Application Run the Hello Client..

  20. Done!! & Thank you…

More Related