Package com.cloud.utils.component

Examples of com.cloud.utils.component.ComponentLocator$ComponentInfo


    }

    @Override
    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
        _name = name;
        ComponentLocator locator = ComponentLocator.getCurrentLocator();
      if (_configDao != null) {
        Map<String, String> configs = _configDao.getConfiguration(params);
            String opFactor = configs.get("cpu.overprovisioning.factor");
            _factor = NumbersUtil.parseFloat(opFactor, 1);
           
View Full Code Here


 
  @Override
  public int cleanup(CheckPointManager checkPointMgr) {
    StateMachine2<Volume.State, Volume.Event, Volume> _stateMachine = Volume.State.getStateMachine();
   
    ComponentLocator locator = ComponentLocator.getLocator(ManagementServer.Name);
    VolumeDao volDao = locator.getDao(VolumeDao.class);
    VMInstanceDao vmDao = locator.getDao(VMInstanceDao.class);
    VirtualMachineManager vmMgr = locator.getManager(VirtualMachineManager.class);
    Long vmInstanceId = null;
    boolean success = true;
    Transaction txn = Transaction.open(Transaction.CLOUD_DB);

    try {
View Full Code Here

        return true;
    }

    public void init(String[] args) throws ConfigurationException {

        final ComponentLocator locator = ComponentLocator.getLocator("agent");

        final Class<?> c = this.getClass();
        _version = c.getPackage().getImplementationVersion();
        if (_version == null) {
            throw new CloudRuntimeException(
                    "Unable to find the implementation version of this agent");
        }
        s_logger.info("Implementation Version is " + _version);

        loadProperties();
        parseCommand(args);

        List<String> properties = Collections.list((Enumeration<String>)_properties.propertyNames());
        for (String property:properties){
            s_logger.debug("Found property: " + property);
        }

        _storage = locator.getManager(StorageComponent.class);
        if (_storage == null) {
            s_logger.info("Defaulting to using properties file for storage");
            _storage = new PropertiesStorage();
            _storage.configure("Storage", new HashMap<String, Object>());
        }

        // merge with properties from command line to let resource access
        // command line parameters
        for (Map.Entry<String, Object> cmdLineProp : getCmdLineProperties()
                .entrySet()) {
            _properties.put(cmdLineProp.getKey(), cmdLineProp.getValue());
        }

        final Adapters adapters = locator.getAdapters(BackoffAlgorithm.class);
        final Enumeration en = adapters.enumeration();
        while (en.hasMoreElements()) {
            _backoff = (BackoffAlgorithm) en.nextElement();
            break;
        }
View Full Code Here

    @Override
    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
        _name = name;

        ComponentLocator locator = ComponentLocator.getCurrentLocator();

        ConfigurationDao configDao = locator.getDao(ConfigurationDao.class);
        if (configDao == null) {
            throw new ConfigurationException("Unable to get the configuration dao.");
        }
       
        String value = configDao.getValue(Config.BackupSnapshotWait.toString());
View Full Code Here

    @Override
    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
        _name = name;

        ComponentLocator locator = ComponentLocator.getCurrentLocator();

        ConfigurationDao configDao = locator.getDao(ConfigurationDao.class);
        if (configDao == null) {
            s_logger.error("Unable to get the configuration dao.");
            return false;
        }
View Full Code Here

        launchAgentFromTypeInfo();
    }   
   
    private void init(String[] args) throws ConfigurationException{
     
        final ComponentLocator locator = ComponentLocator.getLocator("agent");
       
        final Class<?> c = this.getClass();
        _version = c.getPackage().getImplementationVersion();
        if (_version == null) {
            throw new CloudRuntimeException("Unable to find the implementation version of this agent");
        }
        s_logger.info("Implementation Version is " + _version);
     
        parseCommand(args);
       
        _storage = locator.getManager(StorageComponent.class);
        if (_storage == null) {
            s_logger.info("Defaulting to using properties file for storage");
            _storage = new PropertiesStorage();
            _storage.configure("Storage", new HashMap<String, Object>());
        }

        // merge with properties from command line to let resource access command line parameters
        for(Map.Entry<String, Object> cmdLineProp : getCmdLineProperties().entrySet()) {
          _properties.put(cmdLineProp.getKey(), cmdLineProp.getValue());
        }
       
        final Adapters adapters = locator.getAdapters(BackoffAlgorithm.class);
        final Enumeration en = adapters.enumeration();
        while (en.hasMoreElements()) {
            _backoff = (BackoffAlgorithm)en.nextElement();
            break;
        }
View Full Code Here

 
    public StoragePoolMonitor(StorageManagerImpl mgr, StoragePoolDao poolDao) {
      this._storageManager = mgr;
      this._poolDao = poolDao;
     
      ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
      this._ocfs2Mgr = locator.getManager(OCFS2Manager.class);
    }
View Full Code Here

        _dummyPath = (String)params.get("mount.path");
        if (_dummyPath == null) {
            throw new ConfigurationException("Unable to find mount.path");
        }
       
      ComponentLocator locator = ComponentLocator.getLocator("management-server");
      _tmpltDao = locator.getDao(VMTemplateDao.class);
      if (_tmpltDao == null) {
        throw new ConfigurationException("Unable to find VMTemplate dao");
      }
        return true;
    }
View Full Code Here

    }

    @Override
    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
        _name = name;
        ComponentLocator locator = ComponentLocator.getCurrentLocator();
        ConfigurationDao configDao = locator.getDao(ConfigurationDao.class);
        if (configDao == null) {
            throw new ConfigurationException("Unable to get the configuration dao.");
        }
       
        Map<String, String> configs = configDao.getConfiguration();
View Full Code Here

   
    @Override
    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
        super.configure(name, params);
       
        ComponentLocator locator = ComponentLocator.getCurrentLocator();
       
        ConfigurationDao configDao = locator.getDao(ConfigurationDao.class);
        Map<String, String> dbParams = configDao.getConfiguration("ManagementServer", params);
       
        _ip = dbParams.get("public.ip");
        if (_ip == null) {
            _ip = "127.0.0.1";
View Full Code Here

TOP

Related Classes of com.cloud.utils.component.ComponentLocator$ComponentInfo

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.