FileDocCategorySizeDatePackage
ResourcesLoader.javaAPI DocGlassfish v2 API4218Fri May 04 22:35:42 BST 2007com.sun.enterprise.server

ResourcesLoader

public abstract class ResourcesLoader extends Object
author
Srikanth P
version

Fields Summary
static Logger
_logger
private ResourceDeployerFactory
factory_
Constructors Summary
public ResourcesLoader()

    

        
        factory_ = new ResourceDeployerFactory();
    
Methods Summary
public voidload()

 
    
public voidload(ConfigBean[][] configbeanArray)


        if(configbeanArray == null) {
            return;
        }
        for(int j = 0; j<configbeanArray.length; ++j) {
            if(configbeanArray[j] == null || configbeanArray[j].length == 0) {
                continue;
            }
            ConfigBean[] configBeanSet = configbeanArray[j];
            ResourcesUtil resourceUtil = ResourcesUtil.createInstance();
            String resourceType = resourceUtil.getResourceType(
                         configBeanSet[0]);
            if(resourceType == null) {
                _logger.log(Level.SEVERE,"core.no_resource_type" );
                continue;
            }
            ResourceDeployer deployer = null;
            try {
                deployer = factory_.getResourceDeployer(resourceType);
            } catch(Exception ex) {
                _logger.log(Level.SEVERE,
                          "core.no_resource_deployer",resourceType );
                _logger.log(Level.SEVERE,"",ex);
                continue;
            }
            for (int i=0; i<configBeanSet.length; i++) {

                try {
                    if(resourceUtil.isEnabled(configBeanSet[i])) {
                        deployer.deployResource(configBeanSet[i]);
                    }
                } catch(Exception ex) {
                    _logger.log(Level.SEVERE,"core.resource_loading_error");
                    _logger.log(Level.SEVERE,"",ex);
                }
            }
        }