• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Notification (some display window) on a JAVA Web Application through a JAVA desktop application

 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear JavaRanchers,

I have a requirement for my application, Although I have one idea for implementing it, but I am not sure whether it is the right/best approach or is any there are any other ideal approach for it.

**REQUIREMENT**

I have a JAVA desktop application running on one machine and a JAVA Web Application (JSP/Servlets) running on another machine within a network. My requirement is such that the desktop application needs to have some kind of notification on the machine running the web application(i.e. some display window with a simple message on machine running the web application)



**MY IDEA**

To use the RMI technology. When the user logins in the web application a server socket would be opened listnening for requests. The desktop application would then act as a client and invoke operations(which would display a window with a simple message) through RMI.



So could anyone please have a look at it and give thier comments or might be any other approach, as I have really have less knowledge on this matter?

Kind regards,
Hardik Raja
 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about using a HTTP Call as against a RMI Invocation.
You can send a request to a Servlet/JSP etc.. on your web-application too from your java desktop app, and then your servlet/jsp can do whatever it needs to do.
 
Hardik Raja
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear James,

Many thanks for your reply.

How about using a HTTP Call as against a RMI Invocation.



Thats a good idea. I will certainly look into it.

Also referring to my earlier post, I just missed to include a case where in the destination would also be a java desktop application (and not a JAVA Web Application (JSP/Servlets))? Is there any other technique other than RMI for notification (i.e. some display window with a simple message) on the remote machine?

Kind regards,
Hardik Raja
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It might help if you described a bit better what your overall system looks like, and what the real requirement is. There are a lot of important questions that are not answered here. For example, how does the desktop app identify the one particular web client to notify, since potentially there could be many visitors to the web site. Is this supposed to run on the Internet, or on an intranet? What should happen if the desktop client is running, but the web client is not?
 
Hardik Raja
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Ernest Friedman-Hill,

Many thanks for your inputs.

Here's some more information and answers to your questions,

how does the desktop app identify the one particular web client to notify, since potentially there could be many visitors to the web site.



The desktop application has the static IP address of the machine (web client) on which the web application and the RMI Server would be running. Your question also highlighted the point that it wouldn't be possible to achieve the requirement via an HTTP call but would work by using RMI(I guess, but I will create a prototype to test it soon).

Is this supposed to run on the Internet, or on an intranet?



It would be running on an intranet.

What should happen if the desktop client is running, but the web client is not?



The desktop application will receive a failure message, but as the concept is at a very basic stage, we assume that the web client would be working
(all time) when the desktop application sends a notification request.

Kind regards,
Hardik Raja
 
James Ward
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Is there any other technique other than RMI for notification (i.e. some display window with a simple message) on the remote machine



How about sending a message over a ordinary Socket?
The receiving application can listen on Server Socket. This is fairly simple to implement.
 
Hardik Raja
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear James,

James Ward wrote:How about using a HTTP Call as against a RMI Invocation.
You can send a request to a Servlet/JSP etc.. on your web-application too from your java desktop app, and then your servlet/jsp can do whatever it needs to do.



I was thinking about your suggestion, but I have one doubt in my mind,

The HTTP call can be generated from the desktop application to the web server(web application), but how will the web server redirect the result(notification message) to the client browser and also which client in the network
Sorry if there any confusion. See if you can elaborate on this?

Should you have any queries then please do let me know.

Kind regards,
Hardik


 
Hardik Raja
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear JavaRanchers,

In my first post, I had presented one idea for my requirement as below, but after trying I strongly doubt whether it is practically possible

**MY IDEA**

To use the RMI technology. When the user logins in the web application a server socket would be opened listnening for requests. The desktop application would then act as a client and invoke operations(which would display a window with a simple message) through RMI.



Reason: How can the web browser start an rmiregistry on the machine and bind the implementation object, When the user logins in the web application?

Could anyone please provide some input on this?

Kind regards,
Hardik
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yeah it is fine if you use RMI, But if you need high performance then RMI is not a goog choise. Why don't you store data in databse in desktop application. and retrive it on web UI.
 
You’ll find me in my office. I’ll probably be drinking. And reading this tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic