Class InitiatorImp
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
InitiatorImp
- All Implemented Interfaces:
- Initiator, java.io.Serializable, java.rmi.Remote
public class InitiatorImp
- extends java.rmi.server.UnicastRemoteObject
- implements Initiator
- Author:
- Ariel Cohen
- See Also:
- Serialized Form
Constructor Summary |
InitiatorImp(java.lang.String myName,
java.lang.String myHost)
Constructor for InitiatorImp. |
Method Summary |
void |
conversation(java.lang.String name,
java.lang.String message)
Prints a message |
void |
initiateConversation(java.lang.String responderHost,
java.lang.String responderName)
Initiates a conversation with the Responder |
static void |
main(java.lang.String[] args)
Excutes the Initiator. |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
InitiatorImp
public InitiatorImp(java.lang.String myName,
java.lang.String myHost)
throws java.rmi.RemoteException
- Constructor for InitiatorImp.
- Parameters:
myName
- The Initiator's namemyHost
- The Initiator's host
- Throws:
java.rmi.RemoteException
- There is no RMI.
conversation
public void conversation(java.lang.String name,
java.lang.String message)
throws java.rmi.RemoteException
- Prints a message
- Specified by:
conversation
in interface Initiator
- Parameters:
name
- The name of the sendermessage
- The message
- Throws:
java.rmi.RemoteException
- There is no RMI
initiateConversation
public void initiateConversation(java.lang.String responderHost,
java.lang.String responderName)
- Initiates a conversation with the Responder
- Parameters:
responderHost
- The responder's hostresponderName
- The responder's name
main
public static void main(java.lang.String[] args)
- Excutes the Initiator.
- Parameters:
args
- Array of Initiator's name, Responder's name, Initiator's host, Responder's host