Skip to content

Commit

Permalink
rename, update
Browse files Browse the repository at this point in the history
  • Loading branch information
yennanliu committed Sep 12, 2021
1 parent d0e54c8 commit 06f1caa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,9 @@
- [Observer1](./src/main/scala/ScalaBasic/Observer1)
- Proxy
- [ProxyDesignPattern1](./src/main/scala/ScalaBasic/ProxyDesignPattern1)
- [ProxyDesignPattern2](./src/main/scala/ScalaBasic/ProxyDesignPattern2) : Remote Proxy -- RMI demo
- [ProxyDesignPattern2](./src/main/scala/ScalaBasic/ProxyDesignPattern2) : Remote Proxy -- RMI demo (remote method invocation)
- [remote-method-invocation-in-java](https://www.geeksforgeeks.org/remote-method-invocation-in-java/)
- RMI : via OOP, doing remote call (method)

12. Scala Script example
- [DirectoryOP](./src/main/scala/ScalaBasic/DirectoryOP.scala) - Scala `Directory OP` example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import java.rmi.Naming

/**
* Note :
* plz run the server first (MyRemoteImplement), so the client can get result from service via RMI call
* plz run the server first (MyRemoteServer), so the client can get result from service via RMI call
*/

class MyRemoteClient{
Expand All @@ -20,6 +20,12 @@ class MyRemoteClient{
// entry point
object MyRemoteClient {
def main(args: Array[String]): Unit = {

new MyRemoteClient().go()

// for (i <- 1 to 5){
// new MyRemoteClient().go()
// }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ import java.rmi.server.UnicastRemoteObject
// https://www.bilibili.com/video/BV12N411R726?p=267&spm_id_from=pageDriver

// implement MyRemote trait
class MyRemoteImplement extends UnicastRemoteObject with MyRemote {
class MyRemoteServer extends UnicastRemoteObject with MyRemote {
override def sayHello(): String = {
"hello world :p :p :p"
}
}

// register our service (sayHello)
object MyRemoteImplement{
object MyRemoteServer{
def main(args: Array[String]): Unit = {

val service:MyRemote = new MyRemoteImplement()
val service:MyRemote = new MyRemoteServer()

/**
* Register method 0
Expand Down

0 comments on commit 06f1caa

Please sign in to comment.