나는 module-a, module-b, module-c의 세 가지 모듈을 가지고있다. 모듈 -a와 모듈 -b는 부트 레이어에 있습니다. 모듈 용 레이어 -c 자신을 만듭니다. 모듈 -c는 인터페이스가 모듈 -a에있는 서비스의 JPMS 구현을가집니다.Java 9에서 모듈 레이어를 제거하는 방법은 무엇입니까?
이것은 모듈 -b에서 module-c를 사용하여 레이어를 만드는 방법입니다.
ModuleFinder finder = ModuleFinder.of(moduleCPath);
ModuleLayer parent = ModuleLayer.boot();
Configuration cf = parent.configuration().resolve(finder, ModuleFinder.of(), Set.of("module-c"));
ClassLoader scl = ClassLoader.getSystemClassLoader();
ModuleLayer layer = parent.defineModulesWithOneLoader(cf, scl);
모듈 -b에서 모듈 -c의 서비스를 호출합니다. 서비스 실행이 완료된 후에는 모듈 -c와 새로운 생성 된 레이어가 더 이상 필요하지 않습니다. JVM에서 제거하고 모든 자원을 해제하는 방법? layer = null;
할만큼 충분합니까?
'module-c'가없는 새로운 'ModuleLayer'를 만들 수 있습니까? – nullpointer
정확히 무엇을 시도했는지 질문을 업데이트 할 수 있습니까? – nullpointer
@nullpointer 내 질문에는 모든 정보, 내가하는 일과 그에 관한 질문이 있습니다. 이해가되지 않는 부분이 있으면 이해하지 못하는 부분을 말하십시오. –