Notes
Notes - notes.io |
Middleware on client side. A proxy intercepting client calls and invoking remote server method by sending request in a stream.
Serve SKELETON
Receive Client stream with method and data. Disassembles, invokes method and refuses data. The roles of STUB and SKELETON swap.
RMI Registry
• A utility app which registers remote object and provides services by mapping names(strings) to binary reference to servant object
• Resides typically on server host but can be on another host (on server side)
• Runs as a background process – windows C:>start.rmiregistry – to run a background process
• Solaris/Linus - $rmiregistry &
Functionality
Server app registers servant object by symbolic name and corresponding ref to constructed object.
Client looks up RMI Registry by symbolic name and receives (In java 5.0 and higher) a stub.
o Rem: Previous reversion of JAVA required compiler to generate STUB as linkable model.
Server side activity
Examples refer to Robot case study
Server application
1.Constructs Servant Object
Robot rbt = new Robot(0,0);
2. Registers servant with rmiregistry
Either using rebind() method (of registry object)
Or Naming.rebind() static method
Parameters
Naming.rebind(“Remote Robot”, rbt)
Registry on Local Host, on port 1099
Or Naming.rebind(“rmi://cis.um.edu.mt:3056/RemoteRobot”,rbt)
3. Run the ServerApp .exe with security setup
Either on communication line or security policy file.
Activity on Java version < 1.5 (older)
After point 1
2. Create Stub and Skeleton
C:>rmic Robot
Rmic.exe compiler – Robot class
Results in:
Robot_Strub.class
Robot_skeleton.class
Development of ServerApp application hosting Robot Servant
1. Create Remote interface
Interface IMotion extends Remote{
Prescribes 3 methods
}
Implement Servant Robot
Public class Robot(int x, int y) throws RemoteException()
{
This.x = x;
This.y = y;
}
Public void start(){
-------
-------
}
Public void stop(){
}
Public void moveTo(new X, new Y){
}
3. ServerApp.java (main program)
{
Public static void main(String [] args)
{…setup security
Robot rbt = new Robot(0,0);
Naming.rebind(“RemoteRobot”,rbt);
}
}
Launching rmi registry
C:>rmiregistry
Lanching server app
C:>java ServerApp
NOW SERVER IS RUNNING
Structure of Client app
Class Client{
Public Client(){
Security using RMISecurityManager(){
Public static void main(String [] args) throws RemoteException
{ IMOtion remObj = (IMotion)Naming.lookup(“RemoteRobot”);
remObj.start();
remObj.Moveto(20,30);
}
Notes on RMI Security
Reason for security: Allow only legitimate clients to access remote server and avoid access to clients from unknown intruders
1. Set System to RMI Security policy file (ref to Java RMI T1-2)
2. Content of RMI Security.policy file
Grant { permission .. specific permissions
Examples: grant { permission java.security.AllPermissions; .. full access
Grant java.net.SocketPermission “* 1099”,”connect.resolve”;
Grant java.net.SocketPermission, “*:2050”, “connect.resolve”;
Use of RMI Technology
Used as a proprietary distributed system serving only one company with several remote branches. Normally it is not publicly available.
IV – Web Services Technology
Nowadays popular technology providing services to the right public using internet infrastructure can be licenced frequently.
Features:
Web Servies is a remote application accessible on the Internet via http protocol allowing:
1. Simple (user-friendly) discovery from web browsers
2. Transparent way of data and services description (using XML)
3. Transparent way of data referencing remote objects using native programming language ( through PROXY).
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team