You use EAServer Manager to generate the C++ files that you need to compile into a DLL or UNIX shared library as well as a class implementation template in which to write method logic. These C++ files include:
Method skeletons file – Contains method routines that read the parameters from the network and call the method. The method skeletons also send the return status and output parameter data back to the client.
Class header file – Contains the method declarations only. This file is an included file in the method skeletons file and the class implementation template.
Class implementation template – Contains the class, method, and parameter declarations, as well as empty method definitions. You enter any business logic into the empty method definitions.
Stub interface files – Contain the interface definition for all components in a package, as well as definitions for user-defined types and exceptions used in your component’s interface. EAServer Manager creates these files when you generate C++ stubs for your component.
UNIX makefile – You use a makefile to compile the C++ source files into a UNIX shared library.
Windows makefile and Microsoft Visual C++ module definition file – You use the makefile and a module definition file to compile the C++ source files into a DLL.
“Method call to a C++ component DLL or UNIX shared library” shows the flow of a client method call to a C++ component DLL or UNIX shared library.
The client invokes a method using the proxy or stub appropriate to the type of client. The stub or proxy sends the invocation information over the network to the server.
The method skeleton in the method skeletons file unmarshals the call and makes a call to the method implementation in the class implementation template.
After the method executes, the method implementation returns the call to the method skeleton.
The method skeleton marshals the call and sends the call to the client.
The following figure shows the flow of a client method call to a C++ component DLL or UNIX shared library.
Figure 14-1: How C++ component methods are called
Generating required C++ files in EAServer Manager
To generate the required C++ files from a package or component, start EAServer Manager and:
Select the component or, if you want to generate files for all components in a package, select the package.
Select File | Generate Stub/Skeleton. The Generate Stubs & Skeletons Wizard displays. Follow the instructions on each page to generates C++ stubs and skeletons. See the online help for descriptions of any input fields that you do not understand.
EAServer Manager generates the following files:
File type |
File name |
---|---|
method skeletons file |
package-name_component-name.cpp |
class header file |
class-name.hpp.new |
class implementation template |
class-name.cpp.new |
stub interface file |
package-name.hpp |
where:
component-name is the name of the component that you defined in EAServer Manager.
class-name is the class name that you specified when you created the component.
EAServer Manager creates the directory structure based on the code base that you specify and the component name, as follows:
code_base/package_name/component_name
where:
code_base is the directory name in the Code Base field in EAServer Manager. If the Code Base field does not contain a full path name, the directory will be located under the EAServer installation directory, relative to the html/classes subdirectory.
package-name is the name of the package that contains the component.
component_name is the component name as displayed in EAServer Manager.
When you add or delete methods or modify component method prototypes, you must regenerate the method skeletons and class header files. You must manually add, delete, or modify the methods in the class implementation template. Before you regenerate the method skeletons and class header files, make sure that you have moved your modified class implementation template to another directory or renamed it so the generated class implementation template does not overwrite your existing class implementation template.
Copyright © 2005. Sybase Inc. All rights reserved. |