From f3ecaec08b701856a5a050293c6542a81ffbaa23 Mon Sep 17 00:00:00 2001
From: peng-yongsheng <8082209@qq.com>
Date: Thu, 26 Oct 2017 22:03:21 +0800
Subject: [PATCH] define naming module.
---
.../apm/collector/cluster/ClusterModule.java | 7 ++-
.../collector-naming-define/pom.xml | 33 ++++++++++++
.../apm/collector/naming/NamingModule.java | 38 ++++++++++++++
...kywalking.apm.collector.core.module.Module | 19 +++++++
.../collector-naming-jetty-provider/pom.xml | 45 ++++++++++++++++
.../jetty/NamingModuleJettyProvider.java | 51 +++++++++++++++++++
...g.apm.collector.core.module.ModuleProvider | 19 +++++++
apm-collector/apm-collector-naming/pom.xml | 13 ++++-
8 files changed, 222 insertions(+), 3 deletions(-)
create mode 100644 apm-collector/apm-collector-naming/collector-naming-define/pom.xml
create mode 100644 apm-collector/apm-collector-naming/collector-naming-define/src/main/java/org/skywalking/apm/collector/naming/NamingModule.java
create mode 100644 apm-collector/apm-collector-naming/collector-naming-define/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.Module
create mode 100644 apm-collector/apm-collector-naming/collector-naming-jetty-provider/pom.xml
create mode 100644 apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/java/org/skywalking/apm/collector/naming/jetty/NamingModuleJettyProvider.java
create mode 100644 apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.ModuleProvider
diff --git a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/skywalking/apm/collector/cluster/ClusterModule.java b/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/skywalking/apm/collector/cluster/ClusterModule.java
index f6963c24d..9d0952aa7 100644
--- a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/skywalking/apm/collector/cluster/ClusterModule.java
+++ b/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/skywalking/apm/collector/cluster/ClusterModule.java
@@ -18,6 +18,7 @@
package org.skywalking.apm.collector.cluster;
+import org.skywalking.apm.collector.cluster.service.ModuleRegisterService;
import org.skywalking.apm.collector.core.module.Module;
import org.skywalking.apm.collector.core.module.Service;
@@ -26,11 +27,13 @@ import org.skywalking.apm.collector.core.module.Service;
*/
public class ClusterModule extends Module {
+ public static final String NAME = "Cluster";
+
@Override public String name() {
- return "Cluster";
+ return NAME;
}
@Override public Class extends Service>[] services() {
- return new Class[0];
+ return new Class[] {ModuleRegisterService.class};
}
}
diff --git a/apm-collector/apm-collector-naming/collector-naming-define/pom.xml b/apm-collector/apm-collector-naming/collector-naming-define/pom.xml
new file mode 100644
index 000000000..0a47a1fc8
--- /dev/null
+++ b/apm-collector/apm-collector-naming/collector-naming-define/pom.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+ apm-collector-naming
+ org.skywalking
+ 3.2.3-2017
+
+ 4.0.0
+
+ collector-naming-define
+ jar
+
+
\ No newline at end of file
diff --git a/apm-collector/apm-collector-naming/collector-naming-define/src/main/java/org/skywalking/apm/collector/naming/NamingModule.java b/apm-collector/apm-collector-naming/collector-naming-define/src/main/java/org/skywalking/apm/collector/naming/NamingModule.java
new file mode 100644
index 000000000..460ca0ad8
--- /dev/null
+++ b/apm-collector/apm-collector-naming/collector-naming-define/src/main/java/org/skywalking/apm/collector/naming/NamingModule.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2017, OpenSkywalking Organization All rights reserved.
+ *
+ * Licensed 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.
+ *
+ * Project repository: https://github.com/OpenSkywalking/skywalking
+ */
+
+package org.skywalking.apm.collector.naming;
+
+import org.skywalking.apm.collector.core.module.Module;
+import org.skywalking.apm.collector.core.module.Service;
+
+/**
+ * @author peng-yongsheng
+ */
+public class NamingModule extends Module {
+
+ public static final String NAME = "Naming";
+
+ @Override public String name() {
+ return NAME;
+ }
+
+ @Override public Class extends Service>[] services() {
+ return new Class[0];
+ }
+}
diff --git a/apm-collector/apm-collector-naming/collector-naming-define/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.Module b/apm-collector/apm-collector-naming/collector-naming-define/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.Module
new file mode 100644
index 000000000..bab5f5ee6
--- /dev/null
+++ b/apm-collector/apm-collector-naming/collector-naming-define/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.Module
@@ -0,0 +1,19 @@
+#
+# Copyright 2017, OpenSkywalking Organization All rights reserved.
+#
+# Licensed 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.
+#
+# Project repository: https://github.com/OpenSkywalking/skywalking
+#
+
+org.skywalking.apm.collector.naming.NamingModule
\ No newline at end of file
diff --git a/apm-collector/apm-collector-naming/collector-naming-jetty-provider/pom.xml b/apm-collector/apm-collector-naming/collector-naming-jetty-provider/pom.xml
new file mode 100644
index 000000000..27c92d949
--- /dev/null
+++ b/apm-collector/apm-collector-naming/collector-naming-jetty-provider/pom.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+ apm-collector-naming
+ org.skywalking
+ 3.2.3-2017
+
+ 4.0.0
+
+ collector-naming-jetty-provider
+ jar
+
+
+
+ org.skywalking
+ collector-naming-define
+ ${project.version}
+
+
+ org.skywalking
+ collector-cluster-define
+ ${project.version}
+
+
+
\ No newline at end of file
diff --git a/apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/java/org/skywalking/apm/collector/naming/jetty/NamingModuleJettyProvider.java b/apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/java/org/skywalking/apm/collector/naming/jetty/NamingModuleJettyProvider.java
new file mode 100644
index 000000000..c58257c98
--- /dev/null
+++ b/apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/java/org/skywalking/apm/collector/naming/jetty/NamingModuleJettyProvider.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2017, OpenSkywalking Organization All rights reserved.
+ *
+ * Licensed 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.
+ *
+ * Project repository: https://github.com/OpenSkywalking/skywalking
+ */
+
+package org.skywalking.apm.collector.naming.jetty;
+
+import java.util.Properties;
+import org.skywalking.apm.collector.cluster.ClusterModule;
+import org.skywalking.apm.collector.core.module.Module;
+import org.skywalking.apm.collector.core.module.ModuleProvider;
+import org.skywalking.apm.collector.core.module.ServiceNotProvidedException;
+import org.skywalking.apm.collector.naming.NamingModule;
+
+/**
+ * @author peng-yongsheng
+ */
+public class NamingModuleJettyProvider extends ModuleProvider {
+
+ @Override public String name() {
+ return "jetty";
+ }
+
+ @Override public Class extends Module> module() {
+ return NamingModule.class;
+ }
+
+ @Override public void prepare(Properties config) throws ServiceNotProvidedException {
+ }
+
+ @Override public void init(Properties config) throws ServiceNotProvidedException {
+
+ }
+
+ @Override public String[] requiredModules() {
+ return new String[] {ClusterModule.NAME};
+ }
+}
diff --git a/apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.ModuleProvider
new file mode 100644
index 000000000..d28ccf145
--- /dev/null
+++ b/apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.ModuleProvider
@@ -0,0 +1,19 @@
+#
+# Copyright 2017, OpenSkywalking Organization All rights reserved.
+#
+# Licensed 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.
+#
+# Project repository: https://github.com/OpenSkywalking/skywalking
+#
+
+org.skywalking.apm.collector.naming.jetty.NamingModuleJettyProvider
\ No newline at end of file
diff --git a/apm-collector/apm-collector-naming/pom.xml b/apm-collector/apm-collector-naming/pom.xml
index 1127f73e4..4762a9e86 100644
--- a/apm-collector/apm-collector-naming/pom.xml
+++ b/apm-collector/apm-collector-naming/pom.xml
@@ -10,6 +10,17 @@
4.0.0
apm-collector-naming
- jar
+ pom
+
+ collector-naming-define
+ collector-naming-jetty-provider
+
+
+
+ org.skywalking
+ apm-collector-core
+ ${project.version}
+
+
\ No newline at end of file