@Override
        public void done(Integer result) {
            if (globalListener != null) {
                if (result < 6) {
                    globalListener.step("Prefiltered env map face " + result + " generated");
                } else {
                    globalListener.step("Irradiance map generated");

                }
            }

            jobState.done[index] = true;
            if (jobState.isDone()) {
                probe.setNbMipMaps(probe.getPrefilteredEnvMap().getImage().getMipMapSizes().length);
                probe.setReady(true);
                if (globalListener != null) {
                    globalListener.done(probe);
                }
                jobState.executor.shutdownNow();
            }
        }
An inner JobProgressListener to control the generation process and properly clean up when it's done
jme3-core/src/main/java/com/jme3/environment/LightProbeFactory.java