Netscape Internet Service Broker for Java: Reference Guide, Version 1.0

[Contents] [Previous] [Next]

Chapter 1
Commands

This chapter covers commands used for creating, executing and managing applications developed with Netscape ISB for Java. It includes the following major sections:

To view a list of options for a command, enter the command name with no option and a list of options appears. For example:

prompt> idl2ir
A list of options appears. For example:

Usage: idl2ir [-options] files...
where options include:
      -ir <name>            The name of the interface repository
      -replace            Replace definitions, instead of updating them

idl2ir

This command allows you to populate an interface repository with objects defined in an Interface Definition Language source file.

Syntax

idl2ir [ options ] infile.idl

Description

The idl2ir command takes an IDL file as input, binds itself to an interface repository server and populates the repository with the IDL constructs contained in infile. If the repository already contains an item with the same name as an item in the IDL file, the old item will not be updated unless you use the -replace option.

NOTE: The idl2ir command does not handle anonymous arrays or sequences properly. To work around this problem, typedefs must be used for all sequences and arrays.

Option Description
-ir name

Specifies the instance name of the interface repository to which idl2ir will attempt to bind. If name is not specified, idl2ir will bind itself to the interface repository server found in the current domain. The current domain is defined by the OSAGENT_PORT environment variable.

-replace

Replaces definitions instead of updating them.

Example

idl2ir -ir my_repository -replace java_examples/bank/Bank.idl

idl2java

This command generates Java source code from an IDL source file.

Syntax

idl2java [ options ] filename.idl

Description

The idl2java command, a Java-based preprocessor, compiles an IDL source file and creates a directory structure containing the Java mappings for the IDL declarations. Typically, one .IDL file will be mapped to many .java files because Java allows only one public interface or class per file. IDL file names must end with the .IDL extension.

Option Description
-no_comments

Suppresses comments in the generated code.

-no_example

Suppresses the generation of example classes.

-no_tie

Suppresses the generation of _tie classes.

-package <name>

Generates code for the specified package. If a directory with the specified package name does not exist, it will be created. If the package directory exists, its contents will be updated.

-portable

Generates portable stubs using DII.

-verbose

Turns verbose mode on.

The supported preprocessor arguments, standard for most preprocessors, are shown in the table that follows. Refer to your preprocessor's documentation to find more information about arguments.

Supported args Description
-C

Retains comments from IDL file when the Java code is generated. Otherwise, the comments will not appear in the Java code.

-D

Defines a macro. Recursive macro definitions are not supported.

-H

Prints the full paths of included files on the standard error output.

-I

Takes a directory as input.

-P

Suppresses the generation of line number information.

-U

Undefines a macro.

Example

idl2java -verbose bank.idl

irep

This command starts an interface repository server.

Syntax

irep [ options ] irep_name [ IDL_storage_file ]

Description

The irep command starts an interface repository server that manages a database containing detailed descriptions of IDL interfaces. The required argument irep_name specifies the instance name of the repository server. The optional argument IDL_storage_file specifies the storage file to use. The repository's database includes interface names, inheritance structure, supported operations, and arguments. The interface repository can consist of multiple databases and may be loaded using the idl2ir command.

Option Description
-console

Runs irep as a console application.

Example

irep -console my_server

java2idl

This command creates an IDL file from a Java class file (in Java byte code). You can enter one or more Java class file names. If you enter more than one filename, include spaces between the file names.

NOTE: To use this command, you must have a virtual machine supporting JDK 1.1.

Syntax

java2idl [ options ] filename

Description

Use this command to create an IDL file from Java byte code stored in one or more .class files represented by filename. You might want to use this when you have existing Java byte code and want to create an IDL file from it so it can be used with some other programming language such as C++, COBOL, or Smalltalk.

Option Description
-verbose

Turns verbose mode on.

Example

The following command compiles class files named Account.class, Client.class, and Server.class.

java2idl Account Client Server

java2iiop

This command (also called the Caffeine compiler) allows you to use the Java language to define IDL interfaces instead of using IDL. You can enter one or more Java class file names (in Java byte code). If you enter more than one file name, include spaces between the file names. Do not include the .class extension. For example, to compile a file named Bank.class, enter:

java2iiop Bank
NOTE: To use this command, you must have a virtual machine supporting JDK 1.1.

Syntax

java2iiop [ options ] filename

Description

Use java2iiop if you have existing Java byte code that you wish to adapt to use distributed objects or if you do not have the time to learn IDL. The filename argument specifies the file or files from which to generate files using IIOP. By using java2iiop, you can generate the necessary container classes, client stubs, and server skeletons from Java byte code.

Option Description
-no_comments

Suppresses comments in generated code.

-no_examples

Suppresses the generation of example code.

-no_tie

Suppresses the generation of tie code.

-portable

Generates portable stubs using DII.

-verbose

Turns verbose mode on.

Example

The following command compiles class files named Account.class, Client.class, and Server.class without generating tie code.

java2iiop -no_tie Account Client Server


[Contents] [Previous] [Next]

Last Updated: 02/04/98 14:19:14


Copyright © 1997 Netscape Communications Corporation

Any sample code included above is provided for your use on an "AS IS" basis, under the Netscape License Agreement - Terms of Use