1. Introduction
RPG Calls Java
AppServer4RPG
Benchmark Example
Inside ArdGate
fast, stable and scalable
RPG to Java calls
Dieter Bender
Dieter Bender Inside ArdGate
2. Introduction
Who is Dieter Bender
RPG Calls Java
Architecture of ArdGate
AppServer4RPG
The Gleiberg Project
Benchmark Example
Who is Dieter Bender
WWW.BENDER-DV.DE
Dieter Bender, 35435 Wettenberg, Germany
AS/400 consultant
Java, SQL, ILE RPG, COBOL
Application integration, Database
Training: Java, SQL, ILE RPG
Open source components
ArdGate: access any database from i with SQL
AppServer4RPG: stable, scalable and fast RPG to Java
integration
some RPG components
Dieter@Bender-DV.de
Dieter Bender Inside ArdGate
3. Introduction
Who is Dieter Bender
RPG Calls Java
Architecture of ArdGate
AppServer4RPG
The Gleiberg Project
Benchmark Example
Architecture
*ARDPGM must
be native
JDBC must be
Java
very few RPG
(blue)
lots of Java (red)
lots of calls from
RPG to Java
multiple users
no controll of
environment
Dieter Bender Inside ArdGate
4. Introduction
Who is Dieter Bender
RPG Calls Java
Architecture of ArdGate
AppServer4RPG
The Gleiberg Project
Benchmark Example
Architecture
*ARDPGM must
be native
JDBC must be
Java
very few RPG
(blue)
lots of Java (red)
lots of calls from
RPG to Java
multiple users
no controll of
environment
Dieter Bender Inside ArdGate
5. Introduction
Who is Dieter Bender
RPG Calls Java
Architecture of ArdGate
AppServer4RPG
The Gleiberg Project
Benchmark Example
Architecture
*ARDPGM must
be native
JDBC must be
Java
very few RPG
(blue)
lots of Java (red)
lots of calls from
RPG to Java
multiple users
no controll of
environment
Dieter Bender Inside ArdGate
6. Introduction
Who is Dieter Bender
RPG Calls Java
Architecture of ArdGate
AppServer4RPG
The Gleiberg Project
Benchmark Example
Architecture
*ARDPGM must
be native
JDBC must be
Java
very few RPG
(blue)
lots of Java (red)
lots of calls from
RPG to Java
multiple users
no controll of
environment
Dieter Bender Inside ArdGate
7. Introduction
Who is Dieter Bender
RPG Calls Java
Architecture of ArdGate
AppServer4RPG
The Gleiberg Project
Benchmark Example
Architecture
*ARDPGM must
be native
JDBC must be
Java
very few RPG
(blue)
lots of Java (red)
lots of calls from
RPG to Java
multiple users
no controll of
environment
Dieter Bender Inside ArdGate
8. Introduction
Who is Dieter Bender
RPG Calls Java
Architecture of ArdGate
AppServer4RPG
The Gleiberg Project
Benchmark Example
Architecture
*ARDPGM must
be native
JDBC must be
Java
very few RPG
(blue)
lots of Java (red)
lots of calls from
RPG to Java
multiple users
no controll of
environment
Dieter Bender Inside ArdGate
9. Introduction
Who is Dieter Bender
RPG Calls Java
Architecture of ArdGate
AppServer4RPG
The Gleiberg Project
Benchmark Example
Architecture
*ARDPGM must
be native
JDBC must be
Java
very few RPG
(blue)
lots of Java (red)
lots of calls from
RPG to Java
multiple users
no controll of
environment
Dieter Bender Inside ArdGate
10. Introduction
Who is Dieter Bender
RPG Calls Java
Architecture of ArdGate
AppServer4RPG
The Gleiberg Project
Benchmark Example
Why Gleiberg Project?
AppServer4RPG
I’m living nearby
open source to
protect copyright
of a Freelancer
result of > 10
years teaching
and project
experience
Dieter Bender Inside ArdGate
11. Introduction
Who is Dieter Bender
RPG Calls Java
Architecture of ArdGate
AppServer4RPG
The Gleiberg Project
Benchmark Example
Why Gleiberg Project?
AppServer4RPG
I’m living nearby
open source to
protect copyright
of a Freelancer
result of > 10
years teaching
and project
experience
Dieter Bender Inside ArdGate
12. Introduction
Who is Dieter Bender
RPG Calls Java
Architecture of ArdGate
AppServer4RPG
The Gleiberg Project
Benchmark Example
Why Gleiberg Project?
AppServer4RPG
I’m living nearby
open source to
protect copyright
of a Freelancer
result of > 10
years teaching
and project
experience
Dieter Bender Inside ArdGate
13. Introduction
Who is Dieter Bender
RPG Calls Java
Architecture of ArdGate
AppServer4RPG
The Gleiberg Project
Benchmark Example
Why Gleiberg Project?
AppServer4RPG
I’m living nearby
open source to
protect copyright
of a Freelancer
result of > 10
years teaching
and project
experience
Dieter Bender Inside ArdGate
14. Introduction
Why is this Important?
RPG Calls Java
Ways to Call Java from RPG
AppServer4RPG
RPGs JNI Support
Benchmark Example
RPG is only a Subset of Java
Java is designed for multithreading
Java has lots of high quality open source components
Java has lots of high quality open source tools RPG doesn’t
have for money
programmer productivity with OO languages is by far higher
(by same level of experience)
some examples:
WebServices and XML
generating PDF, HTML and EXCEL
JDBC access to databases
Dieter Bender Inside ArdGate
15. Introduction
Why is this Important?
RPG Calls Java
Ways to Call Java from RPG
AppServer4RPG
RPGs JNI Support
Benchmark Example
RPG is only a Subset of Java
Java is designed for multithreading
Java has lots of high quality open source components
Java has lots of high quality open source tools RPG doesn’t
have for money
programmer productivity with OO languages is by far higher
(by same level of experience)
some examples:
WebServices and XML
generating PDF, HTML and EXCEL
JDBC access to databases
Dieter Bender Inside ArdGate
16. Introduction
Why is this Important?
RPG Calls Java
Ways to Call Java from RPG
AppServer4RPG
RPGs JNI Support
Benchmark Example
RPG is only a Subset of Java
Java is designed for multithreading
Java has lots of high quality open source components
Java has lots of high quality open source tools RPG doesn’t
have for money
programmer productivity with OO languages is by far higher
(by same level of experience)
some examples:
WebServices and XML
generating PDF, HTML and EXCEL
JDBC access to databases
Dieter Bender Inside ArdGate
17. Introduction
Why is this Important?
RPG Calls Java
Ways to Call Java from RPG
AppServer4RPG
RPGs JNI Support
Benchmark Example
RPG is only a Subset of Java
Java is designed for multithreading
Java has lots of high quality open source components
Java has lots of high quality open source tools RPG doesn’t
have for money
programmer productivity with OO languages is by far higher
(by same level of experience)
some examples:
WebServices and XML
generating PDF, HTML and EXCEL
JDBC access to databases
Dieter Bender Inside ArdGate
18. Introduction
Why is this Important?
RPG Calls Java
Ways to Call Java from RPG
AppServer4RPG
RPGs JNI Support
Benchmark Example
RPG is only a Subset of Java
Java is designed for multithreading
Java has lots of high quality open source components
Java has lots of high quality open source tools RPG doesn’t
have for money
programmer productivity with OO languages is by far higher
(by same level of experience)
some examples:
WebServices and XML
generating PDF, HTML and EXCEL
JDBC access to databases
Dieter Bender Inside ArdGate
19. Introduction
Why is this Important?
RPG Calls Java
Ways to Call Java from RPG
AppServer4RPG
RPGs JNI Support
Benchmark Example
RPG Calls Java
RUNJVA and QSH CMD(java ...)
only Java applications could be called
only error level is coming back
horrible Overhead
Java stored procedures
only static methods could be called
in SQL client mode not scaling
in SQL server mode no controll over JVM properties
JNI Java native interface
was designed for C implementation of JVM and
implementation of the Java tools
cryptic programming and bad maintainability of code
error recovery and analysis is complicated
Dieter Bender Inside ArdGate
20. Introduction
Why is this Important?
RPG Calls Java
Ways to Call Java from RPG
AppServer4RPG
RPGs JNI Support
Benchmark Example
RPG Calls Java
RUNJVA and QSH CMD(java ...)
only Java applications could be called
only error level is coming back
horrible Overhead
Java stored procedures
only static methods could be called
in SQL client mode not scaling
in SQL server mode no controll over JVM properties
JNI Java native interface
was designed for C implementation of JVM and
implementation of the Java tools
cryptic programming and bad maintainability of code
error recovery and analysis is complicated
Dieter Bender Inside ArdGate
21. Introduction
Why is this Important?
RPG Calls Java
Ways to Call Java from RPG
AppServer4RPG
RPGs JNI Support
Benchmark Example
RPG Calls Java
RUNJVA and QSH CMD(java ...)
only Java applications could be called
only error level is coming back
horrible Overhead
Java stored procedures
only static methods could be called
in SQL client mode not scaling
in SQL server mode no controll over JVM properties
JNI Java native interface
was designed for C implementation of JVM and
implementation of the Java tools
cryptic programming and bad maintainability of code
error recovery and analysis is complicated
Dieter Bender Inside ArdGate
22. Introduction
Why is this Important?
RPG Calls Java
Ways to Call Java from RPG
AppServer4RPG
RPGs JNI Support
Benchmark Example
Why I Don’t Like Embedded Java in RPG
controll of the Java environment is near to impossible, because
the JVM is started automatically
using normal Java components produces embedded Java in
RPG
these programms are hard to develop, debug and maintain
first call is very slow and starting hundreds or thousands JVM
makes IBM happy, but doesn’t scale well
the implementation of the JNI support in the RPG compiler is
buggy and crashing JVMs are not recovereable! (BTW: never
saw a crashing JVM outside the JNI support of RPG!!!)
too much programming effort for suboptimal results
Dieter Bender Inside ArdGate
23. Introduction
Why is this Important?
RPG Calls Java
Ways to Call Java from RPG
AppServer4RPG
RPGs JNI Support
Benchmark Example
Why I Don’t Like Embedded Java in RPG
controll of the Java environment is near to impossible, because
the JVM is started automatically
using normal Java components produces embedded Java in
RPG
these programms are hard to develop, debug and maintain
first call is very slow and starting hundreds or thousands JVM
makes IBM happy, but doesn’t scale well
the implementation of the JNI support in the RPG compiler is
buggy and crashing JVMs are not recovereable! (BTW: never
saw a crashing JVM outside the JNI support of RPG!!!)
too much programming effort for suboptimal results
Dieter Bender Inside ArdGate
24. Introduction
Why is this Important?
RPG Calls Java
Ways to Call Java from RPG
AppServer4RPG
RPGs JNI Support
Benchmark Example
Why I Don’t Like Embedded Java in RPG
controll of the Java environment is near to impossible, because
the JVM is started automatically
using normal Java components produces embedded Java in
RPG
these programms are hard to develop, debug and maintain
first call is very slow and starting hundreds or thousands JVM
makes IBM happy, but doesn’t scale well
the implementation of the JNI support in the RPG compiler is
buggy and crashing JVMs are not recovereable! (BTW: never
saw a crashing JVM outside the JNI support of RPG!!!)
too much programming effort for suboptimal results
Dieter Bender Inside ArdGate
25. Introduction
Why is this Important?
RPG Calls Java
Ways to Call Java from RPG
AppServer4RPG
RPGs JNI Support
Benchmark Example
Why I Don’t Like Embedded Java in RPG
controll of the Java environment is near to impossible, because
the JVM is started automatically
using normal Java components produces embedded Java in
RPG
these programms are hard to develop, debug and maintain
first call is very slow and starting hundreds or thousands JVM
makes IBM happy, but doesn’t scale well
the implementation of the JNI support in the RPG compiler is
buggy and crashing JVMs are not recovereable! (BTW: never
saw a crashing JVM outside the JNI support of RPG!!!)
too much programming effort for suboptimal results
Dieter Bender Inside ArdGate
26. Introduction
Why is this Important?
RPG Calls Java
Ways to Call Java from RPG
AppServer4RPG
RPGs JNI Support
Benchmark Example
Why I Don’t Like Embedded Java in RPG
controll of the Java environment is near to impossible, because
the JVM is started automatically
using normal Java components produces embedded Java in
RPG
these programms are hard to develop, debug and maintain
first call is very slow and starting hundreds or thousands JVM
makes IBM happy, but doesn’t scale well
the implementation of the JNI support in the RPG compiler is
buggy and crashing JVMs are not recovereable! (BTW: never
saw a crashing JVM outside the JNI support of RPG!!!)
too much programming effort for suboptimal results
Dieter Bender Inside ArdGate
27. Introduction
Why is this Important?
RPG Calls Java
Ways to Call Java from RPG
AppServer4RPG
RPGs JNI Support
Benchmark Example
Why I Don’t Like Embedded Java in RPG
controll of the Java environment is near to impossible, because
the JVM is started automatically
using normal Java components produces embedded Java in
RPG
these programms are hard to develop, debug and maintain
first call is very slow and starting hundreds or thousands JVM
makes IBM happy, but doesn’t scale well
the implementation of the JNI support in the RPG compiler is
buggy and crashing JVMs are not recovereable! (BTW: never
saw a crashing JVM outside the JNI support of RPG!!!)
too much programming effort for suboptimal results
Dieter Bender Inside ArdGate
28. Introduction
Architecture of AppServer4RPG
RPG Calls Java
The EventHandler Interface
AppServer4RPG
The PORDS2POJO Pattern
Benchmark Example
Architecture Overview
one resident
JVM serves
multiple RPG
clients
asynchronous
communication
extendable
EventHandler
concept
RPG sends and
receives
DataStructure
(translated by
Java)
Dieter Bender Inside ArdGate
29. Introduction
Architecture of AppServer4RPG
RPG Calls Java
The EventHandler Interface
AppServer4RPG
The PORDS2POJO Pattern
Benchmark Example
Architecture Overview
one resident
JVM serves
multiple RPG
clients
asynchronous
communication
extendable
EventHandler
concept
RPG sends and
receives
DataStructure
(translated by
Java)
Dieter Bender Inside ArdGate
30. Introduction
Architecture of AppServer4RPG
RPG Calls Java
The EventHandler Interface
AppServer4RPG
The PORDS2POJO Pattern
Benchmark Example
Architecture Overview
one resident
JVM serves
multiple RPG
clients
asynchronous
communication
extendable
EventHandler
concept
RPG sends and
receives
DataStructure
(translated by
Java)
Dieter Bender Inside ArdGate
31. Introduction
Architecture of AppServer4RPG
RPG Calls Java
The EventHandler Interface
AppServer4RPG
The PORDS2POJO Pattern
Benchmark Example
Architecture Overview
one resident
JVM serves
multiple RPG
clients
asynchronous
communication
extendable
EventHandler
concept
RPG sends and
receives
DataStructure
(translated by
Java)
Dieter Bender Inside ArdGate
32. Introduction
Architecture of AppServer4RPG
RPG Calls Java
The EventHandler Interface
AppServer4RPG
The PORDS2POJO Pattern
Benchmark Example
The RPG Perspective
RPG calls Java
method
read as:
outDS =
ARDPGM(inDS)
Dieter Bender Inside ArdGate
33. Introduction
Architecture of AppServer4RPG
RPG Calls Java
The EventHandler Interface
AppServer4RPG
The PORDS2POJO Pattern
Benchmark Example
The RPG Perspective
RPG calls Java
method
read as:
outDS =
ARDPGM(inDS)
Dieter Bender Inside ArdGate
34. Introduction
Architecture of AppServer4RPG
RPG Calls Java
The EventHandler Interface
AppServer4RPG
The PORDS2POJO Pattern
Benchmark Example
The Java Perspective
Action: what
should be called?
how has the
handler to look
like?
Dieter Bender Inside ArdGate
35. Introduction
Architecture of AppServer4RPG
RPG Calls Java
The EventHandler Interface
AppServer4RPG
The PORDS2POJO Pattern
Benchmark Example
The Java Perspective
Action: what
should be called?
how has the
handler to look
like?
Dieter Bender Inside ArdGate
36. Introduction
Architecture of AppServer4RPG
RPG Calls Java
The EventHandler Interface
AppServer4RPG
The PORDS2POJO Pattern
Benchmark Example
Hybrid Objects
Plain Old RPG
DataStructure
Plain Old Java
Object
Dieter Bender Inside ArdGate
37. Introduction
Architecture of AppServer4RPG
RPG Calls Java
The EventHandler Interface
AppServer4RPG
The PORDS2POJO Pattern
Benchmark Example
Hybrid Objects
Plain Old RPG
DataStructure
Plain Old Java
Object
Dieter Bender Inside ArdGate
38. Introduction
Architecture of AppServer4RPG
RPG Calls Java
The EventHandler Interface
AppServer4RPG
The PORDS2POJO Pattern
Benchmark Example
Translation Objects
PORDS2POJO:= a Java object, encapsulating the
translation between the binary representation of a PORDS and
a POJO
POJO with all components of the PORDS as Java types
object variable to hold the PORDS ( private byte[] huddle )
setter and getter for the binary huddle
this Hybrid objects always reflect the Java and the RPG
perspective of the same data
sometimes only on direction is needed and implemented
Dieter Bender Inside ArdGate
39. Introduction
Architecture of AppServer4RPG
RPG Calls Java
The EventHandler Interface
AppServer4RPG
The PORDS2POJO Pattern
Benchmark Example
Translation Objects
PORDS2POJO:= a Java object, encapsulating the
translation between the binary representation of a PORDS and
a POJO
POJO with all components of the PORDS as Java types
object variable to hold the PORDS ( private byte[] huddle )
setter and getter for the binary huddle
this Hybrid objects always reflect the Java and the RPG
perspective of the same data
sometimes only on direction is needed and implemented
Dieter Bender Inside ArdGate
40. Introduction
Architecture of AppServer4RPG
RPG Calls Java
The EventHandler Interface
AppServer4RPG
The PORDS2POJO Pattern
Benchmark Example
Translation Objects
PORDS2POJO:= a Java object, encapsulating the
translation between the binary representation of a PORDS and
a POJO
POJO with all components of the PORDS as Java types
object variable to hold the PORDS ( private byte[] huddle )
setter and getter for the binary huddle
this Hybrid objects always reflect the Java and the RPG
perspective of the same data
sometimes only on direction is needed and implemented
Dieter Bender Inside ArdGate
41. Introduction
Architecture of AppServer4RPG
RPG Calls Java
The EventHandler Interface
AppServer4RPG
The PORDS2POJO Pattern
Benchmark Example
Translation Objects
PORDS2POJO:= a Java object, encapsulating the
translation between the binary representation of a PORDS and
a POJO
POJO with all components of the PORDS as Java types
object variable to hold the PORDS ( private byte[] huddle )
setter and getter for the binary huddle
this Hybrid objects always reflect the Java and the RPG
perspective of the same data
sometimes only on direction is needed and implemented
Dieter Bender Inside ArdGate
42. Introduction
Architecture of AppServer4RPG
RPG Calls Java
The EventHandler Interface
AppServer4RPG
The PORDS2POJO Pattern
Benchmark Example
Translation Objects
PORDS2POJO:= a Java object, encapsulating the
translation between the binary representation of a PORDS and
a POJO
POJO with all components of the PORDS as Java types
object variable to hold the PORDS ( private byte[] huddle )
setter and getter for the binary huddle
this Hybrid objects always reflect the Java and the RPG
perspective of the same data
sometimes only on direction is needed and implemented
Dieter Bender Inside ArdGate
43. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
A Real Life Example
The idea: RPG application generates a HTML invoice
Java generates from the HTML and a CSS a PDF invoice
the Java Part is done by iText and Flying Saucer
Requirement: 10.000 invoices in 6 h
first customer evaluation: 30 sec. up to minutes for 1!
my first evaluation on Wintel: subsecond!
Dieter Bender Inside ArdGate
44. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
A Real Life Example
The idea: RPG application generates a HTML invoice
Java generates from the HTML and a CSS a PDF invoice
the Java Part is done by iText and Flying Saucer
Requirement: 10.000 invoices in 6 h
first customer evaluation: 30 sec. up to minutes for 1!
my first evaluation on Wintel: subsecond!
Dieter Bender Inside ArdGate
45. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
A Real Life Example
The idea: RPG application generates a HTML invoice
Java generates from the HTML and a CSS a PDF invoice
the Java Part is done by iText and Flying Saucer
Requirement: 10.000 invoices in 6 h
first customer evaluation: 30 sec. up to minutes for 1!
my first evaluation on Wintel: subsecond!
Dieter Bender Inside ArdGate
46. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
A Real Life Example
The idea: RPG application generates a HTML invoice
Java generates from the HTML and a CSS a PDF invoice
the Java Part is done by iText and Flying Saucer
Requirement: 10.000 invoices in 6 h
first customer evaluation: 30 sec. up to minutes for 1!
my first evaluation on Wintel: subsecond!
Dieter Bender Inside ArdGate
47. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
A Real Life Example
The idea: RPG application generates a HTML invoice
Java generates from the HTML and a CSS a PDF invoice
the Java Part is done by iText and Flying Saucer
Requirement: 10.000 invoices in 6 h
first customer evaluation: 30 sec. up to minutes for 1!
my first evaluation on Wintel: subsecond!
Dieter Bender Inside ArdGate
48. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
HTML2PDF4I by Aaron Bartell
Article in IBM Systems Magazine
Open Source at http://mowyourlawn.com
Java Application as a wrapper for iText and Flying Saucer
called by RPG programm via RUNJVA with assembled
classpath setting
my evaluation 10 sec.
opening a Job for each call of RUNJVA and starting a JVM
slow, but scaling linear - JVM is closed after call.
Dieter Bender Inside ArdGate
49. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
HTML2PDF4I by Aaron Bartell
Article in IBM Systems Magazine
Open Source at http://mowyourlawn.com
Java Application as a wrapper for iText and Flying Saucer
called by RPG programm via RUNJVA with assembled
classpath setting
my evaluation 10 sec.
opening a Job for each call of RUNJVA and starting a JVM
slow, but scaling linear - JVM is closed after call.
Dieter Bender Inside ArdGate
50. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
HTML2PDF4I by Aaron Bartell
Article in IBM Systems Magazine
Open Source at http://mowyourlawn.com
Java Application as a wrapper for iText and Flying Saucer
called by RPG programm via RUNJVA with assembled
classpath setting
my evaluation 10 sec.
opening a Job for each call of RUNJVA and starting a JVM
slow, but scaling linear - JVM is closed after call.
Dieter Bender Inside ArdGate
51. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
The Classpath Problem
first problem: you will need 3 jar files in your classpath
starting the JVM at Job begin => a JVM is started, but
maybe not used
starting the JVM before usage => might fail, because started
before
submitting a job for usage => same problem as RUNJVA with
more effort!
setting global classpath => might interfere with other
applications
using extdir => even worse, has higher priority than classpath
setting
Dieter Bender Inside ArdGate
52. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
The Classpath Problem
first problem: you will need 3 jar files in your classpath
starting the JVM at Job begin => a JVM is started, but
maybe not used
starting the JVM before usage => might fail, because started
before
submitting a job for usage => same problem as RUNJVA with
more effort!
setting global classpath => might interfere with other
applications
using extdir => even worse, has higher priority than classpath
setting
Dieter Bender Inside ArdGate
53. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
The Classpath Problem
first problem: you will need 3 jar files in your classpath
starting the JVM at Job begin => a JVM is started, but
maybe not used
starting the JVM before usage => might fail, because started
before
submitting a job for usage => same problem as RUNJVA with
more effort!
setting global classpath => might interfere with other
applications
using extdir => even worse, has higher priority than classpath
setting
Dieter Bender Inside ArdGate
54. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
The Classpath Problem
first problem: you will need 3 jar files in your classpath
starting the JVM at Job begin => a JVM is started, but
maybe not used
starting the JVM before usage => might fail, because started
before
submitting a job for usage => same problem as RUNJVA with
more effort!
setting global classpath => might interfere with other
applications
using extdir => even worse, has higher priority than classpath
setting
Dieter Bender Inside ArdGate
55. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
The Classpath Problem
first problem: you will need 3 jar files in your classpath
starting the JVM at Job begin => a JVM is started, but
maybe not used
starting the JVM before usage => might fail, because started
before
submitting a job for usage => same problem as RUNJVA with
more effort!
setting global classpath => might interfere with other
applications
using extdir => even worse, has higher priority than classpath
setting
Dieter Bender Inside ArdGate
56. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
Why I Gave Up
second problem: for one java statement you need multiple
RPG declarations and statements.
10 minutes programming java <=> one day programming
embedded Java in RPG
third problem: hard to read debug and even worse in
production!
impossible to use log4j
maybe faster for subsequent calls in the same job than
RUNJVA
scalability even worse (the programm could be called in every
Job!)
Dieter Bender Inside ArdGate
57. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
Why I Gave Up
second problem: for one java statement you need multiple
RPG declarations and statements.
10 minutes programming java <=> one day programming
embedded Java in RPG
third problem: hard to read debug and even worse in
production!
impossible to use log4j
maybe faster for subsequent calls in the same job than
RUNJVA
scalability even worse (the programm could be called in every
Job!)
Dieter Bender Inside ArdGate
58. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
Why I Gave Up
second problem: for one java statement you need multiple
RPG declarations and statements.
10 minutes programming java <=> one day programming
embedded Java in RPG
third problem: hard to read debug and even worse in
production!
impossible to use log4j
maybe faster for subsequent calls in the same job than
RUNJVA
scalability even worse (the programm could be called in every
Job!)
Dieter Bender Inside ArdGate
59. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
The RPG Perspective
what we want
install
AppServer4RPG
implement the call
Dieter Bender Inside ArdGate
60. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
The RPG Perspective
what we want
install
AppServer4RPG
implement the call
Dieter Bender Inside ArdGate
61. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
The RPG Perspective
what we want
install
AppServer4RPG
implement the call
Dieter Bender Inside ArdGate
62. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
Closing the Chain to Java
now we need an
EventHandler to be
called
configure
AppServer4RPG
Dieter Bender Inside ArdGate
63. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
Closing the Chain to Java
now we need an
EventHandler to be
called
configure
AppServer4RPG
Dieter Bender Inside ArdGate
64. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
What Happens Now Calling the RPG Programm?
the RPG part puts its input parameters to the request DS and
calls fireEventP
the RPG part of JVAGATE creates a response DTAQ
sends the data (and an identifier for the caller Job) in
packages to the JAVAQ
listens on the responseQ for the answer
Now the Java part of AppServer4RPG does its work (hopefully
it was started)
starts a new worker Thread to be ready for the next request
creates a Handler for the requested Event,
creates Request and Response Objects and calls the
performWork of the Handler
sends the response Data back in packages to the ResponseQ.
known by the identifier passed with the request
Dieter Bender Inside ArdGate
65. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
What Happens Now Calling the RPG Programm?
the RPG part puts its input parameters to the request DS and
calls fireEventP
the RPG part of JVAGATE creates a response DTAQ
sends the data (and an identifier for the caller Job) in
packages to the JAVAQ
listens on the responseQ for the answer
Now the Java part of AppServer4RPG does its work (hopefully
it was started)
starts a new worker Thread to be ready for the next request
creates a Handler for the requested Event,
creates Request and Response Objects and calls the
performWork of the Handler
sends the response Data back in packages to the ResponseQ.
known by the identifier passed with the request
Dieter Bender Inside ArdGate
66. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
What Happens Now Calling the RPG Programm?
the RPG part puts its input parameters to the request DS and
calls fireEventP
the RPG part of JVAGATE creates a response DTAQ
sends the data (and an identifier for the caller Job) in
packages to the JAVAQ
listens on the responseQ for the answer
Now the Java part of AppServer4RPG does its work (hopefully
it was started)
starts a new worker Thread to be ready for the next request
creates a Handler for the requested Event,
creates Request and Response Objects and calls the
performWork of the Handler
sends the response Data back in packages to the ResponseQ.
known by the identifier passed with the request
Dieter Bender Inside ArdGate
67. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
The EventHandler
gets a Request
a simple
PORDS2POJO
binary is set with
Constructor
getter for properties
the EventHandler
Dieter Bender Inside ArdGate
68. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
The EventHandler
gets a Request
a simple
PORDS2POJO
binary is set with
Constructor
getter for properties
the EventHandler
Dieter Bender Inside ArdGate
69. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
The EventHandler
gets a Request
a simple
PORDS2POJO
binary is set with
Constructor
getter for properties
the EventHandler
Dieter Bender Inside ArdGate
70. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
The Results
Transaction Times of subseconds
first call in a Job as fast as following (JVM is prestarted)
very scalable (one JVM serves multiple RPG Jobs)
no Classpath issues, simply throw the needed jar files to the lib
directory of AppServer4RPG
multiple instances of AppServer4RPG could run on the same
box with diffrent JVM settings
AppServer4RPG could be installed on a dedicated server
less programming effort than embedded Java in RPG
flexible logging with log4j simplifies trouble shooting
Dieter Bender Inside ArdGate
71. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
The Results
Transaction Times of subseconds
first call in a Job as fast as following (JVM is prestarted)
very scalable (one JVM serves multiple RPG Jobs)
no Classpath issues, simply throw the needed jar files to the lib
directory of AppServer4RPG
multiple instances of AppServer4RPG could run on the same
box with diffrent JVM settings
AppServer4RPG could be installed on a dedicated server
less programming effort than embedded Java in RPG
flexible logging with log4j simplifies trouble shooting
Dieter Bender Inside ArdGate
72. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
The Results
Transaction Times of subseconds
first call in a Job as fast as following (JVM is prestarted)
very scalable (one JVM serves multiple RPG Jobs)
no Classpath issues, simply throw the needed jar files to the lib
directory of AppServer4RPG
multiple instances of AppServer4RPG could run on the same
box with diffrent JVM settings
AppServer4RPG could be installed on a dedicated server
less programming effort than embedded Java in RPG
flexible logging with log4j simplifies trouble shooting
Dieter Bender Inside ArdGate
73. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
The Results
Transaction Times of subseconds
first call in a Job as fast as following (JVM is prestarted)
very scalable (one JVM serves multiple RPG Jobs)
no Classpath issues, simply throw the needed jar files to the lib
directory of AppServer4RPG
multiple instances of AppServer4RPG could run on the same
box with diffrent JVM settings
AppServer4RPG could be installed on a dedicated server
less programming effort than embedded Java in RPG
flexible logging with log4j simplifies trouble shooting
Dieter Bender Inside ArdGate
74. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
The Results
Transaction Times of subseconds
first call in a Job as fast as following (JVM is prestarted)
very scalable (one JVM serves multiple RPG Jobs)
no Classpath issues, simply throw the needed jar files to the lib
directory of AppServer4RPG
multiple instances of AppServer4RPG could run on the same
box with diffrent JVM settings
AppServer4RPG could be installed on a dedicated server
less programming effort than embedded Java in RPG
flexible logging with log4j simplifies trouble shooting
Dieter Bender Inside ArdGate
75. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
The Results
Transaction Times of subseconds
first call in a Job as fast as following (JVM is prestarted)
very scalable (one JVM serves multiple RPG Jobs)
no Classpath issues, simply throw the needed jar files to the lib
directory of AppServer4RPG
multiple instances of AppServer4RPG could run on the same
box with diffrent JVM settings
AppServer4RPG could be installed on a dedicated server
less programming effort than embedded Java in RPG
flexible logging with log4j simplifies trouble shooting
Dieter Bender Inside ArdGate
76. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
Summary
Don’t try to write Java code in RPG, provide Java methods
with Datastructure parameter interfaces for RPG usage!
Let your Java Code run in a prestarted resident JVM,
communicating asynchronous with your native programms.
Outlook (Nice to have!)
Dynamic PORDS2POJO Beans.
True Tomcat Version of AppServer4RPG.
Dieter Bender Inside ArdGate
77. Introduction Generating PDF from HTML
RPG Calls Java The RUNJVA Way
AppServer4RPG The Embedded Java in RPG Way
Benchmark Example The Gleiberg Version
Questions?
Dieter Bender Inside ArdGate