Solved

What server do I need?!

Posted on 2004-04-05
17
237 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
  • 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JDeveloper 12c for 32 bit 4 84
ArrayIndexOutOfBoundException 9 81
varialbe initialization 11 33
maven module vs maven project 3 23
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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 will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

770 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