JExternal (End-of-Sale)
Dec. 31, 2011
 


Click HERE to know information about JExternal Source Code.
What is JExternal

JExternal is a 4D plug-in to execute Java methods from within 4D. JExternal enables you to use many useful Java libraries in 4D.

JExternal looks for Java files in "JavaClasses" folder and allows Java methods in those files to be used as if they were 4D plug-in methods. Besides JExternal allows the Java methods to callback 4D methods.

Create a "JavaClasses" folder and put Java files whose extensions are ".jar" into it. Java methods in the Jar files can be executed from within 4D.

Java methods called from within 4D are executed in a thread corresponding to a 4D process. If Java methods are called from two processes at the same time, they are executed in parallel.

JExternal requires JWorld, which is another 4D plug-in and distributed with JExternal, in order to launch a Java virtual machine.

The JavaClasses folder may be located in the following folders:

(1) The Contens folder of JExternal_xxx.bundle
(2) The parent folder of the structure file
(3) The parent folder of the application file (4th Dimension or 4D Server)
(4) 4D folder

The JavaClasses folder is searched in above order. Jar files in the JavaClasses folder found first are set to the classpath of Java.

If JExternal is used with 4D Server, the JavaClasses folder in the Contents folder of JExternal_xxx.bundle is automatically downloaded into the clients.


System requirements

The current version of JExternal works with 4th Dimension v11, 4D Server v11, 4th Dimension v12 or 4D Server v12(32-bit).

JExternal requires a Java virtual machine(JVM) to run. The JVM is launched by JWorld which is another 4D plug-in and distributed with JExternal. In Mac OS, Apple's system built-in JVM is launched. In Windows, JWorld's built-in JVM(JRE version 6 Update 18) is launched. In Windows, other JVM can be specified.


Type mapping
JExternal provides 4D with 4 plug-in methods. Following methods will be used mainly:


JEX Call class method
executes a Java class (static) method.
JEX Call object method
executes a Java object (instance) method.


When these methods pass parameters to a Java method or receive results from a Java method, their data types are converted as follows.
4th Dimension
<-->
Java
C_BOOLEAN
<-->
boolean
C_LONGINT
<-->
int
C_REAL
<-->
double
C_TIME
<-->
com.ronri_kobo.Time
C_DATE
<-->
com.ronri_kobo.Date
C_TEXT
<-->
java.lang.String
C_PICTURE
<-->
com.ronri_kobo.Picture
C_BLOB
<-->
byte[]
ARRAY BOOLEAN
<-->
boolean[]
ARRAY INTEGER
<-->
short[]
ARRAY LONGINT
<-->
int[]
ARRAY REAL
<-->
double[]
ARRAY DATE
<-->
com.ronri_kobo.Date[]
ARRAY TEXT
<-->
java.lang.String[]
ARRAY PICTURE
<-->
com.ronri_kobo.Picture[]

Limitation

User interface components cannot be used in Java methods called by JExternal. If you have to communicate with an user in the Java methods, you should callback 4D methods from the Java method.


Documentation


 
Copyright (c) Ronri Kobo, Inc. All rights reserved.
support@ronri-kobo.com