Processes and filters

Processes (internal, Java)

A process can be a simple process or combined processes with filtering rules, e.g. joelib.process.ProcessPipe.

Process filters

A filter allows you to define processes which are only processed if the filter rule fits. E.g. you can define a filter which checks if an descriptor value exists and a filter which accept all molecules which fits the 'Rule of 5' (By the way, i'm interested in a freely available logP calculation program, let me know if you can offer one).

For a simle example see the external process example: joelib.test.Title2DataTest.

External processes

External processes uses external programs or shared libraries AND are system specific. External processes are derived from processes and have an additional method isThisOSsupported() There are three different possibilities to call external code (if you also consider client/server techniques like CORBA and RMI even more):

  1. Using the Java Native Interface (JNI) to use C/C++ code from shared libraries. This possiblitity is only available for programs with a very good defined programming interface or where the source code is available.

  2. Using the pipe mechanism or standard input/output/error of programs to call external programs where the source code is not available. But the precondition for this mechanism is that the programs support the pipe mechanism (mostly only for linux programs)

  3. The last and not very comfortable method is to use files to exchange data between JOELib and other programs. Fortran programs need this mechanism, even if the source code is available ! If anyone has a good solution for calling Fortran programs from Java i would be very interested !!!

For a simple example see the external process example:

joelib.test.Title2DataTest. This program needs the compiled linux version of lib/linux/title2data.cpp, which can be compiled with g++ title2data.cpp -o title2data

The binary file should be located in joelib/lib/linux/.

The windows version can be generated with the Visual C++ compiler.

Unfortunately there seems to be problems with JDK's pipe mechanism (JDK bug !) under Windows, therefore the example don't work properly under Windows. If you want to use the example anyway you should not use the pipe mechanism. It would be better to write a little JNI wrapper to call external programs.