Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

RMI UnicastRemoteObject

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello,

When i write my implementing class, that implements the interface, that implements the Remote, i have:



then i have to define a default constructor, that does nothing but defines the RemoteException:

or constructor that does something:


but this means i invoke because of the inheritance the default consttructor of the Unicast...:

Creates and exports a new UnicastRemoteObject object using an anonymous port.


but if i add the following to my constructors:

then because of the inheritance:

Creates and exports a new UnicastRemoteObject object using the particular supplied port.



-In both cases, my program runs well, what is the difference between anonymous port and particular supplied port?
-Should the particular supplied port be the same like this one by the createRegistry (on with the server listens for
incomming connections)?
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Radi,

I didn't extend from UnicastRemoteObject. I just used the exportObject of it with port number 0.

And when I create the registry the port number (chosen by the user) comes into play. So don't think that value has any value (in this assignment).

Kind regards,
Roel
 
Radi Hadzhiyski
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, the UnicastRemoteObject.exportObject(object, port) has the same meaning like
when you extend the UnicastRemoteObject and invoke the constructor with port, but
what this port means, is an enigma for me
Apparently this has nothing to do with the port by the createRegistry thing, because it works
in the both way, but anyway...
 
To get a wish, you need a genie. To get a genie, you need a lamp. To get a lamp, you need a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic