These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 ConfigurationException class.
_localStoragePoolAllocator = ComponentLocator.inject(LocalStoragePoolAllocator.class); _localStoragePoolAllocator.configure("GCLocalStoragePoolAllocator", params); _storageMgr = locator.getManager(StorageManager.class); if (_storageMgr == null) { throw new ConfigurationException("Unable to get " + StorageManager.class.getName()); } _configDao = locator.getDao(ConfigurationDao.class); if (_configDao == null) { throw new ConfigurationException("Unable to get the configuration dao."); } String storagePoolCleanupEnabled = _configDao.getValue("storage.pool.cleanup.enabled"); _storagePoolCleanupEnabled = (storagePoolCleanupEnabled == null) ? true : Boolean.parseBoolean(storagePoolCleanupEnabled); return true; } public GarbageCollectingStoragePoolAllocator() {
ComponentLocator locator = ComponentLocator.getCurrentLocator(); _manager = locator.getManager(ClusterManager.class); if(_manager == null) throw new ConfigurationException("Unable to get " + ClusterManager.class.getName()); _mshostDao = locator.getDao(ManagementServerHostDao.class); if(_mshostDao == null) throw new ConfigurationException("Unable to get " + ManagementServerHostDao.class.getName()); if(_mshostDao == null) throw new ConfigurationException("Unable to get " + ManagementServerHostDao.class.getName()); _configDao = locator.getDao(ConfigurationDao.class); if(_configDao == null) throw new ConfigurationException("Unable to get " + ConfigurationDao.class.getName()); String value = _configDao.getValue(Config.ClusterMessageTimeOutSeconds.key()); _clusterRequestTimeoutSeconds = NumbersUtil.parseInt(value, DEFAULT_REQUEST_TIMEOUT);
if (_podId == null) { throw new ConfigurationException("No Pod specified"); } if (_ip == null) { throw new ConfigurationException("No IP specified"); } if (_username == null) { throw new ConfigurationException("No username specified"); } if (_password == null) { throw new ConfigurationException("No password specified"); } return true; } protected ReadyAnswer execute(ReadyCommand cmd) {
if (_ip == null) { throw new ConfigurationException("No IP specified"); } if (_username == null) { throw new ConfigurationException("No username specified"); } if (_password == null) { throw new ConfigurationException("No password specified"); } if (_gateway == null) { throw new ConfigurationException("No gateway specified"); } if (_dns == null) { throw new ConfigurationException("No dns specified"); }
throw new ConfigurationException("unable to get " + UserDao.class.getName()); } _itMgr = locator.getManager(VirtualMachineManager.class); if (_itMgr == null) { throw new ConfigurationException("unable to get " + VirtualMachineManager.class.getName()); } return true; } @Override public boolean start() { return true; } @Override public boolean stop() { return true; }
HashMap<String, Object> params = buildConfigParams(host); try { resource.configure(host.getName(), params); } catch (ConfigurationException e) { s_logger.warn("Unable to configure resource due to " + e.getMessage()); return null; } if (!resource.start()) { s_logger.warn("Unable to start the resource"); return null; } } return resource; } private void updateNetworkLabels(HostVO host){ //check if networkLabels need to be updated in details //we send only private and storage network label to the resource. String privateNetworkLabel = _networkMgr.getDefaultManagementTrafficLabel(host.getDataCenterId(), host.getHypervisorType());
_timeoutInSeconds = NumbersUtil.parseInt((String) params.get("timeoutInSeconds"), 300); return true; } catch (Exception e) { throw new ConfigurationException(e.getMessage()); } } @Override public StartupCommand[] initialize() { StartupTrafficMonitorCommand cmd = new StartupTrafficMonitorCommand(); cmd.setName(_name); cmd.setDataCenter(_zoneId); cmd.setPod(""); cmd.setPrivateIpAddress(_ip); cmd.setStorageIpAddress(""); cmd.setVersion(""); cmd.setGuid(_guid);
throw new ConfigurationException("Unable to retrieve the storage layer."); } ConfigurationDao configDao = locator.getDao(ConfigurationDao.class); if (configDao == null) { throw new ConfigurationException("Unable to get the configuration dao."); } final Map<String, String> configs = configDao.getConfiguration("UpgradeManager", params); File agentUpgradeFile = PropertiesUtil.findConfigFile("agent-update.properties"); Properties agentUpgradeProps = new Properties(); try { if (agentUpgradeFile != null) { agentUpgradeProps.load(new FileInputStream(agentUpgradeFile)); } _minimalVersion = agentUpgradeProps.getProperty("agent.minimal.version"); _recommendedVersion = agentUpgradeProps.getProperty("agent.recommended.version");
_inclZones = (String)params.get("inclZones"); _exclZones = (String)params.get("exclZones"); return true; } catch (Exception e) { throw new ConfigurationException(e.getMessage()); } } @Override public StartupCommand[] initialize() { StartupTrafficMonitorCommand cmd = new StartupTrafficMonitorCommand(); cmd.setName(_name); cmd.setDataCenter(_zoneId); cmd.setPod(""); cmd.setPrivateIpAddress(_ip); cmd.setStorageIpAddress(""); cmd.setVersion(TrafficSentinelResource.class.getPackage().getImplementationVersion()); cmd.setGuid(_guid);
public void rename(Name oldName, Name newName) throws NamingException { rename(StringUtil.safeToString(oldName), StringUtil.safeToString(newName)); } public void rename(String oldName, String newName) throws NamingException { throw new ConfigurationException("rename(" + oldName + " => " + newName + ") N/A"); } public NamingEnumeration<NameClassPair> list(Name name) throws NamingException { return list(StringUtil.safeToString(name)); } public NamingEnumeration<NameClassPair> list(String name) throws NamingException { throw new ConfigurationException("list(" + name + ") N/A"); } public NamingEnumeration<Binding> listBindings(Name name) throws NamingException {