Re: Invoke C++ code on server side --- help

Discussion in 'Java' started by Tor Iver Wilhelmsen, Jul 20, 2003.

  1. "pipi" <> writes:

    > I have c++ code on linux server. I want to invoke the C++ code using Java
    > program ( assume I can modify the c++ code).
    >
    > How can I write the Java code?


    The ideal way is to use CORBA, which J2SE supports. You will need some
    CORBA container at the server, and write an IDL with the interface you
    want to present. Create both a client-side Java interface (a stub) and
    a server-side C++ interface (a skeleton) from the IDL, then "plug" the
    C++ implementation to your other code.
     
    Tor Iver Wilhelmsen, Jul 20, 2003
    #1
    1. Advertising

  2. Tor Iver Wilhelmsen

    Roedy Green Guest

    On 20 Jul 2003 21:46:24 +0200, Tor Iver Wilhelmsen
    <> wrote or quoted :

    >
    >The ideal way is to use CORBA, which J2SE supports


    yet another way is to write a C socket implementation you talk to with
    Java.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Jul 20, 2003
    #2
    1. Advertising

  3. Tor Iver Wilhelmsen

    Sudsy Guest

    Tor Iver Wilhelmsen wrote:
    > "pipi" <> writes:

    <snip>

    > The ideal way is to use CORBA, which J2SE supports. You will need some
    > CORBA container at the server, and write an IDL with the interface you
    > want to present. Create both a client-side Java interface (a stub) and
    > a server-side C++ interface (a skeleton) from the IDL, then "plug" the
    > C++ implementation to your other code.


    CORBA could well be overkill in this case. Of course if you've
    got a large, distributed application then it's definitely
    worthy of consideration. If everything resides in one server
    then JNI is far more efficient.
     
    Sudsy, Jul 20, 2003
    #3
  4. Tor Iver Wilhelmsen

    pipi Guest

    but I want to have a client and server application. My java client ( at a
    local machine) will send data to the java server ( at a remote machine), the
    java server than calls the C code. Should I use RMI/JNI?

    wh



    "Sudsy" <> wrote in message
    news:...
    > Tor Iver Wilhelmsen wrote:
    > > "pipi" <> writes:

    > <snip>
    >
    > > The ideal way is to use CORBA, which J2SE supports. You will need some
    > > CORBA container at the server, and write an IDL with the interface you
    > > want to present. Create both a client-side Java interface (a stub) and
    > > a server-side C++ interface (a skeleton) from the IDL, then "plug" the
    > > C++ implementation to your other code.

    >
    > CORBA could well be overkill in this case. Of course if you've
    > got a large, distributed application then it's definitely
    > worthy of consideration. If everything resides in one server
    > then JNI is far more efficient.
    >
     
    pipi, Jul 21, 2003
    #4
  5. Tor Iver Wilhelmsen

    Gopi Bulusu Guest

    "pipi" <> wrote in message news:<bffmo2$1sml$>...
    > but I want to have a client and server application. My java client ( at a
    > local machine) will send data to the java server ( at a remote machine), the
    > java server than calls the C code. Should I use RMI/JNI?


    CORBA is definitely the most portable way of integrating a Java client
    with a C++ server. E-mail me if you want to get a sample showing how
    to integrate Java clients and C++ servers using CORBA (it is quite
    simple).

    Best Regards,
    gopi

    ---

    Gopi Kumar Bulusu
    Sankhya Technologies Private Limited
    http://www.sankhya.com
    Tel: +91 891 554 2666
    Fax: +91 44 2822 7357
     
    Gopi Bulusu, Jul 21, 2003
    #5
  6. pipi wrote:
    > but I want to have a client and server application. My java client ( at a
    > local machine) will send data to the java server ( at a remote machine), the
    > java server than calls the C code. Should I use RMI/JNI?
    >


    In that case, consider middleware. Lots of good stuff out there, very
    portable, fast, and has lots of transaction-related features. Of course, I
    always recommend my own (below).

    --
    ..tom
    remove dashes in email for replies
    opensource middleware at <http://isectd.sourceforge.net>
     
    =?ISO-8859-1?Q?Thomas_Gagn=E9?=, Jul 21, 2003
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page