Solved

What server do I need?!

Posted on 2004-04-05
17
257 Views
Last Modified: 2010-03-31
Hi everybody,
I have written an client application with Swing interface, that reads and writes some data to MySQL database. Next to this database, on the server side, I need some kind of server that will send some messages to the clients, considering users logged on the client side. I mean when some message is intended for some user, this message to be send only to this user.
So, what kind of server do I need? RMI Server, something like servlet, or something else?
I'm not so familiar with server side technologies, that's way I'm asking you.
In my poor opinion RMI server is the best solution for me. But it will support some kind of multitasking... I suppose?!?! How to do this?
Also, I will appreciate some cool articles, related to my problem.
Thanks in advance!
Best regards,
Valeri
0
Comment
Question by:Valeri
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
  • 3
  • +1
17 Comments
 
LVL 14

Accepted Solution

by:
Tommy Braas earned 200 total points
ID: 10759198
RMI would certainly fit the bill, and so would simple sockets.

RMI: http://java.sun.com/j2se/1.4.2/docs/guide/rmi/

Sockets: http://java.sun.com/docs/books/tutorial/networking/sockets/index.html
0
 
LVL 16

Author Comment

by:Valeri
ID: 10759499
If  I use RMI I don't think that I need sockets?! Except the communication with the client this server must work permanently.... and if it is informed from the database "Send message to this user", the server must send this message immediately. So RMI is the best solution?
Best regards,
Valeri
0
 
LVL 14

Expert Comment

by:Tommy Braas
ID: 10759642
>>  If  I use RMI I don't think that I need sockets?
From your point of view that assumption is correct. Under the covers RMI uses sockets, but that will be of no concern to you.

>> So RMI is the best solution?
RMI will make things a lot easier for you than sockets. RMI also has some nice features that you would be able to use, like naming and lookup.
0
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 
LVL 16

Author Comment

by:Valeri
ID: 10760142
Could you please send me some articles, related to managing different users(clients) in my RMI server. I suppose that I'll have to use threads. Working with threads is very difficult, so I need some code examples. Do you have any clue, where can I find such kind of articles?
Thanks in advance!
Best regards,
Valeri
0
 
LVL 14

Expert Comment

by:Tommy Braas
ID: 10760275
Read the first link I provided, it has everything you need regarding RMI.

Like you stated, threading is difficult. There are many, many articles on the subject. I would recommend that you go to your local bookstore and pick up O'Reilly's books on Java Threads and on RMI.

http://www.onjava.com/ is another great resource, so is http://sys-con.com/java/ and http://java.net/
0
 
LVL 30

Assisted Solution

by:Mayank S
Mayank S earned 50 total points
ID: 10763029
0
 
LVL 4

Expert Comment

by:ShannonE
ID: 10768621
I would suggest using JSP instead of RMI, it should be a lot simpler. When the user logs on through their web browser, the webserver that executes the JSP code presents the user with his/her messages. What exactly is the requirements of your system?? You need to explain more clearly....

Remember: focus on requirements 1st, only then worry about how to implement it.
0
 
LVL 14

Expert Comment

by:Tommy Braas
ID: 10768874
ShannonE, the requirements are that the Swing client needs to communicate with a server to receive messages.

A JSP in this case would not be a solution because a) it's html based and b) it is pull, i.e. the server can't send messages to the clients, the clients have to get the messages.
0
 
LVL 4

Expert Comment

by:ShannonE
ID: 10769729
"the requirements are that the Swing client needs to communicate with a server to receive messages"

That's not a requirement, that's an implementation. A requirement would be something like "a user needs to register for a course, and then recieve notification of acceptance/refusal from the instructor."  In that case I would suggest JSP because it's much easier.  The user could register through the web and check his registration status through the web (eliminating need for messaging) or simply have his status emailed to him.

...Or maybe he would need message based architecture, it would depend on what he really wants to do. that's why I asked for more detail ;)
0
 
LVL 14

Expert Comment

by:Tommy Braas
ID: 10770029
>> That's not a requirement, that's an implementation.
Oh, but it is a requirement. That has been made abundantly clear in the question. That it be Swing might not have been an initial requirement, but is possible. Depends on at which level you look at the requirements doesn't it!?!

>> The user could register through the web and check his registration status through the web (eliminating need for messaging) or simply have his status emailed to him.
I see no mention of this use case anywhere.

However there is a mention of messages being sent to clients, i.e. server-push, not client-pull.
0
 
LVL 16

Author Comment

by:Valeri
ID: 10781039
Hi again :-)
orangehead911 is right! My client is Swing  application. I need a server, that will sent notifications to the clients, and I'm looking for the best technology. RMI, CORBA or something else, I don't know which one is the most appropriate?!?!
The only thing that I know is that I don't need something like JSP's, because I have nothing common with web browser's.
So, for now, RMI is the best solution for me or not? I think "Yes", but is there any other opinions?
Best Regards,
Valeri
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 10781070
I would vote for RMI.
0
 
LVL 16

Author Comment

by:Valeri
ID: 10781077
... and I'm still looking for some good links related to RMI.
How to send message to only one or to group of users. Do I need threads on the server or not?!
If I need threads is there a links with code that explains how to use threads in this case?
Best Regards,
Valeri
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 10781114
I had posted a link for RMI examples above. You can search on the same site for threads. It has loads of examples.
0
 
LVL 14

Expert Comment

by:Tommy Braas
ID: 10781179
I second mayankeagle's vote.

There are several links in this thread, plenty to start with. You could also do a search on Google: http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=java+rmi+tutorial&btnG=Google+Search

Good luck!
0
 
LVL 4

Expert Comment

by:ShannonE
ID: 10783587
Valeri, if your application is going to be complex, then JMS (Java Message Service) might be a better option. You can think of it as another abstraction above RMI, in other words it'll be harder to get JMS to work, but once its working it'll be easier to develop applications.

http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html

(See Chapter 33 & 34 on JMS in above tutorial)
0
 
LVL 14

Expert Comment

by:Tommy Braas
ID: 10784459
The downsides to using JMS in this case, is that an additional jar would have to be added to the client application and the server would have to be running a J2EE app server with JMS support. However, it is certainly an option.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question