Commit 9dbd4ef6 authored by 吴晟's avatar 吴晟
Browse files

Remove ServiceInstrumentation mechanism for further collector agent design.

parent b1002a98
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -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;
    }
}
+0 −3
Original line number Diff line number Diff line
@@ -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);
+0 −1
Original line number Diff line number Diff line
@@ -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);