fassi786
fassi786

Reputation: 31

Java Projects on Django?

ok, So i searched net for the possible implementation but all that I managed to find is Django projects implementation on Java platform through Jython. But I want to do the reverse, i.e. implement/integrate java project ( which in my case is SAIKU server ) on Django platform.

The question being, is it possible, and if yes, then kindly point me to the solution.

Thanking in advance =)

Upvotes: 2

Views: 1664

Answers (2)

Pravin
Pravin

Reputation: 1059

For your specific requirement, I would suggest using RESTFul API to access the Saiku Server.

However if you need to run Java Classes from Python.

Here are the options available for you:

  1. JCC -- a C++ code generator for calling Java from C++/Python. It produces producing Python extensions which communicate via JNI with a Java virtual machine. As it implies, this would require compilations of every possible call. However this project is backbone of PyLucene project.

  2. CodeMesh. C++ code generator for Java.

  3. Py4J Python programs running in a Python interpreter to dynamically access Java objects in a Java Virtual Machine.

  4. JPype allow python programs full access to java class libraries. It is done through interfacing at the native level in both Virtual Machines. However there are no recent development in this front.

    In general, having an loosly coupled integration through REST or RCP would be easy to maintain than tightly coupled JNI based implementation.

Upvotes: 1

Jack Shedd
Jack Shedd

Reputation: 3531

There's no way to run Java within the Python runtime (which is what it sounds like you want). There are Java to Python "translators" available, but they're terrible. Honestly, if you need a Java server and Django to sit inside the same process for some reason, Jython is the way to go.

There are lots of options outside of that though, off the top of my head:

  1. Implement Python bindings for your server (See PyLucene for an example)
  2. Implement a socket server within your Java server that Python can talk to directly

Upvotes: 0

Related Questions