net.rmi.rmiSynth
Class HostManager

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by net.rmi.rmiSynth.HostManager
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, HostManagerInterface

public class HostManager
extends java.rmi.server.UnicastRemoteObject
implements HostManagerInterface

The HostManager is invoked remotely by unicast remote protocol. New workers that enter into the grid must know the IP address of the HostManager We need to provide a leasing mechanism that expires a host. First start the host manager. Then start the computation servers. Finally start the compute client

See Also:
Serialized Form

Field Summary
static java.lang.String hostManagerAddress
           
 
Method Summary
 void add(Host h)
           
 boolean contains(Host h)
           
static boolean equals(Host h1, Host h2)
           
 Host[] getHosts()
           
 Host getNextHost()
          getNextHost returns the next host in the list, with wrap-around.
static HostManagerInterface getProxy()
          Use getProxy to gain remote access to the host manager.
 int indexOf(Host h, int index)
           
static void main(java.lang.String[] args)
           
 void remove(Host h)
           
 void removeOldHosts()
           
 void update(Host h)
           
 
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
 

Field Detail

hostManagerAddress

public static final java.lang.String hostManagerAddress
See Also:
Constant Field Values
Method Detail

getHosts

public Host[] getHosts()
                throws java.rmi.RemoteException
Specified by:
getHosts in interface HostManagerInterface
Throws:
java.rmi.RemoteException

getProxy

public static HostManagerInterface getProxy()
Use getProxy to gain remote access to the host manager. If proxy was already obtained, this invocation will not look it up again.


add

public void add(Host h)
         throws java.rmi.RemoteException
Specified by:
add in interface HostManagerInterface
Throws:
java.rmi.RemoteException

contains

public boolean contains(Host h)

indexOf

public int indexOf(Host h,
                   int index)

equals

public static boolean equals(Host h1,
                             Host h2)

getNextHost

public Host getNextHost()
                 throws java.rmi.RemoteException
getNextHost returns the next host in the list, with wrap-around.

Specified by:
getNextHost in interface HostManagerInterface
Throws:
java.rmi.RemoteException

removeOldHosts

public void removeOldHosts()

remove

public void remove(Host h)

update

public void update(Host h)
            throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

main

public static void main(java.lang.String[] args)