1 23 24 package com.sun.enterprise.server.ondemand; 25 26 import java.util.*; 27 import java.util.logging.*; 28 import com.sun.logging.LogDomains; 29 import com.sun.enterprise.server.ondemand.entry.*; 30 import com.sun.enterprise.server.*; 31 import com.sun.enterprise.config.ConfigException; 32 33 34 41 public class SystemAppLoader { 42 43 private Hashtable apps = new Hashtable(); 44 45 private ApplicationManager appsMgr = ManagerFactory.getApplicationManager(); 46 private StandAloneEJBModulesManager ejbMgr = ManagerFactory.getSAEJBModulesManager(); 47 49 static Logger _logger = LogDomains.getLogger(LogDomains.CORE_LOGGER); 50 51 final Object [][] ejbSGApps = { 52 {"MEjbApp", appsMgr}, 53 {"__ejb_container_timer_app", appsMgr} 54 }; 55 final Object [][] webSGApps = { 59 {"__JWSappclients", appsMgr} 63 }; 64 65 68 public SystemAppLoader() throws ConfigException { 69 70 for (int i=0; i < ejbSGApps.length; i++) { 71 apps.put(ejbSGApps[i][0], ejbSGApps[i][1]); 72 } 73 74 for (int i=0; i < webSGApps.length; i++) { 75 apps.put(webSGApps[i][0], webSGApps[i][1]); 76 } 77 78 } 79 80 public ArrayList getEjbServiceGroupSystemApps() { 81 return createArrayList(ejbSGApps); 82 } 83 84 public ArrayList getWebServiceGroupSystemApps() { 85 return createArrayList(webSGApps); 86 } 87 88 public ArrayList getResourcesServiceGroupSystemApps() { 89 return null; 90 } 91 92 private ArrayList createArrayList(Object [][] objArray) { 93 ArrayList list = new ArrayList(); 94 for (int i=0; i < objArray.length; i ++) { 95 list.add(objArray[i][0]); 96 } 97 return list; 98 } 99 100 public void loadSystemApps(ArrayList ids) { 101 Iterator it = ids.iterator(); 102 while (it.hasNext()) { 103 Object appName = it.next(); 104 if (_logger.isLoggable(Level.INFO)) { 105 _logger.log(Level.INFO, "About to load the system app: " + appName); 106 } 107 if (apps.containsKey(appName)) { 108 AbstractManager mgr = (AbstractManager) apps.get(appName); 109 mgr.loadOneSystemApp((String ) appName, true); 110 } 111 } 112 } 113 114 } 115 | Popular Tags |