Examples of RegistryConfig


Examples of com.alibaba.dubbo.config.RegistryConfig

    @Test
    public void testGenericServiceConfig() throws Exception {
        ServiceConfig<GenericService> service = new ServiceConfig<GenericService>();
        service.setApplication(new ApplicationConfig("test"));
        service.setRegistry(new RegistryConfig("mock://localhost"));
        service.setInterface(DemoService.class.getName());
        service.setGeneric(Constants.GENERIC_SERIALIZATION_BEAN);
        service.setRef(new GenericService(){

            public Object $invoke(String method, String[] parameterTypes, Object[] args) throws GenericException {
View Full Code Here

Examples of com.alibaba.dubbo.config.RegistryConfig

                    String value = element.getAttribute(property);
                    if (value != null) {
                      value = value.trim();
                      if (value.length() > 0) {
                        if ("registry".equals(property) && RegistryConfig.NO_AVAILABLE.equalsIgnoreCase(value)) {
                              RegistryConfig registryConfig = new RegistryConfig();
                              registryConfig.setAddress(RegistryConfig.NO_AVAILABLE);
                              beanDefinition.getPropertyValues().addPropertyValue(property, registryConfig);
                            } else if ("registry".equals(property) && value.indexOf(',') != -1) {
                          parseMultiRef("registries", value, beanDefinition, parserContext);
                            } else if ("provider".equals(property) && value.indexOf(',') != -1) {
                              parseMultiRef("providers", value, beanDefinition, parserContext);
View Full Code Here

Examples of com.alibaba.dubbo.config.RegistryConfig

                    String value = element.getAttribute(property);
                    if (value != null) {
                      value = value.trim();
                      if (value.length() > 0) {
                        if ("registry".equals(property) && RegistryConfig.NO_AVAILABLE.equalsIgnoreCase(value)) {
                              RegistryConfig registryConfig = new RegistryConfig();
                              registryConfig.setAddress(RegistryConfig.NO_AVAILABLE);
                              beanDefinition.getPropertyValues().addPropertyValue(property, registryConfig);
                            } else if ("registry".equals(property) && value.indexOf(',') != -1) {
                          parseMultiRef("registries", value, beanDefinition, parserContext);
                            } else if ("provider".equals(property) && value.indexOf(',') != -1) {
                              parseMultiRef("providers", value, beanDefinition, parserContext);
View Full Code Here

Examples of com.alibaba.dubbo.config.RegistryConfig

                    String value = element.getAttribute(property);
                    if (value != null) {
                      value = value.trim();
                      if (value.length() > 0) {
                        if ("registry".equals(property) && RegistryConfig.NO_AVAILABLE.equalsIgnoreCase(value)) {
                              RegistryConfig registryConfig = new RegistryConfig();
                              registryConfig.setAddress(RegistryConfig.NO_AVAILABLE);
                              beanDefinition.getPropertyValues().addPropertyValue(property, registryConfig);
                            } else if ("registry".equals(property) && value.indexOf(',') != -1) {
                          parseMultiRef("registries", value, beanDefinition, parserContext);
                            } else if ("provider".equals(property) && value.indexOf(',') != -1) {
                              parseMultiRef("providers", value, beanDefinition, parserContext);
View Full Code Here

Examples of org.apache.tuscany.sca.endpoint.hazelcast.RegistryConfig

        }
    }

    private void initHazelcastClientInstance() {
        this.properties = registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(RuntimeProperties.class).getProperties();
        RegistryConfig rc = new RegistryConfig(properties);
        if (rc.getWKAs().size() < 1) {
            String ip = getDefaultWKA();
            if (ip != null) {
                rc.getWKAs().add(ip);
            }
        }
        if (rc.getWKAs().size() < 1) {
            throw new IllegalArgumentException("Must specify remote IP address(es) for domain");
        }
        this.domainURI = properties.getProperty("defaultDomainName", "default");
        this.hazelcastClient = HazelcastClient.newHazelcastClient(rc.getUserid(), rc.getPassword(), rc.getWKAs().toArray(new String[0]));
    }
View Full Code Here

Examples of org.wso2.carbon.application.deployer.config.RegistryConfig

                sgMetadata.setServices(services.toArray(new String[services.size()]));
                serviceGroups.add(sgMetadata);

            } else if (RegistryResourceDeployer.REGISTRY_RESOURCE_TYPE.equals(type)) {
                // Create a Registry config metadata instance
                RegistryConfig regConf = artifact.getRegConfig();
                if (regConf == null) {
                    regConf = readRegConfig(currentApplication.getAppName(), artifact.getName());
                }
                if (regConf == null) {
                    continue;
                }
                artifact.setRegConfig(regConf);
                RegistryMetadata regMeta = new RegistryMetadata();
                regMeta.setArtifactName(artifact.getName());

                List<String> resources = new ArrayList<String>();
                List<String> collections = new ArrayList<String>();
                List<Association> associations = new ArrayList<Association>();

                // add resources
                for (RegistryConfig.Resourse resourse : regConf.getResources()) {
                    resources.add(resourse.getPath() + "/" + resourse.getFileName());
                }
                // add collections
                for (RegistryConfig.Collection collection : regConf.getCollections()) {
                    collections.add(collection.getPath());
                }
                // add associations
                for (RegistryConfig.Association association : regConf.getAssociations()) {
                    Association assoMeta = new Association(association.getSourcePath(),
                            association.getTargetPath());
                    associations.add(assoMeta);
                }
View Full Code Here

Examples of org.wso2.carbon.application.deployer.config.RegistryConfig

        }
        return artifactType;
    }

    private RegistryConfig readRegConfig(String parentAppName, String artifactName) {
        RegistryConfig regConfig = null;
        try {
            CarbonAppPersistenceManager capm = new CarbonAppPersistenceManager(getAxisConfig());
            regConfig = capm.loadRegistryConfig(AppDeployerConstants.APPLICATIONS + parentAppName +
                                    AppDeployerConstants.APP_DEPENDENCIES + artifactName);
        } catch (Exception e) {
View Full Code Here

Examples of org.wso2.carbon.application.deployer.config.RegistryConfig

    private void deployRegistryArtifacts(CarbonAppPersistenceManager capm,
                                         List<Artifact> artifacts, String parentAppName) {
        for (Artifact artifact : artifacts) {
            if (REGISTRY_RESOURCE_TYPE.equals(artifact.getType())) {
                try {
                    RegistryConfig regConfig = buildRegistryConfig(artifact);
                    if (regConfig != null) {
                        capm.writeArtifactResources(regConfig);
                        capm.persistRegConfig(AppDeployerConstants.APPLICATIONS +
                                parentAppName + AppDeployerConstants.APP_DEPENDENCIES +
                                artifact.getName(), regConfig);
View Full Code Here

Examples of org.wso2.carbon.application.deployer.config.RegistryConfig

     *
     * @param artifact - Registry/Resource artifact
     * @return - RegistryConfig instance
     */
    private RegistryConfig buildRegistryConfig(Artifact artifact) {
        RegistryConfig regConfig = null;
        // get the file path of the registry config file
        List<CappFile> files = artifact.getFiles();
        if (files.size() == 1) {
            String fileName = artifact.getFiles().get(0).getName();
            String regConfigPath = artifact.getExtractedPath() +
                    File.separator + fileName;

            File f = new File(regConfigPath);
            if (f.exists()) {
                // read the reg config file and build the configuration
                InputStream xmlInputStream = null;
                try {
                    xmlInputStream = new FileInputStream(f);
                    regConfig = AppDeployerUtils.populateRegistryConfig(
                            new StAXOMBuilder(xmlInputStream).getDocumentElement());
                } catch (Exception e) {
                    log.error("Error while reading file : " + fileName, e);
                } finally {
                    if (xmlInputStream != null) {
                        try {
                            xmlInputStream.close();
                        } catch (IOException e) {
                            log.error("Error while closing input stream.", e);
                        }
                    }
                }

                if (regConfig != null) {
                    regConfig.setExtractedPath(artifact.getExtractedPath());
                    regConfig.setParentArtifactName(artifact.getName());
                    regConfig.setConfigFileName(fileName);
                }
            } else {
                log.error("Registry config file not found at : " + regConfigPath);
            }
        } else {
View Full Code Here

Examples of org.wso2.carbon.application.deployer.config.RegistryConfig

     * @param artifactPath - registry path of the "registry/resource" artifact
     * @return - RegistryConfig instance built
     * @throws Exception - on registry errors
     */
    public RegistryConfig loadRegistryConfig(String artifactPath) throws Exception {
        RegistryConfig regConfig = null;
        String regConfigPath = artifactPath + AppDeployerConstants.REG_CONFIG_XML;
        if (configRegistry.resourceExists(regConfigPath)) {
            Resource artifactResource = configRegistry.get(regConfigPath);
            InputStream xmlStream = artifactResource.getContentStream();
            if (xmlStream != null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.