Win a copy of Hands On Software Engineering with Python this week in the Jython/Python 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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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: 23963
50
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: 23963
50
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?
 
A timing clock, fuse wire, high explosives and a tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!