Java application intercomunicates with C++ application


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Java application intercomunicates with C++ application

Hybrid View

  1. #1
    Brian Hoang Guest

    Java application intercomunicates with C++ application


    Hi there,

    Originally, I have two application written in C++ (MFC) that comunicates
    between each others using IP (interprocessing communication) concept.
    I use "shared memory" concept that is known as mapped file in Visual c++.

    I did not use COM for some unconvenient reasons.

    My question is, is it possible to have Java application intercomunicates
    with C++ application using this IP concept? I am wondering if Java supports
    "shared memory" concept?

    Appreciate any helps.

    Brian Hoang

  2. #2
    Kingshuk Guest

    Re: Java application intercomunicates with C++ application


    >
    >My question is, is it possible to have Java application intercomunicates
    >with C++ application using this IP concept?

    Yes and No.
    Using java only you can not.
    However you can develop a shared library(probably DLLs in windows lingo )
    written in C/C++ to provide access to your shared memory segment(s) via
    well defined APIs and then write a thin java wrapper to access your library
    using Java native interface(JNI). So your java program does just provides
    a set of methods to access shared memory and on each method invocation it
    gets delegated to the native library. You can get the JNI spec from http://java.sun.com/products/jdk/1.1...ad-pdf-ps.html
    and a tutorial on how to use JNI from the java tutorial from SUN : http://web2.java.sun.com/docs/books/...1.1/index.html

    I remember reading an article on developing an IPC mechanism for java (similar
    approach as above but with more details) on www.java-pro.com about one and
    half years back. Unfortunately I do not have the url.


    >I am wondering if Java supports
    >"shared memory" concept?

    Java does not support shared memory concepts. You can make two applications
    residing in two different JVMs communicate with each other by using sockets
    or RMI or JMS or CORBA.

    Hope this helps.

    Kingshuk


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center