/** * Select this module if it meets punch-in criteria. At this point of implementation, the criteria is * very simple. It checks to see if the module's state is greater than equal to what is configured in * {@link #punchInModuleState}. * * @param m * @return */ private boolean select(Module m) { ModuleState state = m.getState(); return state.compareTo(punchInModuleState) >= 0 && state != ModuleState.ERROR; }
/** * Lazily initialize this module if not done so yet. */ private void initialize(String name) { if (initialized) return; synchronized(this) { if(!initialized) { // if we are preparing, we should just not initiate initialization. if (module.getState().equals(ModuleState.PREPARING)) { return; } initialized = true; module.start(); // remember who started us to assist debugging. initializerThread = Thread.currentThread().getStackTrace(); initializerClassName = name; } } }
if (state.compareTo(ModuleState.RESOLVED)>=0) return;
/** * Lazily initialize this module if not done so yet. */ private void initialize(String name) { if (initialized) return; synchronized(this) { if(!initialized) { // if we are preparing, we should just not initiate initialization. if (module.getState().equals(ModuleState.PREPARING)) { return; } initialized = true; module.start(); // remember who started us to assist debugging. initializerThread = Thread.currentThread().getStackTrace(); initializerClassName = name; } } }
if (state.compareTo(ModuleState.RESOLVED)>=0) return;