File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Re-Connect feature on client side. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Re-Connect feature on client side." Watch "Re-Connect feature on client side." New topic
Author

Re-Connect feature on client side.

Abhinav Anand
Ranch Hand

Joined: May 02, 2002
Posts: 113
Hi guys,
In my client implementation, the user starts the client by typing out the host name and port number in the command line arguments. Now suppose after connecting with the server, there was a connection failure. So the reference to remote object now is invalid and cannot be used to interogate the database on server.
So should i provide an option in my client's menu system to reconnect with the server?
In my present implementation the user has to restart the client to reconnect with the server.
Any suggetions...
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Vishal,

So should i provide an option in my client's menu system to reconnect with the server?
In my present implementation the user has to restart the client to reconnect with the server.

I did exactly the same as you. If there were a failure after client initialization, then a restart was necessary. It would be a nice feature to be able to restart the client, but I don't think it is a necessity.
Hope this helps,
Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Tybon Wu
Ranch Hand

Joined: Jun 18, 2002
Posts: 84
In the beta it says your programs must not require use of command line arguments other than the single mode flag... So obviously in networked mode, my client has a connect and disconnect menu items.


SCJP2
Pete Lyons
Ranch Hand

Joined: Aug 18, 2002
Posts: 109
I agree with Michael that a restart is probably just fine with the assessors. However, since my code was already encapsulated into an object that could take a String (hostname) or a File, and create the necessary connections, adding menu items to open a local file or connect (or re-connect) to a server was trivial, so I did it. I would say as long as you don't have duplicated code, you should be OK.
Abhinav Anand
Ranch Hand

Joined: May 02, 2002
Posts: 113
Hi guys,
I have not provided the reconnect feature on the client. Although i can easily reconnect by passing string parameters to the ConnectionFactory but i feel that this part is unnecessary.
Any suggetions...
 
 
subject: Re-Connect feature on client side.
 
Similar Threads
Should lock methods be callable by the client
check if server is online
[URLyBird]What contents in file suncertify.properties ?
java.rmi.ConnectException
Client configuration, please help