private void prepareAgentModule(final ClassLoader classLoader, JavaModule agentModule) {
        JavaModule bootstrapModule = getBootstrapModule();
        // Error:class com.navercorp.pinpoint.bootstrap.AgentBootLoader$1 cannot access class com.navercorp.pinpoint.profiler.DefaultAgent (in module pinpoint.agent)
        // because module pinpoint.agent does not export com.navercorp.pinpoint.profiler to unnamed module @7bfcd12c
        agentModule.addExports("com.navercorp.pinpoint.profiler", bootstrapModule);

        // Error:class com.navercorp.pinpoint.bootstrap.AgentBootLoader$1 cannot access class com.navercorp.pinpoint.profiler.test.PluginTestAgent (in module pinpoint.agent)
        // because module pinpoint.agent does not export com.navercorp.pinpoint.test to unnamed module @4b9e13df
        final String pinpointTestModule = "com.navercorp.pinpoint.profiler.test";
        if (agentModule.getPackages().contains(pinpointTestModule)) {
            agentModule.addExports(pinpointTestModule, bootstrapModule);
        } else {
            logger.accept(pinpointTestModule + " package not found");
        }

        agentModule.addReads(bootstrapModule);

        // Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.net.URLClassLoader.addURL(java.net.URL) accessible:
        // module java.base does not "opens java.net" to module pinpoint.agent
        // at pinpoint.agent/pinpoint.agent/com.navercorp.pinpoint.profiler.instrument.classloading.URLClassLoaderHandler.<clinit>(URLClassLoaderHandler.java:44)
        JavaModule baseModule = getJavaBaseModule();
        baseModule.addOpens("java.net", agentModule);
        // java.lang.reflect.InaccessibleObjectException: Unable to make private java.nio.DirectByteBuffer(long,int) accessible: module java.base does not "opens java.nio" to module pinpoint.agent
        //   at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:337)
        baseModule.addOpens("java.nio", agentModule);

        // for Java9DefineClass
        baseModule.addExports("jdk.internal.misc", agentModule);
        if (ModuleUtils.jvmVersionUpper(11)) {
            final String internalAccessModule = "jdk.internal.access";
            if (baseModule.getPackages().contains(internalAccessModule)) {
                baseModule.addExports(internalAccessModule, agentModule);
            } else {
                logger.accept(internalAccessModule + " package not found");
            }
        }

        agentModule.addReads(baseModule);

        final JavaModule instrumentModule = loadModule("java.instrument");
        agentModule.addReads(instrumentModule);

        final JavaModule managementModule = loadModule("java.management");
        agentModule.addReads(managementModule);

        // DefaultCpuLoadMetric : com.sun.management.OperatingSystemMXBean
        final JavaModule jdkManagement = loadModule("jdk.management");
        agentModule.addReads(jdkManagement);

        // for grpc's NameResolverProvider
        final JavaModule jdkUnsupported = loadModule("jdk.unsupported");
        agentModule.addReads(jdkUnsupported);

//        LongAdder
//        final Module unsupportedModule = loadModule("jdk.unsupported");
//        Set<Module> readModules = Set.of(instrumentModule, managementModule, jdkManagement, unsupportedModule);

        // bootstrap ClassLoader --------------------------------
        ClassLoader bootstrapClassLoader = Object.class.getClassLoader();
        addUses("com.navercorp.pinpoint.common.trace.TraceMetadataProvider", bootstrapClassLoader, agentModule);

        addUses("com.navercorp.pinpoint.bootstrap.plugin.ProfilerPlugin", bootstrapClassLoader, agentModule);

        // agent ClassLoader ------------------------------------------

        addUses("com.navercorp.pinpoint.profiler.context.recorder.proxy.ProxyRequestParserProvider", classLoader, agentModule);

        addUses("io.grpc.NameResolverProvider", classLoader, agentModule);

        addUses("io.grpc.LoadBalancerProvider", classLoader, agentModule);

        addUses("org.apache.logging.log4j.spi.Provider", classLoader, agentModule);
        addUses("org.apache.logging.log4j.core.impl.Log4jProvider", classLoader, agentModule);
        addUses("org.apache.logging.log4j.core.util.ContextDataProvider", classLoader, agentModule);
        addUses("org.apache.logging.log4j.core.util.WatchEventService", classLoader, agentModule);
        addUses("org.apache.logging.log4j.util.PropertySource", classLoader, agentModule);

        addUses("org.slf4j.spi.SLF4JServiceProvider", classLoader, agentModule);

    }
@author Woonduk Kang(emeroad)
@author jaehong.kim - Add ServiceLoaderClassPathLookupHelper logic
agent-module/bootstraps/bootstrap-java9/src/main/java/com/navercorp/pinpoint/bootstrap/java9/module/ModuleSupport.java