For deployed EJB modules, EAServer generates IDL for each
home and remote interface (unless you have disabled IDL generation
with the -noidl
deploy option).
To call EJB components from C++ clients, you must
generate C++ header files from the IDL types that
define the component’s home and remote interfaces.
You can find IDL for deployed components in the Repository/idl subdirectory. The IDL files use a folder structure that matches the IDL module structure, which corresponds to the Java package structure. For example, the Java package com.sybase.easerver.tutorials.ejb translates to the IDL module com::sybase::easerver::tutorials::ejb, and translated IDL types for classes in this Java package are in the subdirectory com/sybase/easerver/tutorials/ejb.
Use the idl-compiler tool to generate C++ stubs for each IDL home and remote interface. For example:
%DJC_HOME%\bin\idl-compiler.bat -v com\sybase\easerver\tutorials\ejb\Query.idl -f %DJC_HOME%\include -cpp %DJC_HOME%\bin\idl-compiler.bat -v com\sybase\easerver\tutorials\ejb\QueryHome.idl -f %DJC_HOME%\include -cpp
For more information, see the idl-compiler reference page in Chapter 12, “Command Line Tools,” in the System Administration Guide.
In the case of nested IDL modules, EAServer generates several header files. For example, for the IDL interfaces com::foo::interfaces::MyInterface and com::foo::interfaces::MyHomeInterface, these files are generated:
com.hpp includes com_foo.hpp and headers for other modules nested within module com.
com_foo.hpp includes com_foo_interfaces.hpp and headers for any other nested modules.
com_foo_interfaces.hpp declares the C++ classes for com::foo::interfaces::MyInterface and com::foo::interfaces::MyHomeInterface, as well as any other types declared in module com::foo::interfaces.
In your client program, you must include only those header file that define types or interfaces used by your program. For example, if you use the types com::foo::interfaces::MyInterface and com::foo::interfaces::MyHomeInterface, include the header file com_foo_interfaces.hpp.