Package org.osgi.service.cm

Examples of org.osgi.service.cm.ConfigurationException


    public void updated(Dictionary properties) throws ConfigurationException {
        // First check whether all mandatory configuration keys are available...
        String useAuth = getProperty(properties, KEY_USE_AUTHENTICATION);
        if (useAuth == null || !("true".equalsIgnoreCase(useAuth) || "false".equalsIgnoreCase(useAuth))) {
            throw new ConfigurationException(KEY_USE_AUTHENTICATION, "Missing or invalid value!");
        }

        // Note that configuration changes are only applied to new work areas, started after the
        // configuration was changed. No attempt is done to "fix" existing work areas, although we
        // might consider flushing/invalidating them.
View Full Code Here


                if (backup != null) {
                    m_cachedRepository = new CachedRepositoryImpl(m_directRepository, backup, CachedRepositoryImpl.UNCOMMITTED_VERSION);
                }
            }
            catch (IllegalArgumentException e) {
                throw new ConfigurationException("Authentication", e.getMessage());
            }
            catch (MalformedURLException mue) {
                throw new ConfigurationException(URL, mue.getMessage());
            }
            catch (IOException e) {
                m_log.log(LogService.LOG_WARNING, "Unable to create temporary files for FilebasedBackupRepository");
            }
        }
View Full Code Here

     * Convenience method for getting settings from a configuration dictionary.
     */
    private String getNotNull(Dictionary settings, String id, String errorMessage) throws ConfigurationException {
        String result = (String) settings.get(id);
        if (result == null) {
            throw new ConfigurationException(id, errorMessage);
        }
        return result;
    }
View Full Code Here

            synchronized (m_credentialMapping) {
                m_credentialMapping.put(pid, creds);
            }
        }
        catch (MissingValueException e) {
            throw new ConfigurationException(e.getProperty(), e.getMessage());
        }
    }
View Full Code Here

    private void setup(Dictionary properties) throws ConfigurationException {
        synchronized (LOCK) {
            m_redirectURL = (String) properties.get(REDIRECT_URL_KEY);
            m_sourceURL = (String) properties.get(HttpConstants.ENDPOINT);
            if (m_sourceURL == null) {
                throw new ConfigurationException(HttpConstants.ENDPOINT, "needs to be specified");
            }
            if (m_redirectURL == null) {
                throw new ConfigurationException(REDIRECT_URL_KEY, "needs to be specified");
            }
        }
    }
View Full Code Here

    }

    public synchronized void updated(String pid, Dictionary dict) throws ConfigurationException {
        String name = (String) dict.get(LOG_NAME);
        if ((name == null) || "".equals(name)) {
            throw new ConfigurationException(LOG_NAME, "Log name has to be specified.");
        }

        Component service = (Component) m_logInstances.get(pid);
        if (service == null) {
            // publish log service
View Full Code Here

    public synchronized void updated(String pid, Dictionary dict) throws ConfigurationException {
        String name = (String) dict.get(LOG_NAME);
        String ma = (String) dict.get(MA_NAME);
        if ((name == null) || "".equals(name)) {
            throw new ConfigurationException(LOG_NAME, "Log name has to be specified.");
        }

        Component service = (Component) m_syncInstances.get(pid);
        if (service == null) {
            // publish log sync task service
View Full Code Here

    @SuppressWarnings("unchecked")
    public void updated(String pid, Dictionary dict) throws ConfigurationException {
        String name = (String) dict.get(KEY_LOG_NAME);
        if ((name == null) || "".equals(name)) {
            throw new ConfigurationException(KEY_LOG_NAME, "Log name has to be specified.");
        }
       
        String useAuthString = (String) dict.get(KEY_USE_AUTHENTICATION);
        if (useAuthString == null
            || !("true".equalsIgnoreCase(useAuthString) || "false".equalsIgnoreCase(useAuthString))) {
            throw new ConfigurationException(KEY_USE_AUTHENTICATION, "Missing or invalid value!");
        }
        boolean useAuth = Boolean.parseBoolean(useAuthString);

        Component service = m_instances.get(pid);
        if (service == null) {
View Full Code Here

    }

    public synchronized void updated(String pid, Dictionary dict) throws ConfigurationException {
        String name = (String) dict.get(KEY_LOG_NAME);
        if ((name == null) || "".equals(name)) {
            throw new ConfigurationException(KEY_LOG_NAME, "Log name has to be specified.");
        }
        Mode mode = Mode.PUSH;
        String modeValue = (String) dict.get(KEY_MODE);
        if ("pull".equals(modeValue)) {
          mode = Mode.PULL;
View Full Code Here

    @SuppressWarnings("unchecked")
    public synchronized void updated(String pid, Dictionary dict) throws ConfigurationException {
        String name = (String) dict.get(LOG_NAME);
        if ((name == null) || "".equals(name)) {
            throw new ConfigurationException(LOG_NAME, "Log name has to be specified.");
        }

        Component service = m_instances.get(pid);
        if (service == null) {
            Properties props = new Properties();
View Full Code Here

TOP

Related Classes of org.osgi.service.cm.ConfigurationException

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.