Conversion from idltojava to idlj ...

John Shott shott at snf.stanford.edu
Fri Nov 24 12:36:30 PST 2000


Bill and Mike:

I'm in the process of trying to convert from idltojava to idlj as there is
enough time to think ...

To do this, I've made a copy of ~bmurray/labnet in ~shott/labnet1.3 ... in
other words, ~shott/labnet1.3/labnet is the top directory in my experimental
source tree.  Note: I know that you have a bunch of stuff that isn't checked
in, Bill, so I have all of that in my source tree. As you'll see, I've made a
number of changes to a variety of files ... but I'm guessing that they are
largely non-overlapping and non-conflicting.  My initial thought is that we
wait to check in your files normally when you are happy with them and then,
once we think that the idlj stuff is OK, we check-in the changes that I've
made. (Of course, that would require manually updating my files with any
changes that you make from here on out ...).

So, I'm going to try to keep a running log of what I've done:

1. I've made significant changes to labnet/etc/Makefile (specifically to the
stuff that converts idl into java. The most significant change is that the old
idltojava allowed one to define a package that everything was a part of (and
we used that flag to define everything as a part of the package labnet.idl so
that things in package Auth actually became labnet.idl.Auth.*.  However, the
file stuff in Base.idl doesn't really define a package ... but the old -p flag
made Timestamp, labnet.idl.Timestamp, etc.

idlj doesn't have the -p (package flag) ... it has the -pkgPrefix flag. This
works for the things that are apart of a package such as Auth ... we could
define a "-pkgPrefix Auth labnet.idl" that makes everything in Auth a member
of labnet.idl.Auth.*.  However, all of the stuff in Base.idl gets "lost"
because it isn't part of a package.  To get around this, I modified each of
the *.idl files so that they look like:
module labnet {
	module idl {
		Original idl file goes here ...
	}; // End of idl module
}; // End of labnet module
Actually, I put the "module labnet {" beyond any "#include" stuff because each
of the included files (either Base.idl or Admin.idl) already have been defined
to be a part of the labnet.idl package ...

In that way, even though it is a bit brute forceish, everything seems to
compile OK.  Well, actaully, in Resource.idl, there were three forward
declarations of interfaces that whose definition was commented out:
ConfigurationManager, RulesManager, and DesktopManager.  idlj apparently
doesn't allow any forward declarations that are undefined ... so I simply
commented out these three forward declarations.

So, the Makefile changes now allow things to compile without any errors and
without any warnings about deprecated methods ...

Oh yes, it does complain about the use of the "Factory" interface .... I
changed that to the Laboratory interface and also changed places in the entire
source tree (there were only a handful) that make a reference to Factory or
getFactory and changed them to Laboratory and getLaboratory, respectively
(except, there is something called ticketFactory that I didn't change ...)

2. Now I began to look at the differences in the *.java files that are
generated.  As near as I can tell, an interface named "Interface" used to
generate 7 *.java files and now generates 6.
Four of them appear quite similar:
	Interface.java
	InterfaceHelper.java
	InterfaceHolder.java
	_InferfaceStub.java

The old _InterfaceOperations.java has become InterfaceOperations.java
and the old _InterfaceTie.java and _InterfaceImplBase.java appear to have been
combined into a single file called: Interface_Tie.java.

3. So, the next step is to see if I can get things running by mechanically
changing occurrences of _InterfaceOperations to InterfaceOperations and
_InterfaceTie to Interface_Tie.  To find these occurences, I went to
~shott/labnet1.3/labnet and issued the command:
	gitrgrep _[A-Z][a-zA-Z]*Tie '*.java' > Tie.txt
	gitrgrep _[A-Z][a-zA-Z]*Operations '*.java' > Operations.txt

It appears as if there are only about 15-20 occurrences of each. For example,
most of the managers such as AccountingManagerImpl.java have a line that
reads:
implements labnet.idl.Accounting._AccountingManagerOperations {

Similarly, Accounting Server.java has a line that reads:
this.mgr = new _AccountingManagerTie(this.impl)

So, I figured I would see what happens when I simply change
_InterfaceOperations to InterfaceOperations and _InterfaceTie to Interface_Tie
in these files.

4. In order to compile this stuff, it appears as if I need an installed
idl.jar file in /home/labnet/lib ... to do that, I made a copy of the original
idl.jar file and called it idl.jar and then "make install idl".

5. Doing a "make distclean" in labnet/idl and then a "make distclean" in
labnet (all in ~shott/labnet1.3) ... in general seemed to be doing most things
and compiling OK.  There were a series of errors related to calling
AthMgr.authenticate(name, password) ... it looks as if Bill has changed the
idl recently to do authenticate(name) and remoteAuth(name, password).

So, at this point, I'm probably going to put things on hold until Bill gets
back ... because I'm about to get out of my depth.

However, in summary, I've got a duplicate version of what Bill has in
~bmurray/labnet stored in ~shott/labnet1.3/labnet that is, I think, close to
working with the new idlj compiler ...

That's it for now ...

Thanks,

John

p.s. I've moved /home/labnet/lib/idl.jar.orig back as /home/labnet/lib/idl.jar
and moved the new one to /home/labnet/lib/idl.jar.idlj



More information about the coral mailing list