Search |
||
Extending the Grizzly HTTP Runtime part IV: Adding native PHP with support for the Bayeux ProtocolPosted by jfarcand on July 17, 2008 at 12:19 PM PDT
Before I deep dive into the AsyncFilter API I've proposed in part 3, I've decided to show how easy is to add...PHP to your Grizzly based application with support for the Bayeux protocol. In part one, two and three, I have showed how easy is to embed the Grizzly Http Runtime and add JMX and Monitoring support. This time I would like to add PHP to the picture. Yes, PHP! A couple of months ago, my friend Kin-Man blogged about running native PHP using the jsr223 Servlet. The PHP Servlet used in Kin-Man's blog uses jsr223 scripting API and JNI to communicate with a native PHP runtime. That's a really good Servlet to serve directly from Grizzly. How, by just doing the following: That's it. One thing you must make sure is to set the -Djava.library.path to point to your native PHP installation libs directory. Example: will works, assuming you have added the required jars Kin-Man talks about inside the original grizzly-servlet bundle. Now let's add the Comet based Bayeux protocol to the picture. This is also quite simple: That's it! You have now a WebServer that supports PHP and the Bayeux protocol, where some requests are dispatched to PHP, and some to the Bayeux implementation. You can also bridge and push data from your PHP application to the Bayeux runtime using the PHP SAPI and by following Shing Wai's blog on Java API to Bayeux we offer in Grizzly. Coucourouquuiquui! Since it's vacation time, post your questions to users@grizzly.dev.java.net to be sure you get a response :-)
technorati: grizzly web server embedded php »
Related Topics >>
Glassfish Comments
Comments are listed in date ascending order (oldest first)
Submitted by ladybytes on Wed, 2008-08-06 14:46.
Hello
I tried most of the comet example, good and am already implemented cometd with bayeux and dojo.
What we need is a service that distributes data to different applications, not web, ie desktop applications in Java swing, Flash and J2ME applications.
Do not or can not make the connection from my server with these different applications, I do not know if I need a special API, or because there is any implementation for this, for example, Java applications on my desk, reading into the data through a Timer that reads XML files of information. This should eliminate completely and make me read the data immediately envy from my server push.
Well, while waiting for your response and great help, was dismissed from Chile.
Maria Graciela Manquehual
Submitted by jfarcand on Mon, 2008-08-25 15:20.
SalutThe API you are looking at are described [1]. Sorry I was on vacation. next time post your question to users@grizzly.dev.java.net.Thanks!
[1] http://blogs.sun.com/swchan/entry/java_api_for_cometd
|
||
|
|