Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to interact with a Live java process from php?

Reply
Thread Tools

How to interact with a Live java process from php?

 
 
Sophia
Guest
Posts: n/a
 
      01-20-2006
Hi,

My question is pretty much what the title describes. My situation is:
The essential task is to provide a service to web user. This service
can only be accessed from a java program on the backend, and this
program, unfortunately, is a 24/7 live process. My teammate is going
to write a php program to handle the front end request, so my question
is that, is it possible for such a design to work? If it is, how?

Any help is greatly appreciated!

Sophia

 
Reply With Quote
 
 
 
 
IchBin
Guest
Posts: n/a
 
      01-20-2006
Sophia wrote:
> Hi,
>
> My question is pretty much what the title describes. My situation is:
> The essential task is to provide a service to web user. This service
> can only be accessed from a java program on the backend, and this
> program, unfortunately, is a 24/7 live process. My teammate is going
> to write a php program to handle the front end request, so my question
> is that, is it possible for such a design to work? If it is, how?
>
> Any help is greatly appreciated!
>
> Sophia
>

Have not done it but here some information. Google for PHP Java.

http://us3.php.net/java
http://php-java-bridge.sourceforge.net/
http://www.phpbuilder.com/manual/ref.java.php
http://www.onlamp.com/pub/a/php/2001/06/14/php_jav.html

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________ ________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
 
Reply With Quote
 
 
 
 
Sophia
Guest
Posts: n/a
 
      01-20-2006
Thanks IchBin,
I understand that there are ways to initiate a java instance from php
program. But I was talking about communicate to a running java
process. Right now, what I can think of is the old way of socket
programming, that is, the java program and the php program send xml
request/reply to each other via unix sockets. Any better ideas?

 
Reply With Quote
 
IchBin
Guest
Posts: n/a
 
      01-20-2006
Sophia wrote:
> Thanks IchBin,
> I understand that there are ways to initiate a java instance from php
> program. But I was talking about communicate to a running java
> process. Right now, what I can think of is the old way of socket
> programming, that is, the java program and the php program send xml
> request/reply to each other via unix sockets. Any better ideas?
>

Sorry, I am not to strong with PHP.

--

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________ ________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
 
Reply With Quote
 
Gordon Beaton
Guest
Posts: n/a
 
      01-20-2006
On 19 Jan 2006 17:13:19 -0800, Sophia wrote:
> I understand that there are ways to initiate a java instance from
> php program. But I was talking about communicate to a running java
> process. Right now, what I can think of is the old way of socket
> programming, that is, the java program and the php program send xml
> request/reply to each other via unix sockets. Any better ideas?


"Old" sockets are a natural choice for communicating with an existing
process. This is especially the case when the two components are
written using different languages or technologies. If you want
alternatives, describe why sockets are not suitable.

/gordon

--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
 
Reply With Quote
 
Dimitri Maziuk
Guest
Posts: n/a
 
      01-20-2006
Sophia sez:
> Thanks IchBin,
> I understand that there are ways to initiate a java instance from php
> program. But I was talking about communicate to a running java
> process. Right now, what I can think of is the old way of socket
> programming, that is, the java program and the php program send xml
> request/reply to each other via unix sockets. Any better ideas?


Depending on what you need to do, sockets, named pipes (fifos),
a php module that talks rmi, php corba module. In the simple case
I'd probably dump xml and use a less bloated exchange format.

Dima
--
The most horrifying thing about Unix is that, no matter how many times you hit
yourself over the head with it, you never quite manage to lose consciousness.
It just goes on and on. -- Patrick Sobalvarro
 
Reply With Quote
 
Sophia
Guest
Posts: n/a
 
      01-20-2006
Hi Gordon,

Sockets are actually one of the things i used most in my school
projects, you are right, they are good for communicating between
different processes/langs. My doubt was that in socket programming,
the programmer pretty much handles everything above tcp/ip layer, in a
real project when reliability is essential, is it safer to use some
established frameworks? Say in my project, if there are 100 users
hitting the php pages at the same time, thus 100 socket connection
requests to my Java or C++ program, what do I need to do to provide a
reliable service?

Sorry if my language is very vague, I am neither an experienced
programmer nor a native English speaker.

 
Reply With Quote
 
Sophia
Guest
Posts: n/a
 
      01-20-2006
Hi Gordon,

Sockets are actually one of the things i used most in my school
projects, you are right, they are good for communicating between
different processes/langs. My doubt was that in socket programming,
the programmer pretty much handles everything above tcp/ip layer, in a
real project when reliability is essential, is it safer to use some
established frameworks? Say in my project, if there are 100 users
hitting the php pages at the same time, thus 100 socket connection
requests to my Java or C++ program, what do I need to do to provide a
reliable service?

Sorry if my language is very vague, I am neither an experienced
programmer nor a native English speaker.

 
Reply With Quote
 
Sophia
Guest
Posts: n/a
 
      01-20-2006
Thanks Dima, I am curious that why you think <xml> is a bloated
exchange format. To me, It looks like of the same class of pure txt
(with some descriptive tags).

 
Reply With Quote
 
Dimitri Maziuk
Guest
Posts: n/a
 
      01-21-2006
Sophia sez:
> Thanks Dima, I am curious that why you think <xml> is a bloated
> exchange format. To me, It looks like of the same class of pure txt
> (with some descriptive tags).


Yeah, if you treat it like "text with a few descriptive tags",
it is that. OTOH, consider a table of numbers, say, ID, value,
error. Depending on how you structure your DTD and name the
tags, e.g.
<id>1</id><val>1.2</val><err>0.005</err>
this is 40 characters total, 10 characters of data per row:
75% overhead. Plus there should be a dtd lurking somewhere.

It really depends on your application, obviously.

Dima
--
Things seemed simpler before we kept computers. -- IX, Revelation
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to download live messenger from windows live hotmail boney Computer Support 0 10-28-2007 12:43 AM
standalone process to interact with the web beginner Python 12 08-02-2007 05:20 PM
how java interact with the Excplicit Cursor? Garg Java 5 03-15-2007 04:36 AM
Re: Springsteen "Live in Barcelona" vs. U2's "Go Home - Live at Slane Castle" dvds Goldfinger DVD Video 2 11-22-2003 02:25 AM
Springsteen "Live in Barcelona" vs. U2's "Go Home Live" dvds Thomas Bell DVD Video 2 11-19-2003 04:52 PM



Advertisments