Skip to content

Commit

Permalink
Introduce new Service Discovery model (#4223)
Browse files Browse the repository at this point in the history
  • Loading branch information
mercyblitz authored and chickenlj committed Jun 17, 2019
1 parent 7f7a289 commit 5fb8dc0
Show file tree
Hide file tree
Showing 195 changed files with 14,252 additions and 3,100 deletions.
34 changes: 34 additions & 0 deletions dubbo-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,23 @@
<optional>true</optional>
</dependency>

<!-- 2.7.3 new modules -->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-event</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-metadata</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>

<!-- Transitive dependencies -->
<dependency>
<groupId>org.springframework</groupId>
Expand Down Expand Up @@ -639,6 +656,10 @@
<include>org.apache.dubbo:dubbo-metadata-report-nacos</include>
<include>org.apache.dubbo:dubbo-serialization-native-hession</include>
<include>org.apache.dubbo:dubbo-rpc-native-thrift</include>

<!-- 2.7.3 new modules -->
<include>org.apache.dubbo:dubbo-event</include>
<include>org.apache.dubbo:dubbo-metadata</include>
</includes>
</artifactSet>
<transformers>
Expand Down Expand Up @@ -764,6 +785,19 @@
<resource>META-INF/dubbo/internal/org.apache.dubbo.metadata.store.MetadataReportFactory
</resource>
</transformer>
<!-- @since 2.7.3 -->
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/dubbo/internal/org.apache.dubbo.event.EventDispatcher
</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/dubbo/internal/org.apache.dubbo.metadata.MetadataServiceExporter
</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/dubbo/internal/org.apache.dubbo.metadata.LocalMetadataService
</resource>
</transformer>
</transformers>
<filters>
<filter>
Expand Down
94 changes: 94 additions & 0 deletions dubbo-bootstrap/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-parent</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>dubbo-bootstrap</artifactId>
<packaging>jar</packaging>

<name>dubbo-bootstrap</name>
<description>The bootstrap module of Dubbo project</description>

<dependencies>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-config-api</artifactId>
<version>${project.parent.version}</version>
</dependency>

<!-- Test dependencies -->

<!-- Zookeeper dependencies for testing -->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-registry-zookeeper</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-configcenter-zookeeper</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>

<!-- Nacos dependencies for testing -->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-registry-nacos</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-configcenter-nacos</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-rpc-dubbo</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-remoting-netty4</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-serialization-hessian2</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-test</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dubbo.bootstrap;

/**
* Abstract {@link Settings}
*
* @since 2.7.3
*/
public class AbstractSettings implements Settings {

private final DubboBootstrap dubboBootstrap;

public AbstractSettings(DubboBootstrap dubboBootstrap) {
this.dubboBootstrap = dubboBootstrap;
}

@Override
public DubboBootstrap next() {
return dubboBootstrap;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dubbo.bootstrap;

import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.MonitorConfig;
import org.apache.dubbo.config.builders.ApplicationBuilder;

import java.util.Map;

/**
* {@link ApplicationConfig Application} settings
*
* @since 2.7.3
*/
public class ApplicationSettings extends AbstractSettings {

private final ApplicationBuilder builder;

public ApplicationSettings(ApplicationBuilder builder, DubboBootstrap dubboBootstrap) {
super(dubboBootstrap);
this.builder = builder;
}

public ApplicationSettings version(String version) {
builder.version(version);
return this;
}

public ApplicationSettings owner(String owner) {
builder.owner(owner);
return this;
}

public ApplicationSettings organization(String organization) {
builder.organization(organization);
return this;
}

public ApplicationSettings architecture(String architecture) {
builder.architecture(architecture);
return this;
}

public ApplicationSettings environment(String environment) {
builder.environment(environment);
return this;
}

public ApplicationSettings compiler(String compiler) {
builder.compiler(compiler);
return this;
}

public ApplicationSettings logger(String logger) {
builder.logger(logger);
return this;
}

public ApplicationSettings monitor(MonitorConfig monitor) {
builder.monitor(monitor);
return this;
}

public ApplicationSettings monitor(String monitor) {
builder.monitor(monitor);
return this;
}

public ApplicationSettings isDefault(Boolean isDefault) {
builder.isDefault(isDefault);
return this;
}

public ApplicationSettings dumpDirectory(String dumpDirectory) {
builder.dumpDirectory(dumpDirectory);
return this;
}

public ApplicationSettings qosEnable(Boolean qosEnable) {
builder.qosEnable(qosEnable);
return this;
}

public ApplicationSettings qosPort(Integer qosPort) {
builder.qosPort(qosPort);
return this;
}

public ApplicationSettings qosAcceptForeignIp(Boolean qosAcceptForeignIp) {
builder.qosAcceptForeignIp(qosAcceptForeignIp);
return this;
}

public ApplicationSettings shutwait(String shutwait) {
builder.shutwait(shutwait);
return this;
}

public ApplicationSettings appendParameter(String key, String value) {
builder.appendParameter(key, value);
return this;
}

public ApplicationSettings appendParameters(Map<String, String> appendParameters) {
builder.appendParameters(appendParameters);
return this;
}

ApplicationConfig build() {
return builder.build();
}
}

0 comments on commit 5fb8dc0

Please sign in to comment.