idlj, IDL-to-Java Compiler

In this article we are going to elaborate the idlj command tool which is a part of JAVA commands (comes with jdk package). This article is the continuation of this previous article.

As we know the standard format of commands in java, the idlj command also have the format(in command prompt)
idlj [options] [idl-file]

A IDL file contains identification written in Interface Definition Language.

idlj builds IDL file to JAVA. Previously it was named as idltojava. idlj is a compiler that reads an OMG(Object Management Group) IDL(Interface Definition Language) file and translates / maps to a Java interface. It creates stub, skeleton, helper, holder and other necessary files. The specified pdf formatted OMG  file defines the interface file(.java). The mapping overview is in here.

jdlj Options : 
-d [symbol] : Is same as #define symbol in a idl file.
-emitAll : Emit all types along with files found in #include
-f[side] : Defines bindings to emit. A side can be client, server, serverTIE, all, or allTIE. fserverTIE and -fallTIE cause delegate to be emitted.(-fclient is not specified)
-i [include-path] : To add another directory for scanning with default one.
-keep : To set not to overwrite an existed file.
-noWarn : Set No warning messages.
-oldImplBase : Generates skeletons compatible with pre-1.4 JDK ORBs.(backward-compatibility to  ImplBase Inheritance Model classes)
-pkgPrefix [type] [prefix] : Generates Java package name with prefix for all files generated for that type(type is the simple name of either a top-level module, or an IDL type defined outside of any module)
-pkgTranslate [type] [package] : Replaces type module in the identifier with package for all generated Java package files
Note -pkgPrefix changes are made first. If more than one translation matches an identifier, the longest match is chosen.
-td [dir] : To set dir as output directory
-verbose : Verbose mode(Same as -nowarn)
-skeletonName [xxx%yyy] : Naming pattern for skeleton. The defaults are: %POA for the POA base class (-fserver /-fall), _%ImplBase for the oldImplBase class (-oldImplBase and -fserver /-fall)

-tieName [xxx%yyy] : Naming pattern for tie .The defaults are: %POATie for the POA tie base class (-fserverTie /-fallTie), %_Tie for the oldImplBase tie class (-oldImplBase and -fserverTie /-fallTie)

Notes:
-Escaped identifiers in the global scope may not have the same spelling as IDL primitive types, Object, or ValueBase as the symbol table is pre-loaded with these identifiers
-The fixed IDL type is not supported.
-No import for global identifiers. When we invoke on an unexported local impl,we will get exception, (due to a NullPointerException in the ServerDelegate DSI code)

Uses: When we are using old OMG IDL code to rewriting new java code. Spatially used while converting old codes/definitions. Some time it is used to followup old interface.

Thanks...:)

No comments:

Post a Comment