nathan.middleware
Class RegistryHandler

java.lang.Object
  extended by java.lang.Thread
      extended by nathan.middleware.RegistryHandler
All Implemented Interfaces:
java.lang.Runnable

public class RegistryHandler
extends java.lang.Thread

RegistryHandler handles the message that are sent to the registry. The registryHandler are seperate threads used to complete the requests that are sent to the registry.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
 RemoteObjectMapping addFrontEnd(RegistryMessage message)
          Add a Active Replication by giving the registry the address of the front end so that clients access the front end rather than the remote object.
 RemoteObjectReference bindObject(RegistryMessage message)
          Binds an object to the registry and creates a new remote object reference for the remote object.
 boolean checkFrontEnd(RemoteObjectMapping registryObject)
          Checks if the FrontEnd for the application is still active.
 void checkIfAlive(RemoteObjectMapping mapping)
           
 void listAll()
          listAll object that are contained in the registry.
 RemoteObjectReference lookupObject(RegistryMessage message)
          lookup the remote object reference for an object.
 void run()
          The thread of execution used to handle messages sent to the registry.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

bindObject

public RemoteObjectReference bindObject(RegistryMessage message)
Binds an object to the registry and creates a new remote object reference for the remote object.

Parameters:
message - The message used to bind an object to the registry.
Returns:
RemoteObjectReference The remote reference for the bound object.

checkIfAlive

public void checkIfAlive(RemoteObjectMapping mapping)

checkFrontEnd

public boolean checkFrontEnd(RemoteObjectMapping registryObject)
Checks if the FrontEnd for the application is still active.

Parameters:
registryObject - The RemoteObjectMapping containing the frontend to check.
Returns:
boolean Returns true if the FrontEnd is still able to be accessed.

lookupObject

public RemoteObjectReference lookupObject(RegistryMessage message)
lookup the remote object reference for an object.

Parameters:
message - The message used to lookup the reference.
Returns:
RemoteObjectReference The remote refernce for the object.

listAll

public void listAll()
listAll object that are contained in the registry.


addFrontEnd

public RemoteObjectMapping addFrontEnd(RegistryMessage message)
Add a Active Replication by giving the registry the address of the front end so that clients access the front end rather than the remote object.

Parameters:
message - The message sent from the front end.

run

public void run()
The thread of execution used to handle messages sent to the registry.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread