edu.cmu.mse.vault.client
Class VaultJNDICacheManager

java.lang.Object
  extended byedu.cmu.mse.vault.client.VaultJNDICacheManager
All Implemented Interfaces:
java.lang.Runnable

public class VaultJNDICacheManager
extends java.lang.Object
implements java.lang.Runnable

Author:
Jinhee Lee VaultJNDICacheManager should retrieve the JNDI names and object references from the JNDI server and Replica Manager peoriodically This class is a timer thread class, whose run() method will be invoked with a fixed rate time.

Nested Class Summary
 class VaultJNDICacheManager.VaultJNDICache
           
 
Constructor Summary
VaultJNDICacheManager()
           
 
Method Summary
 boolean cacheIsEmpty()
           
 java.lang.Object getAccObjectReference(java.lang.Object index)
           
 java.lang.Object getCustObjectReference(java.lang.Object index)
           
static javax.naming.Context getInitialContext(java.lang.String globalJNDIHostName)
           
 int getNUM_SERVER_INSTANCES()
           
 java.lang.Object getTranObjectReference(java.lang.Object index)
           
 boolean isLookup()
           
 boolean isSuccess()
           
 void loadProperties()
          Load properties from the vaultjndi.properties file.
 boolean lookupJndiContext()
          Looking up JndiContext and object reference from the JNDI server All object reference will be added to the HashTable.
 boolean lookupRepManager()
          This method connect to the replication manager and get JNDIName
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VaultJNDICacheManager

public VaultJNDICacheManager()
Method Detail

getTranObjectReference

public java.lang.Object getTranObjectReference(java.lang.Object index)
Parameters:
index - : reference ID of the work thread, Type: String
Returns:
ArrayList that contains the JNDI name string and SessionEJB Object reference

getAccObjectReference

public java.lang.Object getAccObjectReference(java.lang.Object index)
Parameters:
index - : reference ID of the work thread Type: String
Returns:
ArrayList that contains the JNDI name string and SessionEJB Object reference

getCustObjectReference

public java.lang.Object getCustObjectReference(java.lang.Object index)
Parameters:
index - : reference ID of the work thread Type: String
Returns:
ArrayList that contains the JNDI name string and SessionEJB Object reference

run

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

loadProperties

public void loadProperties()
Load properties from the vaultjndi.properties file. Now, the properties file contains three properties - MAX_NUM_SERVER_INSTANCES - PERIOD_CHECK_JNDI - PREFIX_JNDI_NAME


lookupRepManager

public boolean lookupRepManager()
This method connect to the replication manager and get JNDIName


lookupJndiContext

public boolean lookupJndiContext()
Looking up JndiContext and object reference from the JNDI server All object reference will be added to the HashTable. We maintain three seperate HashTable for each EJBSession object.


getInitialContext

public static javax.naming.Context getInitialContext(java.lang.String globalJNDIHostName)
                                              throws javax.naming.NamingException
Returns:
Throws:
javax.naming.NamingException

getNUM_SERVER_INSTANCES

public int getNUM_SERVER_INSTANCES()
Returns:
value of NUM_SERVER_INSTANCES.

cacheIsEmpty

public boolean cacheIsEmpty()

isLookup

public boolean isLookup()
Returns:

isSuccess

public boolean isSuccess()
Returns:
Returns the isSuccess.