This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Grokking Bitcoin and have Kalle Rosenbaum on-line!
See this thread for details.
Win a copy of Grokking Bitcoin this week in the Cloud/Virtualization 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
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

Declare a variable value during running Java RMI server  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
own vote
favorite
Hi, I am new in Java RMI and trying to do some learning in different condition. I don't know what I am trying to do is appropriate or not. So far I have developed an RMI application where client gives an input & get the factorial for that. I have 4 class for the application.

Those along with code are following.

Server class - FacServer


Client class - FacClient


Implementation class - FacImpl


Interface class - FacInt

It works fine. Now I want to set some limitation in server side. For example server won't calculate the factorial value for more than 5. I know I can do it in implementation class easily. But I want to declare it when I start the server. For example to set limitation 5 I should start the server in following way.

Java FacServer 5

So if client input a value more than 5 it will get an error reply. Is it possible to do so?

Also can I show the factorial value in server side also if client provide an accepted value?
 
Sheriff
Posts: 24369
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see why not. You'd have to pass the upper bound number into the FacImpl constructor, of course, so FacImpl would know what the upper bound was. And I suppose you'd have to have FacImpl throw an exception of some type if that upper bound was exceeded.
 
Paul Clapham
Sheriff
Posts: 24369
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Shihab Hazari wrote:Also can I show the factorial value in server side also if client provide an accepted value?



I don't understand that question. First of all I don't understand what you mean by "show" in the server side, because servers are normally not designed for people to be watching them. I suppose you could log that value, or something like that. And I don't understand what an "accepted" value is for the client. Is that a value which is not above the upper bound?
 
If you are using a rototiller, you are doing it wrong. Even on this tiny ad:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!