Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

SctNames.java

00001 /*
00002  * SCTNames.java
00003  *
00004  * Created on 17 December 2002, 21:54
00005  */
00006 
00010 package Sct.IS;
00011 
00012 import is.*;
00013 import ipc.*;
00014 import Sct.*;
00015 import Sct.SearchClassLoader;
00016 import java.util.HashMap;
00017 
00024 public class SctNames {
00025     
00026     private static HashMap map = new HashMap();
00027     
00029     private SctNames() {
00030     }
00031     
00032     private static Partition partition = null;
00033         private static Repository repository = null;
00034         
00041     public static String getISServer(String className) {                
00042         try {
00043             Class[] argTypes = {IStream.class, ObjectManager.class};
00044             Class c = SearchClassLoader.instance().loadClass(className, argTypes);
00045             String ISServer = (String)map.get(c);
00046             while (c!=null && ISServer == null) {
00047                 c = c.getSuperclass();
00048                 ISServer = (String)map.get(c);
00049             }             
00050             if (ISServer != null) return ISServer;
00051             else return getDefaultISServer();
00052             
00053         } catch (ClassNotFoundException e) {
00054             return getDefaultISServer();
00055         }              
00056     }
00057     
00058     public static void addToMap(Class classID, String ISServer) {
00059         map.put(classID,  ISServer);
00060     }
00061         
00062         public static String getPartitionName() {return "SCT";}
00063     
00064     public static String getDefaultISServer() {return "Default";}
00065         public static String getEventISServer() {return "EventData";}
00066     public static String getFitISServer() {return "FittedData";}
00067     public static String getTestISServer() {return "TestData";}
00068     public static String getControlISServer() {return "ControlData";}
00069         
00070     public static Partition getPartition() {
00071                 if (partition == null) partition = new Partition(getPartitionName());
00072                 return partition;
00073         }
00074         public static Repository getISRepository() {
00075                 if (repository == null) repository = new SctRepository(getPartition());
00076                 return repository;
00077         }
00078 
00079 }

Generated on Thu Jul 15 09:55:49 2004 for SCT DAQ/DCS Software - Java by doxygen 1.3.5