Skip to content
Snippets Groups Projects
Commit 0c7183d6 authored by Arthur Coolen's avatar Arthur Coolen
Browse files

BugID: 604

This was needed for the initial RMI/JNI test for OTB. Can be placed on the
Attic  now.
parent 2d0d96b3
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 1291 deletions
SUBDIRS=src test
include $(top_srcdir)/Makefile.common
#!/bin/sh
../../autoconf_share/bootstrap ../../autoconf_share
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<project name="OTBTest" default="default" basedir=".">
<description>Builds, tests, and runs the project OTBTest.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar-with-manifest: JAR building (if you are using a manifest)
-do-jar-without-manifest: JAR building (if you are not using a manifest)
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="OTBTest-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project>
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
AC_INIT
dnl AC_CONFIG_AUX_DIR(config)
dnl AM_CONFIG_HEADER(config/config.h)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(OTBTest, 1.0, no-define)
dnl Initialize for LOFAR (may set compilers)
lofar_INIT
dnl Checks for programs.
AC_PROG_AWK
AC_PROG_YACC
AC_PROG_CC
AC_PROG_CXX
AM_PROG_LEX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_DISABLE_SHARED
AC_PROG_LIBTOOL
dnl Checks for libraries.
dnl dnl Replace `main' with a function in -lfl:
dnl AC_CHECK_LIB(fl, main)
dnl dnl Replace `main' with a function in -lcosev_r:
dnl AC_CHECK_LIB(cosev_r, main)
dnl dnl Replace `main' with a function in -lcosnm_r:
dnl AC_CHECK_LIB(cosnm_r, main)
dnl dnl Replace `main' with a function in -lorb_r:
dnl AC_CHECK_LIB(orb_r, main)
dnl dnl Replace `main' with a function in -lpthread:
dnl AC_CHECK_LIB(pthread, main)
dnl dnl Replace `main' with a function in -lvport_r:
dnl AC_CHECK_LIB(vport_r, main)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
dnl Checks for library functions.
AC_FUNC_VPRINTF
dnl
dnl Check for LOFAR specific things
dnl
lofar_GENERAL
dnl lofar_BLITZ
dnl lofar_MPI
dnl lofar_PACKAGE(LCS/Common)
dnl
dnl Output Makefiles
dnl
AC_OUTPUT(
src/Makefile
test/Makefile
Makefile
)
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
This diff is collapsed.
build.xml.data.CRC32=52b5b621
build.xml.script.CRC32=7f478078
build.xml.stylesheet.CRC32=ba5d3624
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=52b5b621
nbproject/build-impl.xml.script.CRC32=65051966
nbproject/build-impl.xml.stylesheet.CRC32=1cf0b40c
application.args=
javac.debug=true
javadoc.preview=true
user.properties.file=/home/coolen/.netbeans/4.1/build.properties
application.args=
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
build.dir=build
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/OTBTest.jar
dist.javadoc.dir=${dist.dir}/javadoc
jar.compress=false
javac.classpath=
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.source=${default.javac.source}
javac.target=${default.javac.target}
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
${libs.junit.classpath}
javadoc.author=false
javadoc.encoding=
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
main.class=otb.Main
manifest.file=manifest.mf
platform.active=default_platform
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
# or test-sys-prop.name=value to set system properties for unit tests):
run.jvmargs=
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
src.dir=src
test.src.dir=test
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/1">
<name>OTBTest</name>
<minimum-ant-version>1.6</minimum-ant-version>
</data>
</configuration>
</project>
// \defgroup OTBTest OTB OTB test directory to try out techniques
# if HAVE_SHMEM
# SUBDIRS = shmem .
# endif
INSTHDRS =
NOINSTHDRS =
TCCHDRS =
nobase_pkginclude_HEADERS = $(INSTHDRS) $(TCCHDRS)
noinst_HEADERS = $(NOINSTHDRS)
DOCHDRS = $(INSTHDRS) $(NOINSTHDRS)
lib_LTLIBRARIES = libotb.la
libotb_la_SOURCES =
# AM_YFLAGS = -d -p KeyParse
# AM_LFLAGS = -PKeyTokenize
# LEX_OUTPUT_ROOT = lex.KeyTokenize
# if HAVE_SHMEM
# libotb_la_LIBADD = shmem/libshmem.la
# endif
bin_PROGRAMS =
glishdir = $(libexecdir)/glish
dist_glish_SCRIPTS =
pythondir = $(bindir)
dist_python_SCRIPTS =
scriptdir = $(bindir)
dist_script_SCRIPTS =
include $(top_srcdir)/Makefile.common
package otbtest;
import java.awt.*;
import java.awt.event.*;
/** A listener that you attach to the top-level Frame or JFrame of
* your application, so quitting the frame exits the application.
* 1998-99 Marty Hall, http://www.apl.jhu.edu/~hall/java/
*/
public class ExitListener extends WindowAdapter {
public void windowClosing(WindowEvent event) {
System.exit(0);
}
}
/*
* Main.java
*
* Created on April 26, 2005, 2:07 PM
*/
package otbtest;
/**
*
* @author alex
*/
public class Main {
/** Creates a new instance of Main */
public Main() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
otbgui aGui = new otbgui();
aGui.setSize(800, 400);
aGui.setVisible(true);
}
}
#include <jni.h>
#include "otb_navigatorRMIImpl.h"
JNIEXPORT jobjectArray JNICALL
Java_otb_navigatorRMIImpl_getDBList (JNIEnv *env, jobject obj) {
jobjectArray ret;
int i;
char *DBList[105]= {
"Departments.Administration.Cees_Boon.Salary=\"1500\"",
"Departments.Administration.Cees_Boon.Address=\"Randervoordestraat 6\"",
"Departments.Administration.Cees_Boon.PostalCode=\"7906HM\"",
"Departments.Administration.Cees_Boon.City=\"Hoogeveen\"",
"Departments.Administration.Cees_Boon.WorkPhone=\"0521-595117\"",
"Departments.Administration.Cees_Boon.PrivatePhone=\"0528-268049\"",
"Departments.Administration.Cees_Boon.Email=\"boon@astron.nl\"",
"Departments.Administration.Jaap_van_de_Spreng.Salary=\"1600\"",
"Departments.Administration.Jaap_van_de_Spreng.Address=\"Veenwijksweg 17\"",
"Departments.Administration.Jaap_van_de_Spreng.PostalCode=\"8427RS\"",
"Departments.Administration.Jaap_van_de_Spreng.City=\"Ravenswoud\"",
"Departments.Administration.Jaap_van_de_Spreng.WorkPhone=\"0521-595130\"",
"Departments.Administration.Jaap_van_de_Spreng.PrivatePhone=\"0516-433364\"",
"Departments.Administration.Jaap_van_de_Spreng.Email=\"spreng@astron.nl\"",
"Departments.Administration.Thijs_Zanders.Salary=\"1600\"",
"Departments.Administration.Thijs_Zanders.Address=\"Alexander Dubcekweg 49\"",
"Departments.Administration.Thijs_Zanders.PostalCode=\"9403XB\"",
"Departments.Administration.Thijs_Zanders.City=\"Assen\"",
"Departments.Administration.Thijs_Zanders.WorkPhone=\"0521-595148\"",
"Departments.Administration.Thijs_Zanders.PrivatePhone=\"06-55707136\"",
"Departments.Administration.Thijs_Zanders.Email=\"zanders@astron.nl\"",
"Departments.ICT.Chris_Broekema.Salary=\"2000\"",
"Departments.ICT.Chris_Broekema.Address=\"Aquamarijnstraat 309\"",
"Departments.ICT.Chris_Broekema.PostalCode=\"9743PH\"",
"Departments.ICT.Chris_Broekema.City=\"Groningen\"",
"Departments.ICT.Chris_Broekema.WorkPhone=\"0521-595215\"",
"Departments.ICT.Chris_Broekema.PrivatePhone=\"050-5714258\"",
"Departments.ICT.Chris_Broekema.Email=\"broekema@astron.nl\"",
"Departments.ICT.Arthur_Coolen.Salary=\"1900\"",
"Departments.ICT.Arthur_Coolen.Address=\"Hoofdstraat 78\"",
"Departments.ICT.Arthur_Coolen.PostalCode=\"9635AW\"",
"Departments.ICT.Arthur_Coolen.City=\"Noordbroek\"",
"Departments.ICT.Arthur_Coolen.WorkPhone=\"0521-595292\"",
"Departments.ICT.Arthur_Coolen.PrivatePhone=\"0598-451712\"",
"Departments.ICT.Arthur_Coolen.Email=\"coolen@astron.nl\"",
"Departments.ICT.Ger_van_Diepen.Salary=\"2200\"",
"Departments.ICT.Ger_van_Diepen.Address=\"Moleneinde 25\"",
"Departments.ICT.Ger_van_Diepen.PostalCode=\"7981AM\"",
"Departments.ICT.Ger_van_Diepen.City=\"Diever\"",
"Departments.ICT.Ger_van_Diepen.WorkPhone=\"0521-595241\"",
"Departments.ICT.Ger_van_Diepen.PrivatePhone=\"0521-592729\"",
"Departments.ICT.Ger_van_Diepen.Email=\"diepen@astron.nl\"",
"Departments.ICT.Alex_Gerdes.Salary=\"2100\"",
"Departments.ICT.Alex_Gerdes.Address=\"Westermaten 3\"",
"Departments.ICT.Alex_Gerdes.PostalCode=\"7854TS\"",
"Departments.ICT.Alex_Gerdes.City=\"Aalden\"",
"Departments.ICT.Alex_Gerdes.WorkPhone=\"0521-595272\"",
"Departments.ICT.Alex_Gerdes.PrivatePhone=\"0591-610421\"",
"Departments.ICT.Alex_Gerdes.Email=\"gerdes@astron.nl\"",
"Departments.ICT.Management.Marcel_Loose.Salary=\"2200\"",
"Departments.ICT.Management.Marcel_Loose.Address=\"De Goorn 58\"",
"Departments.ICT.Management.Marcel_Loose.PostalCode=\"7975BT\"",
"Departments.ICT.Management.Marcel_Loose.City=\"Uffelte\"",
"Departments.ICT.Management.Marcel_Loose.WorkPhone=\"0521-595243\"",
"Departments.ICT.Management.Marcel_Loose.PrivatePhone=\"0521-343338\"",
"Departments.ICT.Management.Marcel_Loose.Email=\"loose@astron.nl\"",
"Departments.ICT.Management.Ellen_van_Meijeren.Salary=\"2300\"",
"Departments.ICT.Management.Ellen_van_Meijeren.Address=\"Tiendweg West 2c\"",
"Departments.ICT.Management.Ellen_van_Meijeren.PostalCode=\"2941EP\"",
"Departments.ICT.Management.Ellen_van_Meijeren.City=\"Lekkerkerk\"",
"Departments.ICT.Management.Ellen_van_Meijeren.WorkPhone=\"0521-595265\"",
"Departments.ICT.Management.Ellen_van_Meijeren.PrivatePhone=\"06-29522776\"",
"Departments.ICT.Management.Ellen_van_Meijeren.Email=\"meijeren@astron.nl\"",
"Departments.Technical_Lab.Dion_Kant.Salary=\"2300\"",
"Departments.Technical_Lab.Dion_Kant.Address=\"de Stelling 48\"",
"Departments.Technical_Lab.Dion_Kant.PostalCode=\"8391ME\"",
"Departments.Technical_Lab.Dion_Kant.City=\"Noordwolde\"",
"Departments.Technical_Lab.Dion_Kant.WorkPhone=\"0521-595139\"",
"Departments.Technical_Lab.Dion_Kant.PrivatePhone=\"0561-431826\"",
"Departments.Technical_Lab.Dion_Kant.Email=\"kant@astron.nl\"",
"Departments.Technical_Lab.Gaby_Kroes.Salary=\"2100\"",
"Departments.Technical_Lab.Gaby_Kroes.Address=\"Korenmolen 20\"",
"Departments.Technical_Lab.Gaby_Kroes.PostalCode=\"9203VA\"",
"Departments.Technical_Lab.Gaby_Kroes.City=\"Drachten\"",
"Departments.Technical_Lab.Gaby_Kroes.WorkPhone=\"0521-595176\"",
"Departments.Technical_Lab.Gaby_Kroes.PrivatePhone=\"0512-518729\"",
"Departments.Technical_Lab.Gaby_Kroes.Email=\"kroes@astron.nl\"",
"Departments.Technical_Lab.Jan_Nijboer.Salary=\"1900\"",
"Departments.Technical_Lab.Jan_Nijboer.Address=\"Achterdiep NZ 29\"",
"Departments.Technical_Lab.Jan_Nijboer.PostalCode=\"9611BT\"",
"Departments.Technical_Lab.Jan_Nijboer.City=\"Sappemeer\"",
"Departments.Technical_Lab.Jan_Nijboer.WorkPhone=\"0521-595177\"",
"Departments.Technical_Lab.Jan_Nijboer.PrivatePhone=\"0598-398722\"",
"Departments.Technical_Lab.Jan_Nijboer.Email=\"nijboer@astron.nl\"",
"Departments.System_Management.Jan_Slagter.Salary=\"1800\"",
"Departments.System_Management.Jan_Slagter.Address=\"Bovenboer 18\"",
"Departments.System_Management.Jan_Slagter.PostalCode=\"7924PT\"",
"Departments.System_Management.Jan_Slagter.City=\"Veeningen\"",
"Departments.System_Management.Jan_Slagter.WorkPhone=\"0521-595238\"",
"Departments.System_Management.Jan_Slagter.PrivatePhone=\"0528-391570\"",
"Departments.System_Management.Jan_Slagter.Email=\"slagter@astron.nl\"",
"Departments.System_Management.Klaas_Stuurwold.Salary=\"2100\"",
"Departments.System_Management.Klaas_Stuurwold.Address=\"De Stroom 48\"",
"Departments.System_Management.Klaas_Stuurwold.PostalCode=\"9411MA\"",
"Departments.System_Management.Klaas_Stuurwold.City=\"Beilen\"",
"Departments.System_Management.Klaas_Stuurwold.WorkPhone=\"0521-595231\"",
"Departments.System_Management.Klaas_Stuurwold.PrivatePhone=\"0593-541930\"",
"Departments.System_Management.Klaas_Stuurwold.Email=\"stuurwold@astron.nl\"",
"Departments.System_Management.Management.Roelof_Boesenkool.Salary=\"2500\"",
"Departments.System_Management.Management.Roelof_Boesenkool.Address=\"Elzenhage 15\"",
"Departments.System_Management.Management.Roelof_Boesenkool.PostalCode=\"7943MA\"",
"Departments.System_Management.Management.Roelof_Boesenkool.City=\"Meppel\"",
"Departments.System_Management.Management.Roelof_Boesenkool.WorkPhone=\"0521-5952434\"",
"Departments.System_Management.Management.Roelof_Boesenkool.PrivatePhone=\"0522-244033\"",
"Departments.System_Management.Management.Roelof_Boesenkool.Email=\"boesenkool@astron.nl\""
};
ret= (jobjectArray)env->NewObjectArray(105,
env->FindClass("java/lang/String"),
env->NewStringUTF(""));
for(i=0;i<105;i++) {
env->SetObjectArrayElement(
ret,i,env->NewStringUTF(DBList[i]));
}
return(ret);
}
package otbtest;
import javax.swing.*;
import java.awt.*;
/** A few utilities that simplify using windows in Swing.
* 1998-99 Marty Hall, http://www.apl.jhu.edu/~hall/java/
*/
public class WindowUtilities {
/** Tell system to use native look and feel, as in previous
* releases. Metal (Java) LAF is the default otherwise.
*/
public static void setNativeLookAndFeel() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch(Exception e) {
System.out.println("Error setting native LAF: " + e);
}
}
public static void setJavaLookAndFeel() {
try {
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
} catch(Exception e) {
System.out.println("Error setting Java LAF: " + e);
}
}
public static void setMotifLookAndFeel() {
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
} catch(Exception e) {
System.out.println("Error setting Motif LAF: " + e);
}
}
/** A simplified way to see a JPanel or other Container.
* Pops up a JFrame with specified Container as the content pane.
*/
public static JFrame openInJFrame(Container content,
int width,
int height,
String title,
Color bgColor) {
JFrame frame = new JFrame(title);
frame.setBackground(bgColor);
content.setBackground(bgColor);
frame.setSize(width, height);
frame.setContentPane(content);
frame.addWindowListener(new ExitListener());
frame.setVisible(true);
return(frame);
}
/** Uses Color.white as the background color. */
public static JFrame openInJFrame(Container content,
int width,
int height,
String title) {
return(openInJFrame(content, width, height, title, Color.white));
}
/** Uses Color.white as the background color, and the
* name of the Container's class as the JFrame title.
*/
public static JFrame openInJFrame(Container content,
int width,
int height) {
return(openInJFrame(content, width, height,
content.getClass().getName(),
Color.white));
}
}
/*
* navigatorRMI.java
*
* Created on 7 juni 2005, 15:22
*
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
*/
package otbtest;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.ArrayList;
/**
*
* @author Arthur Coolen
*/
public interface navigatorRMI extends Remote {
ArrayList<String []> getList() throws RemoteException;
}
/*
* navigatorRMIImpl.java
*
* Created on 7 juni 2005, 15:35
*
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
*/
package otbtest;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.ArrayList;
/**
*
* @author Arthur Coolen
*
* What to do to get RMI going.
*
* look at the server ip and port in navigatorRMIImpl.java and otbgui.java and change if you take another server ip
*
* make a subdir otb and place navigatorRMI.jave navigatorRMIServer.java and navigatorRMIImpl.java in it
* go one dir below the otb dir and say javac otb/navigatorRMI.java
* javac otb/navigatorRMIImpl.java
* javac otb/navigatorRMIServer.java
*
* from the same place make the stub by typing rmic otb.navigatorRMIImpl
* this will create a navigatorRMIImpl_Stub.class
*
* ftp navigatorRMI.class navigatorRMIImpl.class navigatorRMIServer.class to the server to an otb subdir
* login to the server and go to the directory and type rmiregistry & this will start the rmi registry
* then start the server with java otb/navigatorRMIServer 10099 &
* 10099 represents the chosen port.
*
* ATTENTION:
*
* Make VERY sure that when you run the server side classes, that you use the same or a newer java version!
* Make also VERY sure that the CLASSPATH is set to the place where your classes reside, ESPECIALLY BEFORE you
* start rmiserver !!!!
*
* */
public class navigatorRMIImpl extends UnicastRemoteObject implements navigatorRMI {
// JNI test with stringarraylist
public native String [] getDBList();
static {
System.loadLibrary("OTDB");
}
private ArrayList<String []> people = new ArrayList<String []>();
/**
* Construct a remote object
* @param msg the message of the remote object, such as "Hello, world!".
* @exception RemoteException if the object handle cannot be constructed.
*/
public navigatorRMIImpl() throws RemoteException {
}
/**
* Implementation of the remotely invocable method.
* @return the found data
* @exception RemoteException if the remote invocation fails.
*/
public ArrayList<String []> getList() throws RemoteException {
return people;
}
public void setList(String [] aStrList) {
for (int j=0; j < aStrList.length;j++) {
// find the last aaa="bbb" combination
String [] aS1 = aStrList[j].split("[=]");
String [] aS2 = aS1[0].split("[.]");
String [] saveString= new String[2];
for (int i=0; i< aS2.length-1;i++) {
if (i>0) {
saveString[0]+="."+aS2[i];
} else {
saveString[0]=aS2[i];
}
}
saveString[1]=aS2[aS2.length-1]+"="+aS1[1];
saveString[0]=saveString[0].replace('_',' ');
saveString[1]=saveString[1].replace('_',' ');
people.add(saveString);
}
}
}
/*
* navigatorRMIServer.java
*
* Created on June 10, 2005, 2:11 PM
*
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
*/
package otbtest;
import java.rmi.Naming;
/**
*
* @author Arthur Coolen
*
* How to build the JNI part (RMI is explained in navigatorRMIImpl.java)
*
* On the server you need to following programs in subdir otb:
* navigatorRMIImpl.java
* navigatorRMIServer.java
* OTDBImpl.cc
*
* from withing otb do the following:
* cd ..
* javac otb/navigatorRMIImpl.java
* javac otb/navigatorRMIServer.java
* javah -jni otb.navigatorRMIImpl this will build: otb_navigatorRMIImpl.h
* mv otb_navigatorRMIImpl.h otb
* cd otb
* g++ -shared -I/opt/jdk1.5.0_03/include -I/opt/jdk1.5.0_03/include/linux \
* OTDBImpl.cc -o libOTDB.so
*
* Then Start the server with :
* cd ..
* java otb.navigatorRMIServer
*
* Requirement is that the rmiregistry 10099 & as explained
* in navigatorRMIImpl.java should be running also
*
*/
public class navigatorRMIServer {
/**
* Server program for the navigator example program
* @param argv The command line arguments which are ignored.
*/
public static void main (String[] argv) {
try {
navigatorRMIImpl aNRI = new navigatorRMIImpl();
Naming.rebind("rmi://10.0.0.154:10099/navigatorRMItje", aNRI);
// Naming.rebind("rmi://dop32.astron.nl:10099/navigatorRMItje", aNRI);
System.out.println ("navigator Server is ready.");
//test the JNI binding
aNRI.setList(aNRI.getDBList());
System.out.println("People should be set now");
} catch (Exception e) {
System.out.println ("navigator Server failed: " + e);
}
}
}
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class otb_navigatorRMIImpl */
#ifndef _Included_otb_navigatorRMIImpl
#define _Included_otb_navigatorRMIImpl
#ifdef __cplusplus
extern "C" {
#endif
#undef otb_navigatorRMIImpl_serialVersionUID
#define otb_navigatorRMIImpl_serialVersionUID -3215090123894869218LL
#undef otb_navigatorRMIImpl_serialVersionUID
#define otb_navigatorRMIImpl_serialVersionUID -4100238210092549637LL
#undef otb_navigatorRMIImpl_serialVersionUID
#define otb_navigatorRMIImpl_serialVersionUID 4974527148936298033LL
/*
* Class: otb_navigatorRMIImpl
* Method: getDBList
* Signature: ()[Ljava/lang/String;
*/
JNIEXPORT jobjectArray JNICALL Java_otb_navigatorRMIImpl_getDBList
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment