Assignment 1 – Introduction to Java RMI
Assignment 1 – Introduction to Java RMI
项目类别:计算机
Hello, dear friend, you can consult us at any time if you have any questions, add  WeChat:  zz-x2580

Assignment Description

Objective

To gain an understanding of how remote method invocation in Java works, synchronisation, and to
develop a working example of a Java RMI system. This will be essential in developing future
applications as you will quickly learn all of the pitfalls inherent in developing standards-based clients
and multi-threaded servers.

To gain an understanding of how a distributed system works, this first assignment phase involves
developing a simple Java RMI application. This will involve developing both the client and server side
of a distributed application: a simple sorting server.

The sorting server operates a stack and clients push values and operations on to the stack. While,
usually, each client should have its own stack, you may use a single stack on the server. You may
also assume that operations are always sensible: that is, we will only push an operator after pushing
at least on value and we will only pop when there is a value on the stack. You may also assume that
the operator provided will only be one of the four displayed types and that the values are always
integers.

Following the directions discussed in lectures, you should create a Java RMI Server that supports the
following remote methods:

void pushValue(int val);

This method will take val and push it on to the top of the stack.

void pushOperator(String operator);

This method will push a String containing an operator (“ascending”, “descending”, “max”, “min”) to
the stack, which will cause the server to pop all the values on the stack and: i) for ascending
operation – push all the popped values in the descending order; ii) for descending – push all the
popped values in ascending order; iii) for max – push the max value; and iv) for min – push the min
value of all the popped values.

int pop();

This method will pop the top of the stack and return it to the client.
boolean isEmpty();

This method will return true if the stack is empty, false otherwise.
int delayPop(int millis);

This method will wait millis milliseconds before carrying out the pop operation as above.

留学ICU™️ 留学生辅助指导品牌
在线客服 7*24 全天为您提供咨询服务
咨询电话(全球): +86 17530857517
客服QQ:2405269519
微信咨询:zz-x2580
关于我们
微信订阅号
© 2012-2021 ABC网站 站点地图:Google Sitemap | 服务条款 | 隐私政策
提示:ABC网站所开展服务及提供的文稿基于客户所提供资料,客户可用于研究目的等方面,本机构不鼓励、不提倡任何学术欺诈行为。