CORBA 2.6 Programmer's Guide for Java
Create the server:
Compile the server skeleton code produced by the IDL compiler, producing class files.●
Create the server main program and object implementation. Code must be written for each method declared in the
IDL interface definition.
●
4.
Start the server program. It uses the NonStop CORBA ORB implementation contained in the NonStop CORBA
jorb.jar file.
5.
Start the client application program. It also uses the NonStop CORBA jorb.jar file. It makes requests of the object
hosted in the server and receives replies.
6.
Tips for Building NonStop CORBA Application Components
Ensure that the $NSD_ROOT/etc/env.sh file was sourced into the OSS shell environment.1.
Run the NonStop CORBA IDL compiler on all your IDL files to produce client stub files and server skeleton files (see
Using the IDL Compiler for more information):
nsdidl -language java *.idl
Note: Do not modify the compiler-generated files.
2.
Write the client program, server program, and object implementation.3.
Compile all the source code files, including generated ones, using javac to produce class files.4.
Makefiles
The NonStop CORBA sample programs use a Makefile to perform the steps involved in building an application. The Makefile
describes the program dependencies in such a way that all you have to do is run the make command to build all the
components of the application. For example, to build the Stock sample application, be sure you are in the directory containing
the copy of the Stock sample, type:
make
This command builds the interface, the server, the implementation, and finally the client.
To see examples of how you might use Makefiles, refer to the sample programs shipped with the NonStop CORBA product.
The source code for all the samples is in the javasamples directory. The directory for each sample contains a file called
Readme, which describes how to build, configure, and execute that sample program.
The sample Makefiles use two files that are shipped with NonStop CORBA, jmacros.mk and jrules.mk, which reside in
the $NSD_ROOT/etc directory. The jmacros.mk file defines macros, and jrules.mk defines dependency rules that are
useful for building any NonStop CORBA application.
The samples vary in complexity and illustrate how to use different NonStop CORBA features, such as the Naming and Event
Services, stateful and stateless objects, application data in a NonStop SQL/MP database, and writing multithreaded
applications.
Note:
The make utility is vital in combining your program modules into a coherent application and enabling you to
maintain individual modules. For detailed information, refer to the Open System Services User's Guide and to the
Make (1) utility reference page either online or in the Open System Services Shell and Utilities Reference Manual.
Special Considerations for Building Transactional Clients and Servers
When building a transactional CORBA application with the Object Transaction Service (OTS), it is necessary to have access to
the CosTransactions::Current interface and a communications stub for the NonStop Transaction Manager (NSotsTM
process). During development you accomplish access by including declarations from the file CosTransactions.idl and