Baanboard.com

Go Back   Baanboard.com

User login

Frontpage Sponsor

Main

Baanboard at LinkedIn


Poll
What actions do you take to ensure compliance with the sanction/embargo lists published by the EU and the US?
don't know what you are talking about
55%
we are scanning customers, suppliers and employees using own programs on a regular basis
12%
each delivery/purchase adress is checked immediately with own programs
2%
we are using third party software for this purpose
10%
we simply don't bother
20%
Total votes: 49

Reference Content

 
Java VM integration - Baan Tools 3GL
By patvdv at 26 Feb 2008 - 21:57

Java VM integration - Baan Tools 3GL

Introduction

Starting from BaanERP 5.0c, java programs can be called from within the BaanTools. The Java VM has been integrated within the Baan Virtual Machine (BaanVM, also known as Bshell). This integration is also known as JVMI

Using the JVMI, it is possible to:

  • start Java programs
  • exchange messages (also known as buckets) between Java and BaanERP.

Overview

The JVMI consists of the following parts:

  • Bucket. A bucket consists of a header (type is string) and a body. The body can contain any information you like.
  • Queues (which are maintained within BaanERP). These queues is used to store a bucket. Bucket are stored and retrieved using the FIFO (first in first out) principle.
  • Listeners. Whenever a new message arrives on a queue, the listener of that queue is notified. Zero or one listener can be installed on a queue. A listener can be installed in Java, or in BaanERP! Another advantage is that a listener decides what to do with a particular message. For example, one type of listener could route the message 'as is' to another queue, while another listener could write that same message into the database.
  • Methods to create/remove queues, send/retrieve buckets, and to install/remove listeners.
  • Methods to start a Java program directly. Only static Java methods, with return type void can be called (e.g. public static void startThisMethod())

The following figure shows an example of an application using JVMI:...

In the picture above, BaanERP sends buckets to Java, and Java sends the same buckets back to BaanERP. It is implemented as follows (for more details please read the specific sections of this document):

  • from BaanERP, create two queues (using java.new.queue)
  • on one queue, install a listener at the BaanERP side (using java.install.listener). In the picture above, this listener is called BVM listener.
  • then, install a listener at the Java side by java.execute.static.method.async("java listener class name", "method name", queue_id) This will start a Java program, which will register itself as a listener on the Java queue. In the picture above, this is called the JVM listener.
  • Place a message from BaanERP on the outgoing Java queue (using java.put.bucket)
  • The listener at the Java side is triggered through the onReceive() method (part of the Java listener interface.
  • In this particular case, the message is placed without any modifications on the queue to BaanERP.
  • The listener in BaanERP is triggered. It generates an event (EVT_CHANNEL_EVENT).
  • The BaanERP program script receives the event (through the standard event handling functions), and retrieves the message using java.get.bucket.

3GL functions of the JVMI



0
No votes yet


All times are GMT +2. The time now is 00:52.


©2001-2008 - Baanboard.com - Baanforums.com