forked from apache/dubbo
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Polish apache#4265 : [Feature] Dubbo Cloud Native - Add Bootstrap
- Loading branch information
1 parent
18b69f2
commit 0dcd960
Showing
23 changed files
with
2,240 additions
and
47 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
dubbo-bootstrap/src/main/java/org/apache/dubbo/bootstrap/AbstractSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
127 changes: 127 additions & 0 deletions
127
dubbo-bootstrap/src/main/java/org/apache/dubbo/bootstrap/ApplicationSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
Oops, something went wrong.