|
|
Our class must extend UnicastRemoteObject,
and implement our interface Chat.
-
UnicastRemoteObject provides us with an implementation of method
exportObject,
which makes our object available to receive remote calls.
-
exportObject is static, so you can use it to export objects if
you do not want your server to extend UnicastRemoteObject.
-
It comes with a default constructor, but we can use other constructors
to specify a port and possibly a RMIClientSocketFactory and RMIServerSocketFactory.
-
We use these factories to create our own, custom sockets. But why
would we want to do that? Actually, it's fairly common. You
can make a custom socket class if you want to implement a particular security
or encryption mechanism, such as Triple DES.
-
UnicastRemoteObject is made to run with TCP connections.
Compiling, Class Name Summary
|