This chapter describes the different types of output files that are generated after an extension is designed.
About Generating Output Files
Generating Files from the Designer
Generating Source Code Using gmake
Diagram of Extension Components
In Netscape Extension Builder Designer, run the Generate IDL command.
This step is described in Generating Files from the Designer.
From the command line, run the make utility.
This step is described in Generating Source Code Using gmake.
<NEB_ROOTDIR> is the root directory of your Netscape Extension Builder installation, and <myextension> is the name of the extension you designed in Netscape Extension Builder Designer.
When the Generate IDL command finishes, the top-level directory contains the following types of output:
Netscape Application Server Project File and Registration File
An idl directory containing IDL Files
make Harness
Source Code Directory Structure
For example:
A Netscape Application Server registration file assigns a GUID to each service in the extension. This assignment enables an extension to be registered with Netscape Application Server. Every extension has one Netscape Application Server registration file, whose name has the following format:
IDL Files During generation, each module you created in Netscape Extension Builder Designer is stored as a separate IDL file whose name has a .idl suffix. Access modules and service modules are stored in slightly different locations.
<access_module1>.idl
<access_module2>.idl
<service_module1>\<service_module1>.idl
<service_module2>\<service_module2>.idl
<service_module3>\<service_module3>.idl
make Harness A make harness is a set of related makefilesone file per directorywithin a directory tree. Makefiles are named GNUmakefile.sun on Solaris, or GNUmakefile.nt on Windows NT.
Method Stubs
Netscape Extension Builder Runtime Layer
Java Access Layer
Public Interfaces
Accessors
For a C++ extension, method stubs are found in .cpp files in the following directories:
For a Java extension, method stubs are found in .java files in the following directories:
Netscape Extension Builder Runtime Layer Based on the decorations you added in Netscape Extension Builder Designer, some of the generated code implements Netscape Extension Builder runtime features such as template streaming, method locking, and object pooling. This code, collectively known as the Netscape Extension Builder Runtime Layer, resides in directories whose names start with an underscore (_). There is no need to edit any code in these directories.
For a C++ extension, code for the Netscape Extension Builder Runtime Layer is found in .cpp files in the following directories:
For a Java extension, code for the Netscape Extension Builder Runtime Layer is found in .java files in the following directories:
Java Access Layer The Java Access Layer is the set of code that lets Java clients call into a C++ extension. This code is generated only if you set the Java Access Layer decoration to On.
contains Java native methods and Java classes with native method signatures. Both types of files enable Java code to communicate with the C++ implementation of a service module.
The library uses a naming scheme of
Unix libjx2<service_module>.so
Java classes with native method signatures are compiled into .class files located in the directory:
Public Interfaces Public interfaces are what application components use to communicate with an extension. For a C++ extension, public interfaces are .h files found in the following directory:
For a Java extension, public interfaces are found in .java files and their corresponding .class file. The .java files reside in the following directory:
whereas the .class files reside in the following directory:
Accessors Accessors enable application components to access a particular service in an extension. For more information, see Using Extensions From Applications.
For a C++ extension, accessors are global functions. C++ accessor code includes .cpp implementation files, .h header files, and .lib libraries. Accessor implementation files are located in the following directory:
You do not need to modify nor reference the accessor implementation files.
A C++ developer must add #include directives to the C++ code in order to use accessors. Accessor libraries are compiled into an axs<myextension>.lib file located in the following directory:
A C++ developer must link this library when compiling the AppLogic application component.
For a Java extension, accessors are static methods in an accessor class. Java accessor code includes .java files and .class files.
You do not need to modify nor reference accessor .java files.
A Java developer must modify the Java code by importing the package containing the accessor class.
Select the Generate IDL command from the Tools menu.
Enter the name of the top-level directory to contain the output.
On Solaris, you can enter absolute and relative pathnames. However, environment variables and the tilde (~) character are not interpreted, so do not use them.
On Windows NT, you can also open directories and choose them from a directory window, as shown in the following figure:
Solaris gmake -f GNUmakefile.sun
Running gmake performs the following actions:
Invokes the KIDL Compiler, which translates IDL files into source code.
Compiles the source code.
Copies the code to appropriate locations in the Netscape Application Server root directory.
Source Code for a Java Extension
Source Code for a C++ Extension
The Java package hierarchy contains the following subdirectories: