JacORB free TangORB

Hi All,

As were discussed at 30th Tango meeting we need to step forward and package Tango related Java tools into debian repository. For this a version of Tango Java API without JacORB classes is required due to the licensing issues.

Here I share the result of my experiment on this topic:

Source code

Binaries can be found in my bintray maven repo: https://bintray.com/ingvord/maven

Current status: jacORB classes are replaced with Oracle's implementation (part of JDK)

Current issues: no time out policy
client code may require to reimplement exceptions parsing logic

There is a Jive version that uses this library:

Source code

Binaries: download jar

This Jive version is also available in the latest (v92 rc1) Tango Virtual Box.

Suggested next steps: include Jive into experimental branch of the binary repositories (debian, redhat etc). Recompile other tools (ATKPanel, JDraw what else?) and put them into experimental as well.
Edited 7 years ago
Concerning the timeout policy.

JacORB_free JavaAPI source code has a server and a client projects. The server is extremely simple - it has only one attribute and a command - timeout - and simply answers after 15 seconds. Client connects to the server and executes the command.

Interesting enough that there is no timeout exception at all:


/usr/lib/jvm/java-8-openjdk-amd64/bin/java …
>>>>>>>>>>> Oracle's ORBObject does not support custom timeouts!!!
1467123545446
>>>>>>>>>>> Oracle's ORBObject does not support custom timeouts!!!
1467123560470

Process finished with exit code 0

Client simply waits till command finishes its execution.

I wonder how long it can wait (150 000 also passes)?!

Exploring the source code I have found the following:

Oracle's CORBA implementation uses ReadTCPTimeoutsImpl class as a storage for TCP related timeouts:


public class ReadTCPTimeoutsImpl implements ReadTimeouts
{
    private int initial_time_to_wait;
    private int max_time_to_wait;
    private int max_giop_header_time_to_wait;
    private double backoff_factor;


This class is created from special properties that can be passed to ORB during initialization. See this Oracle's forum thread, for instance.

These timeout values are then used in MessageBase class to specify timeout for reading from connection (socket or channel):


//MessageBase.java

public static Message readGIOPBody(ORB orb,
                                       CorbaConnection connection,
                                       Message msg)
    {
        ReadTimeouts readTimeouts =
                           orb.getORBData().getTransportTCPReadTimeouts();
        ByteBuffer buf = msg.getByteBuffer();

        buf.position(MessageBase.GIOPMessageHeaderLength);
        int msgSizeMinusHeader =
            msg.getSize() - MessageBase.GIOPMessageHeaderLength;
        try {
            buf = connection.read(buf,
                          GIOPMessageHeaderLength, msgSizeMinusHeader,
                          readTimeouts.get_max_time_to_wait()); //HERE!!!
        } catch (IOException e) {
            throw wrapper.ioexceptionWhenReadingConnection(e);
        }

No timeout exception even though default value is 3000 millis. Overriding these values via reflection does not give any effect :( Maybe I have missed something.

Theoretically it is easy to implement our own timeout mechanism, e.g. start a thread that waits for a specified period of time and then closes the connection.

Any help will be appreciated.
Edited 7 years ago
Hi,

I have added JacORB free Jive to my bintray's deb repo.

To install the Jive do the following

    Update sources.list:
    echo "deb https://dl.bintray.com/ingvord/deb /" | sudo tee -a /etc/apt/sources.list
    sudo apt-get update; sudo apt-get install jive
    Jive

Here is corresponding pom.xml configuration section:

<plugin>
                <groupId>org.vafer</groupId>
                <artifactId>jdeb</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jdeb</goal>
                        </goals>
                        <configuration>
                            <dataSet>
                                <data>
                                    <src>${project.build.directory}/${project.build.finalName}.jar</src>
                                    <type>file</type>
                                    <mapper>
                                        <type>perm</type>
                                        <prefix>/usr/share/lib</prefix>
                                    </mapper>
                                </data>
                                <data>
                                    <src>${project.basedir}/src/bash/Jive</src>
                                    <type>file</type>
                                    <mapper>
                                        <type>perm</type>
                                        <filemode>755</filemode>
                                        <prefix>/usr/bin</prefix>
                                    </mapper>
                                </data>
                            </dataSet>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.5.0</version>
                <executions>
                    <execution>
                        <phase>deploy</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <executable>curl</executable>
                    <!– optional –>
                    <workingDirectory>${project.build.directory}</workingDirectory>
                    <arguments>
                        <argument>-T</argument>
                        <!– TODO change version –>
                        <argument>Jive_6.8.jacorb+free+0.2_all.deb</argument>
                        <argument>-uingvord:${bintray.ingvord.apikey}</argument>
                        <argument>https://api.bintray.com/content/ingvord/deb/Jive/6.8.jacorb+free+0.2/pool/main/j/jive/Jive_6.8.jacorb+free+0.2_all.deb</argument>
                    </arguments>
                </configuration>
            </plugin>

BTW this is a nice receipt on how to automatically package Tango Java Devices/Tools to a deb repo.
Edited 7 years ago
 
Register or login to create to post a reply.