提交 66e553a4 编写于 作者: wu-sheng's avatar wu-sheng

Finish most codes and fix compile issue.

上级 4ec7fe3f
......@@ -28,10 +28,19 @@ public class ApplicationConfiguration {
return modules.keySet().toArray(new String[0]);
}
public ModuleConfiguration addModule(String moduleName) {
ModuleConfiguration newModule = new ModuleConfiguration();
modules.put(moduleName, newModule);
return newModule;
}
public ModuleConfiguration getModuleConfiguration(String name) {
return modules.get(name);
}
/**
* The configurations about a certain module.
*/
public class ModuleConfiguration {
private HashMap<String, ProviderConfiguration> providers = new HashMap<>();
......@@ -40,6 +49,9 @@ public class ApplicationConfiguration {
}
}
/**
* The configuration about a certain provider of a module.
*/
public class ProviderConfiguration {
private Properties properties;
}
......
......@@ -18,7 +18,6 @@
package org.skywalking.apm.collector.modulization;
import java.lang.reflect.InvocationTargetException;
import java.util.LinkedList;
import java.util.List;
import java.util.ServiceLoader;
......
......@@ -76,6 +76,7 @@ public abstract class ModuleProvider {
/**
* Register a implementation for the service of this module provider.
*
* @param serviceType
* @param service
*/
......@@ -83,6 +84,12 @@ public abstract class ModuleProvider {
this.services.put(serviceType, service);
}
/**
* Make sure all required services have been implemented.
*
* @param requiredServices must be implemented by the module.
* @throws ServiceNotProvidedException when exist unimplemented service.
*/
void requiredCheck(Class<? extends Service>[] requiredServices) throws ServiceNotProvidedException {
if (requiredServices == null)
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册