nathan.middleware
Class FrontEndHandler

java.lang.Object
  extended by nathan.middleware.FrontEnd
      extended by nathan.middleware.FrontEndHandler
All Implemented Interfaces:
java.lang.Runnable

public class FrontEndHandler
extends FrontEnd
implements java.lang.Runnable

FrontEndHandler creates new threads to handle the messages used for active replication. The FrontEndHandler handles all communication between the replicated objects and the server when active replication is used.

Author:
Nathan Balon
Advance Operating Systems CIS 578
University of Michigan Dearborn
Remote Method Invocation Middleware Project

Constructor Summary
FrontEndHandler(java.net.Socket socket)
          Creates a new instance of the FrontEndHandler.
 
Method Summary
 boolean checkIfAlive()
          Check that all servers are still alive by sending them are you alive messages.
 Message getMessage()
          Get the message that was sent to the server.
 Message processMessage(Message message)
          ProcessMessage send the message to each of the acitve replicas.
 void run()
           
 void sendMessage(Message message)
          sendMessage returns the results of a remote invocation to the client.
 void start()
          Starts a new thread of execution.
 
Methods inherited from class nathan.middleware.FrontEnd
main, runServer, setRegistryInfo
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrontEndHandler

public FrontEndHandler(java.net.Socket socket)
Creates a new instance of the FrontEndHandler.

Parameters:
socket - The socket received from the FrontEnd server.
Method Detail

start

public void start()
Starts a new thread of execution.


run

public void run()
Specified by:
run in interface java.lang.Runnable
See Also:
Runnable.run()

getMessage

public Message getMessage()
Get the message that was sent to the server.

Returns:
Message the message that was sent.

sendMessage

public void sendMessage(Message message)
sendMessage returns the results of a remote invocation to the client.

Parameters:
message - The results of the remote invocation.

processMessage

public Message processMessage(Message message)
ProcessMessage send the message to each of the acitve replicas.

Parameters:
message - The message sent from the client to be processed.
Returns:
Message The message returned from the server.

checkIfAlive

public boolean checkIfAlive()
Check that all servers are still alive by sending them are you alive messages. If a server is down remove it from the list of replicas.

Returns:
boolean true if there are active replicas.