1 23 24 package com.sun.enterprise.server; 25 26 import com.sun.enterprise.config.serverbeans.*; 27 import com.sun.enterprise.config.*; 28 import com.sun.enterprise.config.ConfigException; 29 import com.sun.logging.LogDomains; 30 import com.sun.enterprise.admin.event.ResourceDeployEvent; 31 32 import java.util.logging.Level ; 33 import java.util.logging.Logger ; 34 35 40 41 public abstract class ResourcesLoader { 42 static Logger _logger = LogDomains.getLogger(LogDomains.CORE_LOGGER); 43 44 private ServerContext serverContext_; 45 46 private ResourceDeployerFactory factory_ = null; 47 protected ResourcesUtil resourceUtil = null; 48 49 50 public ResourcesLoader(ServerContext sc) throws ConfigException { 51 serverContext_ = sc; 52 factory_ = new ResourceDeployerFactory(); 53 resourceUtil = ResourcesUtil.getInstance(sc); 54 } 55 56 public void load() { 57 58 } 59 60 public void load(ConfigBean[][] configbeanArray) { 61 62 if(configbeanArray == null) { 63 return; 64 } 65 for(int j = 0; j<configbeanArray.length; ++j) { 66 if(configbeanArray[j] == null || configbeanArray[j].length == 0) { 67 continue; 68 } 69 ConfigBean[] configBeanSet = configbeanArray[j]; 70 String resourceType = resourceUtil.getResourceType( 71 configBeanSet[0]); 72 if(resourceType == null) { 73 _logger.log(Level.SEVERE,"core.no_resource_type" ); 74 continue; 75 } 76 ResourceDeployer deployer = null; 77 try { 78 deployer = factory_.getResourceDeployer(resourceType); 79 } catch(Exception ex) { 80 _logger.log(Level.SEVERE, 81 "core.no_resource_deployer",resourceType ); 82 _logger.log(Level.SEVERE,"",ex); 83 continue; 84 } 85 for (int i=0; i<configBeanSet.length; i++) { 86 87 try { 88 if(resourceUtil.isEnabled(configBeanSet[i])) { 89 deployer.deployResource(configBeanSet[i]); 90 } 91 } catch(Exception ex) { 92 _logger.log(Level.SEVERE,"core.resource_loading_error"); 93 _logger.log(Level.SEVERE,"",ex); 94 } 95 } 96 } 97 } 98 99 } 100 | Popular Tags |