NASA Logo

NTRS

NTRS - NASA Technical Reports Server

Press Enter or click the Search button to begin your search.

Back to Results
Interfacing with Legacy using Remote Method InvocationThe assignment described was enough to make a neophyte Java developer bolt for the door: provide a remote method for use by an applet which invokes a native method that wraps a function in an existing legacy library. The purpose of the remote method is to return an instance of a class object whose contents reflect the data structure returned by the legacy function. While embroiled in implementation, I would have spent the time wading through their JNI use group archive as well, but I couldn't seem to locate one. Subsequently, I made the decision to try to document my findings in order to assist others. Before we start on the class design, let's look at what the existing legacy code does. The C function to be called, Get-Legacy-Data, consists of two steps: an ASII file is read from the local disk and its contents are parsed into a Legacy_Type structure whose address is passed as an argument by the caller. The legacy code was compiled into a shared object library, legacy. so, using the IRIX 6.2 compiler and then loaded onto the Web server, a Silicon Graphics Indy station loaded with the IRIX 6.4 operating system. As far as the class design is concerned, the first thing required is a class to act as a template for the data structure returned by the legacy function. This class, JLegacy, declares a series of public instance variables which correspond to the members of Legacy_Type and provides a parameterless constructor. This constructor is never called, not even by the native method which allocates the object for return to the remote method. Next, the remote interface declaration for the remote object must be defined. In order for JLegacyRO to implement getJLegacy, JLegacyRO must interface with the existing legacy code through a native method, getn. getn is declared in the JLegacyRO class but implemented in C, just like the legacy code. getn returns a JLegacy instance and is declared static since its implementation is the same for all instances of the JLegacyRO class.
Document ID
19980227175
Acquisition Source
Marshall Space Flight Center
Document Type
Preprint (Draft being sent to journal)
Authors
Howard, Scott M.
(Lockheed Martin Corp. Palmdale, CA United States)
Date Acquired
September 6, 2013
Publication Date
November 1, 1998
Subject Category
Computer Programming And Software
Meeting Information
Meeting: Java Developers Journal
Location: Parl River, NV
Country: United States
Start Date: November 1, 1998
Funding Number(s)
CONTRACT_GRANT: NAS8-44000
Distribution Limits
Public
Copyright
Work of the US Gov. Public Use Permitted.
No Preview Available