Remove ServiceInstrumentation mechanism for further collector agent design.

This commit is contained in:
wusheng 2017-11-13 00:19:34 +08:00
parent b1002a98e1
commit 9dbd4ef683
3 changed files with 0 additions and 13 deletions

View File

@ -31,7 +31,6 @@ import java.util.ServiceLoader;
*/
public class ModuleManager {
private Map<String, Module> loadedModules = new HashMap<>();
private boolean isServiceInstrument = true;
/**
* Init the given modules
@ -81,12 +80,4 @@ public class ModuleManager {
return module;
throw new ModuleNotFoundException(moduleName + " missing.");
}
public boolean isServiceInstrument() {
return isServiceInstrument;
}
public void setServiceInstrument(boolean serviceInstrument) {
isServiceInstrument = serviceInstrument;
}
}

View File

@ -95,9 +95,6 @@ public abstract class ModuleProvider {
protected final void registerServiceImplementation(Class<? extends Service> serviceType,
Service service) throws ServiceNotProvidedException {
if (serviceType.isInstance(service)) {
if (manager.isServiceInstrument()) {
// service = ServiceInstrumentation.INSTANCE.buildServiceUnderMonitor(module.name(), name(), service);
}
this.services.put(serviceType, service);
} else {
throw new ServiceNotProvidedException(serviceType + " is not implemented by " + service);

View File

@ -48,7 +48,6 @@ public class ModuleManagerTest {
configuration.addModule("BaseB").addProviderConfiguration("P-B", null);
ModuleManager manager = new ModuleManager();
manager.setServiceInstrument(true);
manager.init(configuration);
BaseModuleA.ServiceABusiness1 serviceABusiness1 = manager.find("BaseA").getService(BaseModuleA.ServiceABusiness1.class);