Home > Back-end >  C program to docking Java API
C program to docking Java API

Time:03-23

Our programs are written in vc6.0 C + + programs, now need docking A agency system, A mechanism only external Java interfaces, our C + + system unable to dock their system, the other party does not provide A C + + interface, can only make A change on our side, docking before A similar institution B, our solution is that your own network protocols and encryption algorithms, but after considering the docking may also C, D, so workload is bigger, what method can more effectively solve the problem?

CodePudding user response:

Don't be A language code is modified to B language code busywork,
Also don't use A language code to directly invoke B language code base, this complicated things so easy to get wrong,
Just make A, B language code of input and output is redirected to A text file, or modify A, B language code let it through text file input and output,
Can easily make A, B coordination between the two languages,
For example:
A will request data written to A file a.t xt, renamed after finish aa. TXT
B find aa. TXT, read its contents, call the corresponding function, and writes the results file b.t xt, after finish delete aa. TXT, changed its name to bb. TXT
Found A bb. TXT, read the content, after finish delete bb. TXT
Above can be replaced by any kind of A language or development environment, B can be replaced by any kind of with the development of A different language or development environment,
Unless A or B does not support to determine whether A file exists, file read and write and file name,
But who can name does not support to determine whether a file exists, file read and write and file name for the development of language or development environment?
Can put the temporary files on the RamDisk efficiency decrease wear disk,
Data structure is very complex, a text file format problems refer to a json or XML

The communication methods between the temporary text file sharing this process there are plenty of advantages, compared to other method only listed below I can think of now:
Loose coupling between process,
Can be on the same machine, process, also can cross machine, across the operating system, hardware platform, and even multinational,
, convenient debugging, and monitoring, only let the third party or artificial view the temporary text files,
Switch, convenient online service, need to delete or create the temporary text files,
, is convenient to realize distributed and load balancing,
Services to provide convenient, queue, queue is full and it is almost impossible to happen (unless the hard disk space full)
DE...

"Across different languages, machine, across the operating system, hardware platform, multinational, cross *. *" misery,
Back is "the use of Shared a plain text file information communication" of the shore!

CodePudding user response:

Is not the same machine two programs, is the other side of the trading system, and our ordering system docking, our order system of external data interaction is written by c + +, the other side of the data interaction system is written by JAVA, our system will dock with the system for the real time, network communication and data interaction,

CodePudding user response:

refer to the second floor liu696639 response:
is not the same machine two programs, is the other side of the trading system, and our ordering system docking, our order system of external data interaction is written by c + +, the other side of the data interaction system is written by JAVA, our system will dock with the system for the real time, network communication and data interaction,

Mapping a network drive?

CodePudding user response:

Through the Socket communication

CodePudding user response:

No problem cannot be solved by adding a middle tier to, if there is then add two,
Similar intermediary, such as, webservice? JNI?

CodePudding user response:

reference 5 floor zhu339111520 reply:
no problem cannot be solved by adding a middle tier to, if there is, then add two
Similar intermediary, such as, webservice? JNI?

Quantum communication?

CodePudding user response:

reference 4 floor XinYaping response:
through the Socket communication


Before we docking A trading system is to use C + + to realize its JAVA interface, write their own network protocol, and the encryption algorithm, we this time again want to dock with the trading system in B, real-time communication, and then C, D and E trading system for docking (some systems have C + + interface, convenient docking, some JAVA is very troublesome), themselves to make the cost is too big, if there A way to directly call API function, the stability of the development efficiency is greatly raised,

CodePudding user response:

reference 5 floor zhu339111520 reply:
no problem cannot be solved by adding a middle tier to, if there is, then add two
Similar intermediary, such as, webservice? JNI?


JNI can realize my needs? I go to study,

CodePudding user response:

The building Lord how to solve
  • Related