diff --git a/.github/workflows/arklet_unit_test.yml b/.github/workflows/arklet_unit_test.yml
index ef8b4c4b5..2a33e6769 100644
--- a/.github/workflows/arklet_unit_test.yml
+++ b/.github/workflows/arklet_unit_test.yml
@@ -48,7 +48,12 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- name: Test
- run: mvn test
+ run: mvn clean install -DskipTests -Dmaven.javadoc.skip=true -B -U
+ && sh ./check_format.sh
+ && mvn test
+
+ - name: Codecov
+ uses: codecov/codecov-action@v1
- name: Setup Java JDK
uses: actions/setup-java@v3.12.0
@@ -57,4 +62,6 @@ jobs:
java-version: 17
- name: Test
- run: mvn test
+ run: mvn clean install -DskipTests -Dmaven.javadoc.skip=true -B -U
+ && sh ./check_format.sh
+ && mvn test
diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml
new file mode 100644
index 000000000..349d41e3c
--- /dev/null
+++ b/.github/workflows/codecov.yml
@@ -0,0 +1,53 @@
+- name: Codecov
+ # You may pin to the exact commit or the version.
+ # uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b
+ uses: codecov/codecov-action@v2.1.0
+ with:
+ # Repository upload token - get it from codecov.io. Required only for private repositories
+ token: # optional
+ # Comma-separated list of files to upload
+ files: # optional
+ # Directory to search for coverage reports.
+ directory: # optional
+ # Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)
+ flags: # optional
+ # The commit SHA of the parent for which you are uploading coverage. If not present, the parent will be determined using the API of your repository provider. When using the repository providers API, the parent is determined via finding the closest ancestor to the commit.
+ commit_parent: # optional
+ # Don't upload files to Codecov
+ dry_run: # optional
+ # Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON)
+ env_vars: # optional
+ # Specify whether or not CI build should fail if Codecov runs into an error during upload
+ fail_ci_if_error: # optional
+ # Path to coverage file to upload
+ file: # optional
+ # Comma-separated list, see the README for options and their usage
+ functionalities: # optional
+ # Move discovered coverage reports to the trash
+ move_coverage_to_trash: # optional
+ # User defined upload name. Visible in Codecov UI
+ name: # optional
+ # Specify the branch name
+ override_branch: # optional
+ # Specify the build number
+ override_build: # optional
+ # Specify the commit SHA
+ override_commit: # optional
+ # Specify the pull request number
+ override_pr: # optional
+ # Specify the git tag
+ override_tag: # optional
+ # Override the assumed OS. Options are alpine | linux | macos | windows.
+ os: # optional
+ # Used when not in git/hg project to identify project root directory
+ root_dir: # optional
+ # Specify the slug manually (Enterprise use)
+ slug: # optional
+ # Change the upload host (Enterprise use)
+ url: # optional
+ # Specify whether the Codecov output should be verbose
+ verbose: # optional
+ # Specify which version of the Codecov Uploader should be used. Defaults to `latest`
+ version: # optional
+ # Directory in which to execute codecov.sh
+ working-directory: # optional
diff --git a/.gitignore b/.gitignore
index b371359e7..1502572ea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
-
+vendor
target/
*.iml
.idea/
@@ -8,3 +8,4 @@ pom.xml.bak
.classpath
*.log
logs/
+.flattened-pom.xml
\ No newline at end of file
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 000000000..b9a3f9d55
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,46 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hting1@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
+
+[homepage]: http://contributor-covenant.org
+[version]: http://contributor-covenant.org/version/1/4/
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 000000000..f83487c7f
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,39 @@
+
+## Contributing to SOFAArk
+SOFAArk is released under the Apache 2.0 license, and follows a very
+standard Github development process, using Github tracker for issues and
+merging pull requests into master . If you would like to contribute something,
+or simply want to hack on the code this document should help you get started.
+
+### Sign the Contributor License Agreement
+Before we accept a non-trivial patch or pull request we will need you to
+sign the Contributor License Agreement. Signing the contributor’s agreement
+does not grant anyone commit rights to the main repository, but it does mean
+that we can accept your contributions, and you will get an author credit if
+we do. Active contributors might be asked to join the core team, and given
+the ability to merge pull requests.
+
+### Code Conventions
+None of these is essential for a pull request, but they will all help.
+
+1. we provided a [code formatter file](./Formatter.xml), it will formatting automatically your project when during process of building. We would check code format when run ci test, so please ensure that you have built project before you push branch.
+
+2. Make sure all new `.java` files to have a simple Javadoc class comment
+with at least an `@author` tag identifying you, and preferably at least a
+paragraph on what the class is for.
+
+3. Add the ASF license header comment to all new `.java` files (copy from existing files in the project)
+
+4. Add yourself as an `@author` to the `.java` files that you modify substantially (more than cosmetic changes).
+
+5. Add some Javadocs.
+
+6. A few unit tests would help a lot as well — someone has to do it.
+
+7. When writing a commit message please follow [these conventions](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html), if
+you are fixing an existing issue please add Fixes gh-XXXX at the end
+of the commit message (where XXXX is the issue number).
+
+8. Ensure that code coverage does not decrease。
+
+9. Contribute a PR as the rule of Gitflow Workflow; SOFAArk's version contains three digit, the first one is for compatibility; the second one is for new features and enhancement; the last one is for bug fix.
diff --git a/README.md b/README.md
index a355e6cac..a67042564 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,8 @@
+[![Coverage Status](https://codecov.io/gh/sofastack/sofa-serverless/branch/master/graph/badge.svg)](https://codecov.io/gh/sofastack/sofa-serverless/branch/master/graph/badge.svg)
+![license](https://img.shields.io/badge/license-Apache--2.0-green.svg)
+
+[//]: # (![maven](https://img.shields.io/nexus/r/https/oss.sonatype.org/com.alipay.sofa/sofa-ark-all.svg))
+
Welcome to SOFAServerless open source comminity. SOFAServerless is a modularization application architecture patterns for company business rapid development, operation, evolution and cooperation with low cost. Please watch us or join us in DingDing Group: 24970018417 .
欢迎来到 SOFAServerless 开源社区。SOFAServerless 是一种模块化的应用架构模式,能够帮助大中小企业低成本地实现极速研发、运维、微服务演进和人员协作,从而为企业实现降本增效。欢迎加入钉钉群关注我们或者与我们一起共建面向普通应用低成本接入的 Serverless 解决方案。钉钉群号:24970018417 。
diff --git a/arklet/Formatter.xml b/arklet/Formatter.xml
new file mode 100644
index 000000000..1dc905447
--- /dev/null
+++ b/arklet/Formatter.xml
@@ -0,0 +1,278 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HEADER b/arklet/HEADER
similarity index 100%
rename from HEADER
rename to arklet/HEADER
diff --git a/arklet/arklet-core/pom.xml b/arklet/arklet-core/pom.xml
index 5f0535b95..cbc7434de 100644
--- a/arklet/arklet-core/pom.xml
+++ b/arklet/arklet-core/pom.xml
@@ -4,8 +4,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
arklet
- com.alipay.sofa
- 1.0.0-SNAPSHOT
+ com.alipay.sofa.serverless
+ ${revision}../pom.xml4.0.0
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/ArkletComponent.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/ArkletComponent.java
index 62c8a78e4..bb469bc2d 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/ArkletComponent.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/ArkletComponent.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core;
/**
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/ArkletComponentRegistry.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/ArkletComponentRegistry.java
index 57d943002..6e00bd619 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/ArkletComponentRegistry.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/ArkletComponentRegistry.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core;
import java.util.ArrayList;
@@ -25,12 +41,13 @@
*/
public class ArkletComponentRegistry {
- private static final ArkletLogger LOGGER = ArkletLoggerFactory.getDefaultLogger();
+ private static final ArkletLogger LOGGER = ArkletLoggerFactory
+ .getDefaultLogger();
private static final List componentList = new ArrayList<>(8);
- private final AtomicBoolean init = new AtomicBoolean(false);
- private final AtomicBoolean destroy = new AtomicBoolean(false);
+ private final AtomicBoolean init = new AtomicBoolean(false);
+ private final AtomicBoolean destroy = new AtomicBoolean(false);
- private static final Injector componentInjector;
+ private static final Injector componentInjector;
static {
componentInjector = Guice.createInjector(new ComponentGuiceModule());
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/ApiClient.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/ApiClient.java
index 2bc62bade..9274b4561 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/ApiClient.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/ApiClient.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.api;
import java.util.ArrayList;
@@ -24,17 +40,15 @@
@Singleton
public class ApiClient implements ArkletComponent {
-
private static final List tunnelList = new ArrayList<>(8);
@Inject
- private CommandService commandService;
+ private CommandService commandService;
static {
Injector injector = Guice.createInjector(new TunnelGuiceModule());
- for (Binding binding : injector
- .findBindingsByType(new TypeLiteral() {
- })) {
+ for (Binding binding : injector.findBindingsByType(new TypeLiteral() {
+ })) {
tunnelList.add(binding.getProvider().get());
}
}
@@ -61,8 +75,8 @@ public List getTunnels() {
private static class TunnelGuiceModule extends AbstractModule {
@Override
protected void configure() {
- Multibinder tunnelMultibinder = Multibinder.newSetBinder(binder(),
- Tunnel.class);
+ Multibinder tunnelMultibinder = Multibinder
+ .newSetBinder(binder(), Tunnel.class);
tunnelMultibinder.addBinding().to(HttpTunnel.class);
}
}
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/model/Response.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/model/Response.java
index eefbab2d4..567214b5e 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/model/Response.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/model/Response.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.api.model;
import com.alipay.sofa.serverless.arklet.core.command.meta.Output;
@@ -16,12 +32,12 @@ public class Response {
/**
* message
*/
- private String message;
+ private String message;
/**
* data
*/
- private Object data;
+ private Object data;
public static Response fromCommandOutput(Output output) {
Response response = new Response();
@@ -59,7 +75,6 @@ public static Response internalError(String message) {
return response;
}
-
public String getMessage() {
return message;
}
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/model/ResponseCode.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/model/ResponseCode.java
index 2c0985a02..047707347 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/model/ResponseCode.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/model/ResponseCode.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.api.model;
/**
@@ -6,10 +22,7 @@
*/
public enum ResponseCode {
- SUCCESS(200),
- FAILED(400),
- CMD_NOT_FOUND(404),
- CMD_PROCESS_INTERNAL_ERROR(500);
+ SUCCESS(200), FAILED(400), CMD_NOT_FOUND(404), CMD_PROCESS_INTERNAL_ERROR(500);
private final int code;
ResponseCode(int code) {
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/tunnel/Tunnel.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/tunnel/Tunnel.java
index e704c1ea4..257c8222f 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/tunnel/Tunnel.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/tunnel/Tunnel.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.api.tunnel;
import com.alipay.sofa.serverless.arklet.core.command.CommandService;
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/tunnel/http/HttpTunnel.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/tunnel/http/HttpTunnel.java
index aa3a18982..a8964e53d 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/tunnel/http/HttpTunnel.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/tunnel/http/HttpTunnel.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.api.tunnel.http;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -22,16 +38,17 @@
@Singleton
public class HttpTunnel implements Tunnel {
- private static final ArkletLogger LOGGER = ArkletLoggerFactory.getDefaultLogger();
- private final static String HTTP_PORT_ATTRIBUTE = "sofa.serverless.arklet.http.port";
- private int port = -1;
- private final static int DEFAULT_HTTP_PORT = 1238;
- private final static int DEFAULT_SELECT_PORT_SIZE = 100;
- private NettyHttpServer nettyHttpServer;
- private final AtomicBoolean shutdown = new AtomicBoolean(false);
- private final AtomicBoolean init = new AtomicBoolean(false);
- private final AtomicBoolean run = new AtomicBoolean(false);
- private CommandService commandService;
+ private static final ArkletLogger LOGGER = ArkletLoggerFactory
+ .getDefaultLogger();
+ private final static String HTTP_PORT_ATTRIBUTE = "sofa.serverless.arklet.http.port";
+ private int port = -1;
+ private final static int DEFAULT_HTTP_PORT = 1238;
+ private final static int DEFAULT_SELECT_PORT_SIZE = 100;
+ private NettyHttpServer nettyHttpServer;
+ private final AtomicBoolean shutdown = new AtomicBoolean(false);
+ private final AtomicBoolean init = new AtomicBoolean(false);
+ private final AtomicBoolean run = new AtomicBoolean(false);
+ private CommandService commandService;
@Override
public void init(CommandService commandService) {
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/tunnel/http/netty/NettyHttpServer.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/tunnel/http/netty/NettyHttpServer.java
index 33528c3db..dcd707b78 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/tunnel/http/netty/NettyHttpServer.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/tunnel/http/netty/NettyHttpServer.java
@@ -64,10 +64,10 @@
@SuppressWarnings("unchecked")
public class NettyHttpServer {
- private final int port;
+ private final int port;
private final EventLoopGroup bossGroup;
private final EventLoopGroup workerGroup;
- private Channel channel;
+ private Channel channel;
private final CommandService commandService;
@@ -82,7 +82,8 @@ public void open() throws InterruptedException {
ServerBootstrap serverBootstrap = new ServerBootstrap();
serverBootstrap.option(ChannelOption.SO_BACKLOG, 1024);
serverBootstrap.group(bossGroup, workerGroup).channel(NioServerSocketChannel.class)
- .handler(new LoggingHandler(LogLevel.INFO)).childHandler(new NettyHttpInitializer(commandService));
+ .handler(new LoggingHandler(LogLevel.INFO))
+ .childHandler(new NettyHttpInitializer(commandService));
channel = serverBootstrap.bind(port).sync().channel();
}
@@ -122,7 +123,7 @@ public NettyHttpHandler(CommandService commandService) {
@Override
protected void channelRead0(ChannelHandlerContext ctx, FullHttpRequest request)
- throws Exception {
+ throws Exception {
try {
RequestValidation validation = validate(request);
if (!validation.isPass()) {
@@ -131,7 +132,8 @@ protected void channelRead0(ChannelHandlerContext ctx, FullHttpRequest request)
if (!validation.isCmdSupported()) {
returnResponse(ctx, Response.notFound());
}
- Output> output = commandService.process(validation.getCmd(), validation.getCmdContent());
+ Output> output = commandService.process(validation.getCmd(),
+ validation.getCmdContent());
Response response = Response.fromCommandOutput(output);
returnResponse(ctx, response);
}
@@ -157,10 +159,9 @@ private RequestValidation validate(FullHttpRequest request) throws IOException {
}
private void returnResponse(ChannelHandlerContext ctx, Response response) {
- DefaultFullHttpResponse httpResponse = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1,
- HttpResponseStatus.OK,
- Unpooled.copiedBuffer(JSONObject.toJSONString(response),
- CharsetUtil.UTF_8));
+ DefaultFullHttpResponse httpResponse = new DefaultFullHttpResponse(
+ HttpVersion.HTTP_1_1, HttpResponseStatus.OK, Unpooled.copiedBuffer(
+ JSONObject.toJSONString(response), CharsetUtil.UTF_8));
ChannelFuture future = ctx.writeAndFlush(httpResponse);
future.addListener(ChannelFutureListener.CLOSE);
}
@@ -173,8 +174,8 @@ private void ret404(ChannelHandlerContext ctx) {
private void ret500(ChannelHandlerContext ctx, String message) {
FullHttpResponse httpResponse = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1,
- HttpResponseStatus.INTERNAL_SERVER_ERROR, Unpooled.copiedBuffer(
- message, CharsetUtil.UTF_8));
+ HttpResponseStatus.INTERNAL_SERVER_ERROR, Unpooled.copiedBuffer(message,
+ CharsetUtil.UTF_8));
httpResponse.headers().set("Content_Length", httpResponse.content().readableBytes());
ChannelFuture future = ctx.writeAndFlush(httpResponse);
future.addListener(ChannelFutureListener.CLOSE);
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/tunnel/http/netty/RequestValidation.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/tunnel/http/netty/RequestValidation.java
index 10c053221..5159898f4 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/tunnel/http/netty/RequestValidation.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/api/tunnel/http/netty/RequestValidation.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.api.tunnel.http.netty;
import java.util.Map;
@@ -7,10 +23,10 @@
* @date 2023/6/19
*/
public class RequestValidation {
- private boolean pass;
- private String message;
- private boolean cmdSupported;
- private String cmd;
+ private boolean pass;
+ private String message;
+ private boolean cmdSupported;
+ private String cmd;
private Map cmdContent;
public RequestValidation() {
@@ -23,7 +39,8 @@ public static RequestValidation notPass(String message) {
return validation;
}
- public static RequestValidation passed(boolean cmdSupported, String cmd, Map cmdContent) {
+ public static RequestValidation passed(boolean cmdSupported, String cmd,
+ Map cmdContent) {
RequestValidation validation = new RequestValidation();
validation.pass = true;
validation.cmdSupported = cmdSupported;
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/CommandService.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/CommandService.java
index c3b606253..3be3f3dd0 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/CommandService.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/CommandService.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command;
import java.util.List;
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/CommandServiceImpl.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/CommandServiceImpl.java
index cf1bab1ee..27e7e4eda 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/CommandServiceImpl.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/CommandServiceImpl.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command;
import java.util.ArrayList;
@@ -29,20 +45,24 @@
* @author mingmen
* @date 2023/6/8
*/
-@SuppressWarnings({"rawtypes", "unchecked"})
+@SuppressWarnings({ "rawtypes", "unchecked" })
@Singleton
public class CommandServiceImpl implements CommandService {
- private static final ArkletLogger LOGGER = ArkletLoggerFactory.getDefaultLogger();
+ private static final ArkletLogger LOGGER = ArkletLoggerFactory
+ .getDefaultLogger();
private final Map handlerMap = new ConcurrentHashMap<>(16);
@Override
public void registerCommandHandler(AbstractCommandHandler handler) {
- AssertUtils.isTrue(StringUtil.isNotBlank(handler.command().getId()), "command handler id should not be blank");
- AssertUtils.isTrue(StringUtil.isNotBlank(handler.command().getDesc()), "command handler desc should not be blank");
+ AssertUtils.isTrue(StringUtil.isNotBlank(handler.command().getId()),
+ "command handler id should not be blank");
+ AssertUtils.isTrue(StringUtil.isNotBlank(handler.command().getDesc()),
+ "command handler desc should not be blank");
if (handlerMap.containsKey(handler.command().getId())) {
- throw new ArkletInitException("handler id (" + handler.command().getId() + ") duplicated");
+ throw new ArkletInitException("handler id (" + handler.command().getId()
+ + ") duplicated");
}
handlerMap.put(handler.command().getId(), handler);
LOGGER.info("registered command:{}", handler.command().getId());
@@ -59,7 +79,8 @@ public void destroy() {
}
@Override
- public Output> process(String cmd, Map content) throws CommandValidationException, CommandMutexException {
+ public Output> process(String cmd, Map content) throws CommandValidationException,
+ CommandMutexException {
AbstractCommandHandler handler = getHandler(cmd);
InputMeta input = toJavaBean(handler.getInputClass(), content);
handler.validate(input);
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/BuiltinCommand.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/BuiltinCommand.java
index a7ff7d1bb..20a41f6b4 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/BuiltinCommand.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/BuiltinCommand.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command.builtin;
import com.alipay.sofa.serverless.arklet.core.command.meta.Command;
@@ -8,21 +24,15 @@
*/
public enum BuiltinCommand implements Command {
- HELP("help",
- "list all supported commands"),
+ HELP("help", "list all supported commands"),
- INSTALL_BIZ("installBiz",
- "install one ark biz"),
+ INSTALL_BIZ("installBiz", "install one ark biz"),
- UNINSTALL_BIZ("uninstallBiz",
- "uninstall one ark biz"),
+ UNINSTALL_BIZ("uninstallBiz", "uninstall one ark biz"),
- SWITCH_BIZ("switchBiz",
- "switch one ark biz"),
+ SWITCH_BIZ("switchBiz", "switch one ark biz"),
- QUERY_ALL_BIZ("queryAllBiz",
- "query all ark biz(including master biz)"
- );
+ QUERY_ALL_BIZ("queryAllBiz", "query all ark biz(including master biz)");
private final String id;
private final String desc;
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/HelpHandler.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/HelpHandler.java
index 634b59a3e..fa54697a8 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/HelpHandler.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/HelpHandler.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command.builtin.handler;
import java.util.ArrayList;
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/InstallBizHandler.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/InstallBizHandler.java
index 956eec128..0ee6b888c 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/InstallBizHandler.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/InstallBizHandler.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command.builtin.handler;
import java.util.Set;
@@ -26,13 +42,20 @@ public class InstallBizHandler extends AbstractCommandHandler> handle(Input input) {
- boolean conflict = BizCommandCoordinator.existBizProcessing(input.getBizName(), input.getBizVersion());
+ boolean conflict = BizCommandCoordinator.existBizProcessing(input.getBizName(),
+ input.getBizVersion());
if (conflict) {
- return Output.ofFailed(ResponseCode.FAILED.name() + ":" + String.format("%s install conflict, exist unfinished command for this biz",
- BizIdentityUtils.generateBizIdentity(input.getBizName(), input.getBizVersion())));
+ return Output
+ .ofFailed(ResponseCode.FAILED.name()
+ + ":"
+ + String.format(
+ "%s install conflict, exist unfinished command for this biz",
+ BizIdentityUtils.generateBizIdentity(input.getBizName(),
+ input.getBizVersion())));
}
try {
- BizCommandCoordinator.putBizExecution(input.getBizName(), input.getBizVersion(), command());
+ BizCommandCoordinator.putBizExecution(input.getBizName(), input.getBizVersion(),
+ command());
String bizFile = input.getArkBizFilePath();
ClientResponse res = getOperationService().install(bizFile);
if (ResponseCode.SUCCESS.equals(res.getCode())) {
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/QueryAllBizHandler.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/QueryAllBizHandler.java
index cd2c507ba..d2b00c23e 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/QueryAllBizHandler.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/QueryAllBizHandler.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command.builtin.handler;
import java.util.ArrayList;
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/SwitchBizHandler.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/SwitchBizHandler.java
index c3505071c..a2406f1be 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/SwitchBizHandler.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/SwitchBizHandler.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command.builtin.handler;
import com.alipay.sofa.ark.api.ClientResponse;
@@ -24,13 +40,21 @@ public class SwitchBizHandler extends AbstractCommandHandler {
@Override
public Output handle(Input input) {
try {
- boolean conflict = BizCommandCoordinator.existBizProcessing(input.getBizName(), input.getBizVersion());
+ boolean conflict = BizCommandCoordinator.existBizProcessing(input.getBizName(),
+ input.getBizVersion());
if (conflict) {
- return Output.ofFailed(ResponseCode.FAILED.name() + ":" + String.format("%s switch conflict, exist unfinished command for this biz",
- BizIdentityUtils.generateBizIdentity(input.getBizName(), input.getBizVersion())));
+ return Output
+ .ofFailed(ResponseCode.FAILED.name()
+ + ":"
+ + String.format(
+ "%s switch conflict, exist unfinished command for this biz",
+ BizIdentityUtils.generateBizIdentity(input.getBizName(),
+ input.getBizVersion())));
}
- BizCommandCoordinator.putBizExecution(input.getBizName(), input.getBizVersion(), command());
- ClientResponse res = getOperationService().switchBiz(input.getBizName(), input.getBizVersion());
+ BizCommandCoordinator.putBizExecution(input.getBizName(), input.getBizVersion(),
+ command());
+ ClientResponse res = getOperationService().switchBiz(input.getBizName(),
+ input.getBizVersion());
if (ResponseCode.SUCCESS.equals(res.getCode())) {
return Output.ofSuccess(null);
} else {
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/UninstallBizHandler.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/UninstallBizHandler.java
index 9ebc5f8f9..f90da4891 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/UninstallBizHandler.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/UninstallBizHandler.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command.builtin.handler;
import com.alipay.sofa.ark.api.ClientResponse;
@@ -24,13 +40,21 @@ public class UninstallBizHandler extends AbstractCommandHandler {
@Override
public Output handle(Input input) {
try {
- boolean conflict = BizCommandCoordinator.existBizProcessing(input.getBizName(), input.getBizVersion());
+ boolean conflict = BizCommandCoordinator.existBizProcessing(input.getBizName(),
+ input.getBizVersion());
if (conflict) {
- return Output.ofFailed(ResponseCode.FAILED.name() + ":" + String.format("%s uninstall conflict, exist unfinished command for this biz",
- BizIdentityUtils.generateBizIdentity(input.getBizName(), input.getBizVersion())));
+ return Output
+ .ofFailed(ResponseCode.FAILED.name()
+ + ":"
+ + String.format(
+ "%s uninstall conflict, exist unfinished command for this biz",
+ BizIdentityUtils.generateBizIdentity(input.getBizName(),
+ input.getBizVersion())));
}
- BizCommandCoordinator.putBizExecution(input.getBizName(), input.getBizVersion(), command());
- ClientResponse res = getOperationService().uninstall(input.getBizName(), input.getBizVersion());
+ BizCommandCoordinator.putBizExecution(input.getBizName(), input.getBizVersion(),
+ command());
+ ClientResponse res = getOperationService().uninstall(input.getBizName(),
+ input.getBizVersion());
if (ResponseCode.SUCCESS.equals(res.getCode())) {
return Output.ofSuccess(null);
} else {
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/model/BizModel.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/model/BizModel.java
index a031d42f1..5cd4f36af 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/model/BizModel.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/model/BizModel.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command.builtin.model;
import com.alipay.sofa.ark.spi.model.BizState;
@@ -7,15 +23,15 @@
* @date 2023/6/14
*/
public class BizModel {
- private String bizName;
+ private String bizName;
- private String bizVersion;
+ private String bizVersion;
private BizState bizState;
- private String mainClass;
+ private String mainClass;
- private String webContextPath;
+ private String webContextPath;
public String getBizName() {
return bizName;
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/model/CommandModel.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/model/CommandModel.java
index e66319a4a..a3d0f9085 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/model/CommandModel.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/model/CommandModel.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command.builtin.model;
/**
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/coordinate/BizCommandCoordinator.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/coordinate/BizCommandCoordinator.java
index b7d0ff6e6..726fc0368 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/coordinate/BizCommandCoordinator.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/coordinate/BizCommandCoordinator.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command.coordinate;
import java.util.Map;
@@ -17,7 +33,9 @@ public class BizCommandCoordinator {
public static void putBizExecution(String bizName, String bizVersion, Command command) {
String identity = BizIdentityUtils.generateBizIdentity(bizName, bizVersion);
if (bizIdentityLockMap.containsKey(identity)) {
- throw new CommandMutexException("biz {} execution meet mutex lock, conflict command:%s is processing and not finish yet", identity, bizIdentityLockMap.get(identity));
+ throw new CommandMutexException(
+ "biz {} execution meet mutex lock, conflict command:%s is processing and not finish yet",
+ identity, bizIdentityLockMap.get(identity));
}
bizIdentityLockMap.put(identity, command);
}
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/coordinate/CommandMutexException.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/coordinate/CommandMutexException.java
index fcbea8dc0..0275e5881 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/coordinate/CommandMutexException.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/coordinate/CommandMutexException.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command.coordinate;
import com.alipay.sofa.serverless.arklet.core.common.exception.ArkletRuntimeException;
@@ -23,7 +39,7 @@ public CommandMutexException(Throwable cause) {
}
public CommandMutexException(String message, Throwable cause, boolean enableSuppression,
- boolean writableStackTrace) {
+ boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/coordinate/CoordinatorConfig.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/coordinate/CoordinatorConfig.java
index 6e76b78ac..adbbe786c 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/coordinate/CoordinatorConfig.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/coordinate/CoordinatorConfig.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command.coordinate;
import java.util.ArrayList;
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/coordinate/ExecutionLock.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/coordinate/ExecutionLock.java
index 2a26eb17f..caa29866b 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/coordinate/ExecutionLock.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/coordinate/ExecutionLock.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command.coordinate;
import com.alipay.sofa.serverless.arklet.core.command.meta.Command;
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/AbstractCommandHandler.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/AbstractCommandHandler.java
index 68147830a..8364e741d 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/AbstractCommandHandler.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/AbstractCommandHandler.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command.meta;
import java.lang.reflect.ParameterizedType;
@@ -16,42 +32,44 @@
@SuppressWarnings("unchecked")
public abstract class AbstractCommandHandler
{
- private final UnifiedOperationService unifiedOperationService = ArkletComponentRegistry.getOperationServiceInstance();
- private final CommandService commandService = ArkletComponentRegistry.getCommandServiceInstance();
+ private final UnifiedOperationService unifiedOperationService = ArkletComponentRegistry
+ .getOperationServiceInstance();
+ private final CommandService commandService = ArkletComponentRegistry
+ .getCommandServiceInstance();
public abstract void validate(P p) throws CommandValidationException;
+
public abstract Output handle(P p);
+
public abstract Command command();
public UnifiedOperationService getOperationService() {
return unifiedOperationService;
}
+
public CommandService getCommandService() {
return commandService;
}
-
public Class
) parameterizedType.getActualTypeArguments()[0];
}
public static void isTrue(final boolean expression, final String message,
- final Object... values) {
+ final Object... values) {
if (!expression) {
throw new CommandValidationException(String.format(message, values));
}
}
- public static void notBlank(final String check, final String message,
- final Object... values) {
+ public static void notBlank(final String check, final String message, final Object... values) {
if (StringUtil.isBlank(check)) {
throw new CommandValidationException(String.format(message, values));
}
}
- public static void notNull(final Object check, final String message,
- final Object... values) {
+ public static void notNull(final Object check, final String message, final Object... values) {
if (null == check) {
throw new CommandValidationException(String.format(message, values));
}
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/Command.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/Command.java
index 325a3193a..ba016f9c2 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/Command.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/Command.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command.meta;
/**
@@ -7,5 +23,6 @@
public interface Command {
String getId();
+
String getDesc();
}
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/CommandType.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/CommandType.java
index 168845064..a38724736 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/CommandType.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/CommandType.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command.meta;
/**
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/InputMeta.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/InputMeta.java
index b6edd24c4..642856bc8 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/InputMeta.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/InputMeta.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command.meta;
/**
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/Output.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/Output.java
index 398cdfa8e..2bd95a24d 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/Output.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/meta/Output.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command.meta;
import com.alipay.sofa.serverless.arklet.core.api.model.ResponseCode;
@@ -9,9 +25,8 @@
public class Output {
private ResponseCode code;
- private String message;
- private T data;
-
+ private String message;
+ private T data;
private Output() {
}
@@ -23,7 +38,6 @@ public static Output ofSuccess(T data) {
return output;
}
-
public static Output ofFailed(String message) {
Output output = new Output<>();
output.code = ResponseCode.FAILED;
@@ -31,7 +45,6 @@ public static Output ofFailed(String message) {
return output;
}
-
public String getMessage() {
return message;
}
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/exception/ArkletException.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/exception/ArkletException.java
index b33848abe..e3afed07a 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/exception/ArkletException.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/exception/ArkletException.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.common.exception;
/**
@@ -20,7 +36,8 @@ public ArkletException(Throwable cause) {
super(cause);
}
- public ArkletException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+ public ArkletException(String message, Throwable cause, boolean enableSuppression,
+ boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/exception/ArkletInitException.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/exception/ArkletInitException.java
index 45293837b..976ebab07 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/exception/ArkletInitException.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/exception/ArkletInitException.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.common.exception;
/**
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/exception/ArkletRuntimeException.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/exception/ArkletRuntimeException.java
index 37843d31c..7f86664c1 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/exception/ArkletRuntimeException.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/exception/ArkletRuntimeException.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.common.exception;
/**
@@ -21,7 +37,7 @@ public ArkletRuntimeException(Throwable cause) {
}
public ArkletRuntimeException(String message, Throwable cause, boolean enableSuppression,
- boolean writableStackTrace) {
+ boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/exception/CommandValidationException.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/exception/CommandValidationException.java
index 66b953e2c..a5c5c2e5f 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/exception/CommandValidationException.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/exception/CommandValidationException.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.common.exception;
/**
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/log/ArkletLoggerFactory.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/log/ArkletLoggerFactory.java
index dbf218247..d39e3ad5a 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/log/ArkletLoggerFactory.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/common/log/ArkletLoggerFactory.java
@@ -30,7 +30,7 @@ public class ArkletLoggerFactory {
private static final String ARKLET_DEFAULT_LOGGER_NAME = "com.alipay.sofa.arklet";
- public static ArkletLogger defaultLogger = getLogger(ARKLET_DEFAULT_LOGGER_NAME);
+ public static ArkletLogger defaultLogger = getLogger(ARKLET_DEFAULT_LOGGER_NAME);
public static ArkletLogger getLogger(Class> clazz) {
if (clazz == null) {
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/ops/UnifiedOperationService.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/ops/UnifiedOperationService.java
index a128c21b5..15692aae4 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/ops/UnifiedOperationService.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/ops/UnifiedOperationService.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.ops;
import java.util.List;
diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/ops/UnifiedOperationServiceImpl.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/ops/UnifiedOperationServiceImpl.java
index eed85e510..5ccf3100c 100644
--- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/ops/UnifiedOperationServiceImpl.java
+++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/ops/UnifiedOperationServiceImpl.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.ops;
import java.util.List;
@@ -28,7 +44,8 @@ public void destroy() {
}
public ClientResponse install(String bizPath) throws Throwable {
- BizOperation bizOperation = new BizOperation().setOperationType(BizOperation.OperationType.INSTALL);
+ BizOperation bizOperation = new BizOperation()
+ .setOperationType(BizOperation.OperationType.INSTALL);
bizOperation.putParameter(Constants.CONFIG_BIZ_URL, "file://" + bizPath);
return ArkClient.installOperation(bizOperation);
}
diff --git a/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/command/CommandTest.java b/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/command/CommandTest.java
index f8c0d03ad..ce170dad7 100644
--- a/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/command/CommandTest.java
+++ b/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/command/CommandTest.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command;
import com.alipay.sofa.serverless.arklet.core.ArkletComponentRegistry;
@@ -14,8 +30,10 @@ public class CommandTest {
public void registerCustomCommand() {
ArkletComponentRegistry registry = new ArkletComponentRegistry();
registry.initComponents();
- ArkletComponentRegistry.getCommandServiceInstance().registerCommandHandler(new CustomCommandHandler());
- CustomCommandHandler handler = (CustomCommandHandler)ArkletComponentRegistry.getCommandServiceInstance().getHandler(CustomCommand.HELLO);
+ ArkletComponentRegistry.getCommandServiceInstance().registerCommandHandler(
+ new CustomCommandHandler());
+ CustomCommandHandler handler = (CustomCommandHandler) ArkletComponentRegistry
+ .getCommandServiceInstance().getHandler(CustomCommand.HELLO);
Assert.assertNotNull(handler);
}
}
diff --git a/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/command/CustomCommand.java b/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/command/CustomCommand.java
index 2515df21d..0b492d74b 100644
--- a/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/command/CustomCommand.java
+++ b/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/command/CustomCommand.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command;
import com.alipay.sofa.serverless.arklet.core.command.meta.Command;
diff --git a/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/command/CustomCommandHandler.java b/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/command/CustomCommandHandler.java
index 56e644233..844c005b7 100644
--- a/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/command/CustomCommandHandler.java
+++ b/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/command/CustomCommandHandler.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command;
import com.alipay.sofa.ark.common.util.StringUtils;
diff --git a/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/command/Input.java b/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/command/Input.java
index c5acc6500..b514db043 100644
--- a/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/command/Input.java
+++ b/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/command/Input.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.command;
import com.alipay.sofa.serverless.arklet.core.command.meta.InputMeta;
@@ -7,6 +23,6 @@
* @date 2023/8/6
*/
public class Input extends InputMeta {
- public int id;
+ public int id;
public String userName;
}
diff --git a/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/component/ComponentRegistryTest.java b/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/component/ComponentRegistryTest.java
index ddc4d4966..0f867c726 100644
--- a/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/component/ComponentRegistryTest.java
+++ b/arklet/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/component/ComponentRegistryTest.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.core.component;
import com.alipay.sofa.serverless.arklet.core.ArkletComponentRegistry;
diff --git a/arklet/arklet-springboot-starter/pom.xml b/arklet/arklet-springboot-starter/pom.xml
index 82aa1ca81..b057e37ba 100644
--- a/arklet/arklet-springboot-starter/pom.xml
+++ b/arklet/arklet-springboot-starter/pom.xml
@@ -4,8 +4,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
arklet
- com.alipay.sofa
- 1.0.0-SNAPSHOT
+ com.alipay.sofa.serverless
+ ${revision}../pom.xml4.0.0
@@ -19,7 +19,7 @@
- com.alipay.sofa
+ com.alipay.sofa.serverlessarklet-core
@@ -72,7 +72,7 @@
com.alipay.sofasofa-ark-springboot-starter
- 2.1.3
+ ${sofa.ark.version}test
diff --git a/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/ArkletAutoConfiguration.java b/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/ArkletAutoConfiguration.java
index 0fbe30e63..0fa060ea6 100644
--- a/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/ArkletAutoConfiguration.java
+++ b/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/ArkletAutoConfiguration.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.springboot.starter;
import com.alipay.sofa.serverless.arklet.core.ArkletComponentRegistry;
@@ -29,5 +45,4 @@ public MasterBizCmdHandlerCollector masterBizCmdHandlerCollector() {
return new MasterBizCmdHandlerCollector();
}
-
}
diff --git a/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/command/MasterBizCmdHandlerCollector.java b/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/command/MasterBizCmdHandlerCollector.java
index 144497b5f..26350db33 100644
--- a/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/command/MasterBizCmdHandlerCollector.java
+++ b/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/command/MasterBizCmdHandlerCollector.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.springboot.starter.command;
import java.util.Map;
diff --git a/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/environment/ConditionalOnMasterBiz.java b/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/environment/ConditionalOnMasterBiz.java
index a75e8d56e..e908c6be4 100644
--- a/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/environment/ConditionalOnMasterBiz.java
+++ b/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/environment/ConditionalOnMasterBiz.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.springboot.starter.environment;
import java.lang.annotation.Documented;
diff --git a/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/environment/OnMasterBiz.java b/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/environment/OnMasterBiz.java
index ccfd02e5b..6926ef024 100644
--- a/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/environment/OnMasterBiz.java
+++ b/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/environment/OnMasterBiz.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.springboot.starter.environment;
import org.springframework.boot.autoconfigure.condition.ConditionOutcome;
@@ -16,7 +32,8 @@ public class OnMasterBiz extends SpringBootCondition {
@Override
public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) {
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
- if (contextClassLoader == null || BIZ_CLASSLOADER.equals(contextClassLoader.getClass().getName())) {
+ if (contextClassLoader == null
+ || BIZ_CLASSLOADER.equals(contextClassLoader.getClass().getName())) {
return new ConditionOutcome(false, "Current context classloader is biz classloader.");
}
return new ConditionOutcome(true, "Current context classloader is not biz classloader.");
diff --git a/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/listener/ArkletApplicationListener.java b/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/listener/ArkletApplicationListener.java
index d45bb5360..6e35bf087 100644
--- a/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/listener/ArkletApplicationListener.java
+++ b/arklet/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/listener/ArkletApplicationListener.java
@@ -1,3 +1,19 @@
+/*
+ * 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 com.alipay.sofa.serverless.arklet.springboot.starter.listener;
import java.util.List;
@@ -21,9 +37,10 @@
@SuppressWarnings("rawtypes")
public class ArkletApplicationListener implements ApplicationListener {
- private static final ArkletLogger LOGGER = ArkletLoggerFactory.getDefaultLogger();
+ private static final ArkletLogger LOGGER = ArkletLoggerFactory.getDefaultLogger();
- private final CommandService commandService = ArkletComponentRegistry.getCommandServiceInstance();
+ private final CommandService commandService = ArkletComponentRegistry
+ .getCommandServiceInstance();
@Override
public void onApplicationEvent(ApplicationContextEvent event) {
diff --git a/arklet/check_format.sh b/arklet/check_format.sh
new file mode 100644
index 000000000..061d8e8f0
--- /dev/null
+++ b/arklet/check_format.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+BASEDIR=$(dirname $0)
+
+cd ${BASEDIR}
+
+# make sure git has no un commit files
+if [ -n "$(git status --untracked-files=no --porcelain)" ]; then
+ echo "Please commit your change before run this shell, un commit files:"
+ git status --untracked-files=no --porcelain
+ echo "Please run ## mvn clean install -DskipTests -Dmaven.javadoc.skip=true -B -U && sh ./check_format.sh ## locally, then push it."
+ exit -1
+fi
\ No newline at end of file
diff --git a/arklet/pom.xml b/arklet/pom.xml
index d5ee24dfd..0ecacd631 100644
--- a/arklet/pom.xml
+++ b/arklet/pom.xml
@@ -2,32 +2,375 @@
-
- com.alipay.sofa
- sofa-serverless
- 1.0.0-SNAPSHOT
- ../pom.xml
-
+ com.alipay.sofa.serverless
+ arklet
+ ${revision}4.0.0pom
- arklet
+
+ 1.0.0-SNAPSHOT
+ UTF-8
+ UTF-8
+ 1.8
+ 3.0
+ 0.4
+ 3.1
+ 3.0.0
+ 3.2.0
+ 1.6.7
+ 1.5
+ 0.8.4
+ 8
+ 8
+ 4.0
+ 4.1.42.Final
+ 1.2.9
+ 1.18.22
+ 4.13.1
+ 1.5.0
+ 2.1.3
+
+
+ ${project.groupId}:${project.artifactId}
+ todo
+ https://github.com/sofastack/sofa-serverless/arkletarklet-corearklet-springboot-starter
+
+
+ The Apache License, Version 2.0
+ http://www.apache.org/licenses/LICENSE-2.0.txt
+
+
+
+
com.alipay.sofa
+ sofa-ark-api
+ ${sofa.ark.version}
+
+
+
+ com.google.inject
+ guice
+ ${guice.version}
+
+
+
+ com.google.inject.extensions
+ guice-multibindings
+ ${guice.version}
+
+
+
+ com.google.guava
+ guava
+ 16.0.1
+
+
+
+ com.alibaba
+ fastjson
+ 1.2.69
+
+
+
+ io.netty
+ netty-all
+ ${netty.version}
+
+
+
+ ch.qos.logback
+ logback-classic
+ ${logback.version}
+
+
+
+ ch.qos.logback
+ logback-core
+ ${logback.version}
+
+
+
+ org.projectlombok
+ lombok
+ ${lombok.version}
+
+
+
+ junit
+ junit
+ ${junit.version}
+
+
+ com.alipay.sofa.serverlessarklet-core
- 1.0.0-SNAPSHOT
+ ${revision}
+
+
+ com.alipay.sofa.serverless
+ arklet-alipay-sofa-boot-starter
+ ${revision}
+
+
+
+ com.mycila
+ license-maven-plugin
+ ${license.maven.plugin}
+
+
+ generate-sources
+
+ remove
+ format
+
+
+
+
+ true
+ ${user.dir}/HEADER
+
+ **/src/main/java/**
+ **/src/test/java/**
+
+ true
+
+ SLASHSTAR_STYLE
+
+
+
+
+
+ com.googlecode.maven-java-formatter-plugin
+ maven-java-formatter-plugin
+ ${maven.java.formatter.plugin}
+
+
+
+ format
+
+
+
+
+ ${user.dir}/Formatter.xml
+ ${project.encoding}
+
+
+
+
+ org.codehaus.mojo
+ flatten-maven-plugin
+ ${flatten-maven-plugin.version}
+
+
+ flatten
+ process-resources
+
+ flatten
+
+
+
+ flatten.clean
+ clean
+
+ clean
+
+
+
+ true
+
+
+ true
+ resolveCiFriendliesOnly
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ ${maven.compiler.plugin}
+
+ ${project.encoding}
+
+ ${java.version}
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ ${maven.source.plugin}
+
+
+ attach-sources
+
+ jar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.jacoco
+ jacoco-maven-plugin
+ ${jacoco.maven.plugin}
+
+ false
+
+
+
+ default-prepare-agent
+
+ prepare-agent
+
+
+
+ default-report
+ test
+
+ report-aggregate
+
+
+
+
+
+
+
+
+
+
+ release
+
+
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+ ${maven.staging.plugin}
+ true
+
+ ossrh
+ https://oss.sonatype.org/
+ false
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ ${maven.gpg.pluign}
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+
+
+
+ ossrh
+ https://oss.sonatype.org/service/local/staging/deploy/maven2/
+
+
+
+
+
+ snapshot
+
+
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+ ${maven.staging.plugin}
+ true
+
+ ossrh
+ https://oss.sonatype.org/
+ false
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ ${maven.gpg.pluign}
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+
+
+
+ ossrh
+ https://oss.sonatype.org/content/repositories/snapshots
+
+
+
+
+ default
+
+ true
+
+
+
+
+ true
+
+ maven-snapshot
+ https://oss.sonatype.org/content/repositories/snapshots
+
+
+
+
+
+ true
+
+ maven-snapshot
+ https://oss.sonatype.org/content/repositories/snapshots
+
+
+
+
\ No newline at end of file
diff --git a/codecov.yml b/codecov.yml
new file mode 100644
index 000000000..f3dd810a8
--- /dev/null
+++ b/codecov.yml
@@ -0,0 +1,2 @@
+ignore:
+ - "pom.xml"
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 36c82a8e3..000000000
--- a/pom.xml
+++ /dev/null
@@ -1,343 +0,0 @@
-
-
- 4.0.0
-
- com.alipay.sofa
- sofa-serverless
- 1.0.0-SNAPSHOT
- pom
-
-
- arklet
-
-
-
- UTF-8
- UTF-8
- 1.8
- 3.0
- 0.4
- 3.1
- 3.0.0
- 3.2.0
- 1.6.7
- 1.5
- 0.8.4
- 8
- 8
- 4.0
- 4.1.42.Final
- 1.2.9
- 1.18.12
- 4.13.1
-
-
- ${project.groupId}:${project.artifactId}
- todo
- https://github.com/sofastack/sofa-serverless
-
-
-
- The Apache License, Version 2.0
- http://www.apache.org/licenses/LICENSE-2.0.txt
-
-
-
-
-
-
-
-
- com.alipay.sofa
- arklet
- 1.0.0-SNAPSHOT
-
-
-
-
- com.alipay.sofa
- sofa-ark-api
- 2.1.3
-
-
-
- com.google.inject
- guice
- ${guice.version}
-
-
-
- com.google.inject.extensions
- guice-multibindings
- ${guice.version}
-
-
-
- com.google.guava
- guava
- 16.0.1
-
-
-
- com.alibaba
- fastjson
- 1.2.69
-
-
-
- io.netty
- netty-all
- ${netty.version}
-
-
-
- ch.qos.logback
- logback-classic
- ${logback.version}
-
-
-
- ch.qos.logback
- logback-core
- ${logback.version}
-
-
-
- org.projectlombok
- lombok
- ${lombok.version}
-
-
-
- junit
- junit
- ${junit.version}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- ${maven.compiler.plugin}
-
- ${project.encoding}
-
- ${java.version}
-
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- ${maven.source.plugin}
-
-
- attach-sources
-
- jar
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- org.jacoco
- jacoco-maven-plugin
- ${jacoco.maven.plugin}
-
- false
-
-
-
- default-prepare-agent
-
- prepare-agent
-
-
-
- default-report
- test
-
- report-aggregate
-
-
-
-
-
-
-
-
-
-
- release
-
-
-
- org.sonatype.plugins
- nexus-staging-maven-plugin
- ${maven.staging.plugin}
- true
-
- ossrh
- https://oss.sonatype.org/
- false
-
-
-
- org.apache.maven.plugins
- maven-gpg-plugin
- ${maven.gpg.pluign}
-
-
- sign-artifacts
- verify
-
- sign
-
-
-
-
-
-
-
-
- ossrh
- https://oss.sonatype.org/service/local/staging/deploy/maven2/
-
-
-
-
-
- snapshot
-
-
-
- org.sonatype.plugins
- nexus-staging-maven-plugin
- ${maven.staging.plugin}
- true
-
- ossrh
- https://oss.sonatype.org/
- false
-
-
-
- org.apache.maven.plugins
- maven-gpg-plugin
- ${maven.gpg.pluign}
-
-
- sign-artifacts
- verify
-
- sign
-
-
-
-
-
-
-
-
- ossrh
- https://oss.sonatype.org/content/repositories/snapshots
-
-
-
-
-
- default
-
- true
-
-
-
-
- true
-
- maven-snapshot
- https://oss.sonatype.org/content/repositories/snapshots
-
-
-
-
-
- true
-
- maven-snapshot
- https://oss.sonatype.org/content/repositories/snapshots
-
-
-
-
-
-