ParkNPark.middletier
Class ReplicationManager

java.lang.Object
  extended by org.omg.PortableServer.Servant
      extended by ParkNPark.interfaces.ReplicationManagerPOA
          extended by ParkNPark.middletier.ReplicationManager
All Implemented Interfaces:
InvokeHandler, ReplicationManagerOperations

public class ReplicationManager
extends ReplicationManagerPOA


Nested Class Summary
protected  class ReplicationManager.StartupListener
          Listens on a server process to determine if it started up successfully or not
 
Field Summary
protected  PrintStream err
          The original System.err instance
protected static PrintStream inputEater
          Shared static instance of the input eater output stream wrapped in a PrintStream
protected  int interRequestTime
          Time between requests
private  String jdbcPassword
          The JDBC password
private  String jdbcURL
          The JDBC URL
private  String jdbcUsername
          The JDBC user name
protected  NameService nameService
          Instance of our common name service management object
protected  int numClients
          Number of clients
protected  int numServers
          Number of servers
private  ORB orb
          Object request broker
protected  String projectRoot
          The project root, which is used when restarting a failed server
protected  int replySize
          Size of reply
private  POA rootPOA
          Root POA
protected  int timeout
          The wait timeout to use during fault detections
 
Constructor Summary
ReplicationManager()
           
 
Method Summary
 void checkServers()
          Check whether or not servers are active
static void main(String[] args)
          Entry point of replication manager
protected  boolean registerReplicationManager()
          Registers the replication manager's name with the name service.
protected  boolean removeExistingEntries(String serviceName)
          Removes existing server entries that match the given service name.
 void serverRegistered(String ipAddress, String serviceName, ClientManagerFactory cmf)
          Called by servers when they start up.
 void setPrimary(int index)
          Set one of the active servers as the primary
protected  void setupReplicationManagerCORBAObjects(String[] args)
          Setup CORBA objects
 void startServer(Server s, boolean corrupted)
          Start a new server or restart a corrupted server
 void unbindServer(Server s)
          Unbind the failed server's service name from the naming service
 
Methods inherited from class ParkNPark.interfaces.ReplicationManagerPOA
_all_interfaces, _invoke, _this, _this
 
Methods inherited from class org.omg.PortableServer.Servant
_default_POA, _get_delegate, _get_interface_def, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

orb

private ORB orb
Object request broker


rootPOA

private POA rootPOA
Root POA


projectRoot

protected String projectRoot
The project root, which is used when restarting a failed server


nameService

protected NameService nameService
Instance of our common name service management object


numClients

protected int numClients
Number of clients


numServers

protected int numServers
Number of servers


interRequestTime

protected int interRequestTime
Time between requests


replySize

protected int replySize
Size of reply


timeout

protected int timeout
The wait timeout to use during fault detections


err

protected PrintStream err
The original System.err instance


jdbcURL

private String jdbcURL
The JDBC URL


jdbcUsername

private String jdbcUsername
The JDBC user name


jdbcPassword

private String jdbcPassword
The JDBC password


inputEater

protected static PrintStream inputEater
Shared static instance of the input eater output stream wrapped in a PrintStream

Constructor Detail

ReplicationManager

public ReplicationManager()
Method Detail

main

public static void main(String[] args)
Entry point of replication manager

Parameters:
args -

serverRegistered

public void serverRegistered(String ipAddress,
                             String serviceName,
                             ClientManagerFactory cmf)
Called by servers when they start up.

Parameters:
ipAddress -
serviceName -
cmf -

checkServers

public void checkServers()
Check whether or not servers are active


setPrimary

public void setPrimary(int index)
Set one of the active servers as the primary

Parameters:
index -

unbindServer

public void unbindServer(Server s)
Unbind the failed server's service name from the naming service

Parameters:
s -

startServer

public void startServer(Server s,
                        boolean corrupted)
Start a new server or restart a corrupted server

Parameters:
s -
corrupted -

removeExistingEntries

protected boolean removeExistingEntries(String serviceName)
Removes existing server entries that match the given service name. If a match is the current primary, this method returns true

Parameters:
serviceName - The service name to remove matching entries of

setupReplicationManagerCORBAObjects

protected void setupReplicationManagerCORBAObjects(String[] args)
Setup CORBA objects


registerReplicationManager

protected boolean registerReplicationManager()
Registers the replication manager's name with the name service. You must have called refreshParkNParkContext() before calling this method

Returns: