Package org.switchyard.config

Examples of org.switchyard.config.Configuration


        return _produce;
    }

    @Override
    public URI getComponentURI() {
        Configuration modelConfiguration = getModelConfiguration();
        List<Configuration> children = modelConfiguration.getChildren();

        QueryString queryString = new QueryString();
        traverseConfiguration(children, queryString, HOST, PORT);

        String protocol = isReferenceBinding() ?  getProducer().getProtocol() : getConsumer().getProtocol();
View Full Code Here


    public SCAActivator(Configuration environment) {
        super(TYPES);
       
        // Determine the cache name
        String cacheName = "cluster";
        Configuration cacheNameConfig = environment.getFirstChild(CACHE_NAME_PROPERTY);
        if (cacheNameConfig != null) {
            cacheName = cacheNameConfig.getValue();
        }
       
        // If a cache config is specified in the component configuration, then we
        // are managing the creation of the cache.  If not, then we look up a
        // cache manager and try to resolve the cache.
        Configuration cacheFileConfig = environment.getFirstChild(CACHE_CONFIG_PROPERTY);
        if (cacheFileConfig != null && cacheFileConfig.getValue() != null) {
            Configuration jgroupsConfig = environment.getFirstChild(JGROUPS_CONFIG_PROPERTY);
            createCache(cacheFileConfig.getValue(), cacheName, jgroupsConfig != null ? jgroupsConfig.getValue() : null);
        } else {
            lookupCache(cacheName);
        }
       
        // Configure a registry client to use the specified cache
        if (_cache != null) {
            _registry = new InfinispanRegistry(_cache);
        } else {
            SCALogger.ROOT_LOGGER.unableToResolveCacheContainer(cacheName);
        }

        Configuration bridgeRemoteTxConfig = environment.getFirstChild(DISABLE_REMOTE_TRANSACTION_PROPERTY);
        if (bridgeRemoteTxConfig != null) {
            _disableRemoteTransaction = Boolean.parseBoolean(bridgeRemoteTxConfig.getValue());
        }
    }
View Full Code Here

    }

    @Override
    public AdditionalUriParametersModel getAdditionalUriParameters() {
        if (_additionalUriParameters == null) {
            Configuration config = getModelConfiguration().getFirstChild(
                    AdditionalUriParametersModel.ADDITIONAL_URI_PARAMETERS);
            if (config == null) {
                return null;
            }
            _additionalUriParameters = new V1AdditionalUriParametersModel(config, getModelDescriptor());
View Full Code Here

        return _additionalUriParameters;
    }

    @Override
    public CamelBindingModel setAdditionalUriParameters(AdditionalUriParametersModel parameters) {
        Configuration config = getModelConfiguration().getFirstChild(
                AdditionalUriParametersModel.ADDITIONAL_URI_PARAMETERS);
        if (config != null) {
            // set an existing config value
            getModelConfiguration().removeChildren(AdditionalUriParametersModel.ADDITIONAL_URI_PARAMETERS);
            getModelConfiguration().addChild(((V1AdditionalUriParametersModel) parameters).getModelConfiguration());
View Full Code Here

            List<String> excludes) {

        if (parent.size() != 0) {
            Iterator<Configuration> parentIterator = parent.iterator();
            while (parentIterator.hasNext()) {
                Configuration child = parentIterator.next();

                if (child == null || child.getName() == null || excludes.contains(child.getName())) {
                    continue;
                }

                if (child.getChildren().size() == 0) {
                    queryString.add(child.getName(), UnsafeUriCharactersEncoder.encode(child.getValue()));
                    excludes.add(child.getName());
                } else {
                    traverseConfigurationInternal(child.getChildren(), queryString, excludes);
                }
            }
        }
    }
View Full Code Here

            }
        }
    }

    protected <T extends Model> T replaceChildren(String children, T model) {
        Configuration config = getModelConfiguration().getFirstChild(children);
        if (config != null) {
            // set an existing config value
            getModelConfiguration().removeChildren(children);
            getModelConfiguration().addChild(model.getModelConfiguration());
        } else {
View Full Code Here

            }
        }
    }

    protected final String getConfig(String configName) {
        Configuration config = getModelConfiguration().getFirstChild(configName);
        if (config != null) {
            return config.getValue();
        } else {
            return null;
        }
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    protected <X extends V1BaseCamelBindingModel> X setConfig(String name, Object value) {
        String modelValue = String.valueOf(value);
        Configuration config = getModelConfiguration().getFirstChild(name);
        if (config != null) {
            // set an existing config value
            config.setValue(modelValue);
        } else {
            // create the config model and set the value
            NameValueModel model = new NameValueModel(getNamespaceURI(), name);
            model.setValue(modelValue);
            setChildModel(model);
View Full Code Here

            }
        }
    }

    protected final String getConfig(String configName) {
        Configuration config = getModelConfiguration().getFirstChild(configName);
        if (config != null) {
            return config.getValue();
        } else {
            return null;
        }
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    protected <X extends V1BaseCamelModel> X setConfig(String name, Object value) {
        String modelValue = String.valueOf(value);
        Configuration config = getModelConfiguration().getFirstChild(name);
        if (config != null) {
            // set an existing config value
            config.setValue(modelValue);
        } else {
            // create the config model and set the value
            NameValueModel model = new NameValueModel(getNamespaceURI(), name);
            model.setValue(modelValue);
            setChildModel(model);
View Full Code Here

TOP

Related Classes of org.switchyard.config.Configuration

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.