• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Any means of searching the network for RMI servers

 
Carl Jokl
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just wanted to check for the sake of completeness whether there is any mechanism built into RMI such that the network can be probed for available running RMI servers. I have not been able to provide evidence of any such functionality so I am not aware of any. My application can already run by explicitly setting the host name of the server manually but though it would be a nice feature to detect the presence of RMI servers or at least servers for this application on the network without having to know the host name. I can achieve this functionality by sending a broadcast datagram packet to the network with the server application(s) listening on that datagram port whereby they can reply to the broadcast packet to say "I am here and I am a server". The problem is I wonder about the implications as the assignment makes it clear that I should not mix and match RMI with socket programming. However in this case the application has no dependency on this mechanism it is just a convenience piece of functionality which would make the application a little easier to configure.

I am also now looking at having a dedicated locking/unlocking thread on the RMI server due to the possibility that if the lock and unlock requests are made via rmi then there is no guarantee that these will run on the same thread. The locks I am using are some of Java's built in lock objects which could well get upset if I tried to unlock the lock from a different thread than the lock was locked with. I know how to do that (I can work some wait/notify magic).

I am at the point that I just want this assignment to be done. I started to work on it in earnest at the start of July with the goal of having it ready to submit by the end of the month. I got most of it done but not ready for submission. The month of August has just been plain crazy so I got little done and now here I am in September still trying to finish of the little bits and pieces. I will be glad to see the back of the assignment albeit I have learned quite a bit.

Another little question about the assignment is when it refers to the possibility of providing on-line help. Would this just be like displaying the user manual in a JEditorPane or is there some kind of help system in Java that I am not aware of. I already have tooltips all over the GUI. I just wondered what the examiners were expecting by "Online Help".
 
Carl Jokl
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Finally got two instances of the GUI client application connecting to the same server and the two are now happily gracefully dealing with the edit locks which the other application has created. This feels like quite an achievement considering the amount of messing around I have had to do to get this to work correctly. The dedicated write lock thread seems to be working perfectly now.

The difficulty has all stemmed from edits as these are not atomic for me. A client application starts editing a record and creates a write lock on that record so that no other clients modify it while it is opened for edit on the client. When the user either saves the changes or discards them the unlock operation is then executed via rmi. As the lock and unlock operations ran on two different rmi calls there is no guarantee that they will both execute on the same thread at the server side. Therefore it was prudent to have a thread dedicated to creating and removing write locks to make sure both operations execute on the same thread. Othewise the server could lock up or throw and exception if the unlock operation happened to run on a different rmi thread.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Carl,

First you are asking guidance about addind some nice extra feature (searching network for RMI server) totally not required. A few lines later you are saying you would be glad to see the back of the assignment (i understand, i had the same thought). So why putting extra effort in features that are not required, it won't give you extra credit at all (the only thing you could get from it, is losing points because it has a flaw) ? That's quiet contradictory: spend your valuable time on the must-requirements and if that's done, you are ready to submit (and few weeks away from becoming a SCJD )

Also the online help system: that's not required at all. Just a plain text file will do too (that's how I did it). If you are planning to get through with this, you could ask Nicolas for some guidance: he implemented a context-sensitive help-system. He had a lot of trouble with accessing his help files in the jar, this thread can be found here.

Kind regards,
Roel
 
Anne Crace
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Roel on the online help. Mine was initially set up as online help, but I too, had issues accessing the html file from the jar. Not worth a potential problem for the examiner, so I did the text file option.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic