Package com.vmware.bdd.service.resmgmt

Examples of com.vmware.bdd.service.resmgmt.IResourceInitializerService


         logger.info("ResourceInitializer::contextInitialized started");
         ServletContext sc = sce.getServletContext();
         WebApplicationContext wac =
               WebApplicationContextUtils.getWebApplicationContext(sc);
         initService(wac);
         IResourceInitializerService resInitializerSvc =
               wac.getBean(IResourceInitializerService.class);
         if (!resInitializerSvc.isResourceInitialized()) {
            boolean initResource = Configuration.getBoolean("init_resource");
            logger.info("need initializing resource? " + initResource);
            if (initResource) {
               resInitializerSvc.initResource();
            }
            resInitializerSvc.updateOrInsertServerInfo();
         }
         logger.info("ResourceInitializer completed");
      } catch (Throwable t) {
         logger.error("Resource initialization failed.", t);
      }
View Full Code Here


   }

   @Test(groups={"res-mgmt","dependsOnVC","dependsOnDB"})
   public void initResource(){
      super.init();
      IResourceInitializerService svc = ctx.getBean(IResourceInitializerService.class);

      IResourcePoolDAO rpDao = ctx.getBean(IResourcePoolDAO.class);
      IDatastoreDAO dsDao = ctx.getBean(IDatastoreDAO.class);
      INetworkDAO networkDao = ctx.getBean(INetworkDAO.class);
      VcResourcePoolEntity rpEntity = rpDao.findByName(ResourceInitializerService.DEFAULT_RP);
      if(rpEntity != null){
         rpDao.delete(rpEntity);
      }
      List<VcDatastoreEntity> dss = dsDao.findByName(ResourceInitializerService.DEFAULT_DS_SHARED);
      if(dss != null && dss.size() > 0){
         for(VcDatastoreEntity ds : dss){
            dsDao.delete(ds);
         }
      }
      dss = dsDao.findByName(ResourceInitializerService.DEFAULT_DS_LOCAL);
      if(dss != null && dss.size() > 0){
         for(VcDatastoreEntity ds : dss){
            dsDao.delete(ds);
         }
      }
      NetworkEntity network = networkDao.findNetworkByName(ResourceInitializerService.DEFAULT_NETWORK);
      if(network != null){
         networkDao.delete(network);
      }
      svc.initResource();

   }
View Full Code Here

TOP

Related Classes of com.vmware.bdd.service.resmgmt.IResourceInitializerService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.