Skip to main content
Skip table of contents

Java Development: Callback Service

Using the Java xLib DevKit. you can also develop libraries implementing a Java callback service. The callback operations defined in the Java code are implemented in the Designer service that uses the library.
The development process has two steps

  1. Create the Java implementation with the callback interface.

  2. Import the Java implementation and implement the callbacks in the Designer.

image-20241119-134126.png

In execution, Java callbacks works like the following:

  • On startup of the xUML service, a Java object is created, initialized and started.

  • The Java object triggers callbacks to the xUML service to call xUML operation that hold the implementation.

The sequence diagram below shows the execution process of a Java service callback:

The phases in the sequence diagram match the Java operations to be implemented as listed on Java Implementation for Java Callback (initialize, start, shutdown, and stop). The Run Phase is triggered by the actual callbacks.

JavaLibrary_HTTPServer_Example

Click here to download a simple example model that uses the HTTPServerCallback example from the Java xLib DevKit.

The Java xLib DevKit comes with an example Java implementation of an HTTP server. The Designer example above has the corresponding generated library imported, and shows a possible implementation of the callbacks.
Example case: As the Designer only allows to implement REST APIs and no HTTP APIs, you can e.g. provide one using Java.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.