Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
R
RMI-Lab
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mohamadbashar.disoki
RMI-Lab
Commits
c5a310f3
You need to sign in or sign up before continuing.
Commit
c5a310f3
authored
Nov 13, 2025
by
Mohamad Bashar Desoki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EX3
parent
c5192b5e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
66 additions
and
5 deletions
+66
-5
Client.java
src/main/java/org/ds/EX3/client/Client.java
+15
-1
ClientCallBackImp.java
src/main/java/org/ds/EX3/client/ClientCallBackImp.java
+13
-1
ComputeAndNotifySVCImp.java
src/main/java/org/ds/EX3/server/ComputeAndNotifySVCImp.java
+15
-1
Server.java
src/main/java/org/ds/EX3/server/Server.java
+12
-0
IClientCallBack.java
src/main/java/org/ds/EX3/shared/IClientCallBack.java
+6
-1
IComputeAndNotify.java
src/main/java/org/ds/EX3/shared/IComputeAndNotify.java
+5
-1
No files found.
src/main/java/org/ds/EX3/client/Client.java
View file @
c5a310f3
package
org
.
ds
.
EX3
.
client
;
public
class
Clint
{
import
org.ds.EX3.shared.IClientCallBack
;
import
org.ds.EX3.shared.IComputeAndNotify
;
import
java.rmi.NotBoundException
;
import
java.rmi.RemoteException
;
import
java.rmi.registry.LocateRegistry
;
import
java.rmi.registry.Registry
;
public
class
Client
{
public
static
void
main
(
String
[]
args
)
throws
RemoteException
,
NotBoundException
{
Registry
registry
=
LocateRegistry
.
getRegistry
(
1099
);
IComputeAndNotify
iComputeAndNotify
=
(
IComputeAndNotify
)
registry
.
lookup
(
"ComputeAndNotifySVC"
);
IClientCallBack
iClientCallBack
=
new
ClientCallBackImp
();
iComputeAndNotify
.
computeAndNotify
(
10
,
5
,
iClientCallBack
);
}
}
src/main/java/org/ds/EX3/client/ClientCallBackImp.java
View file @
c5a310f3
package
org
.
ds
.
EX3
.
client
;
public
class
ClientCallBackImp
{
import
org.ds.EX3.shared.IClientCallBack
;
import
java.rmi.RemoteException
;
import
java.rmi.server.UnicastRemoteObject
;
public
class
ClientCallBackImp
extends
UnicastRemoteObject
implements
IClientCallBack
{
protected
ClientCallBackImp
()
throws
RemoteException
{
}
@Override
public
void
notify
(
String
Message
)
throws
RemoteException
{
System
.
out
.
println
(
"Received Callback:"
+
Message
);
}
}
src/main/java/org/ds/EX3/server/ComputeAndNotifySVCImp.java
View file @
c5a310f3
package
org
.
ds
.
EX3
.
server
;
public
class
ComputeAndNotifySVCImp
{
import
org.ds.EX3.shared.IClientCallBack
;
import
org.ds.EX3.shared.IComputeAndNotify
;
import
java.rmi.RemoteException
;
import
java.rmi.server.UnicastRemoteObject
;
public
class
ComputeAndNotifySVCImp
extends
UnicastRemoteObject
implements
IComputeAndNotify
{
protected
ComputeAndNotifySVCImp
()
throws
RemoteException
{
}
@Override
public
void
computeAndNotify
(
int
a
,
int
b
,
IClientCallBack
clientCallBack
)
throws
RemoteException
{
int
res
=
a
+
b
;
clientCallBack
.
notify
(
"Result: "
+
res
);
}
}
src/main/java/org/ds/EX3/server/Server.java
View file @
c5a310f3
package
org
.
ds
.
EX3
.
server
;
import
java.rmi.RemoteException
;
import
java.rmi.registry.LocateRegistry
;
import
java.rmi.registry.Registry
;
public
class
Server
{
public
static
void
main
(
String
[]
args
)
throws
RemoteException
{
Registry
registry
=
LocateRegistry
.
createRegistry
(
1099
);
ComputeAndNotifySVCImp
computeAndNotifySVCImp
=
new
ComputeAndNotifySVCImp
();
registry
.
rebind
(
"ComputeAndNotifySVC"
,
computeAndNotifySVCImp
);
System
.
out
.
println
(
"Ready"
);
}
}
src/main/java/org/ds/EX3/shared/IClientCallBack.java
View file @
c5a310f3
package
org
.
ds
.
EX3
.
shared
;
public
interface
IClientCallBack
{
import
java.rmi.Remote
;
import
java.rmi.RemoteException
;
public
interface
IClientCallBack
extends
Remote
{
public
void
notify
(
String
Message
)
throws
RemoteException
;
}
src/main/java/org/ds/EX3/shared/IComputeAndNotify.java
View file @
c5a310f3
package
org
.
ds
.
EX3
.
shared
;
public
interface
IComputeAndNotify
{
import
java.rmi.Remote
;
import
java.rmi.RemoteException
;
public
interface
IComputeAndNotify
extends
Remote
{
public
void
computeAndNotify
(
int
a
,
int
b
,
IClientCallBack
clientCallBack
)
throws
RemoteException
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment