Finish most codes and fix compile issue.
This commit is contained in:
parent
4ec7fe3f8e
commit
66e553a413
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue