ApplicationAvailability, ApplicationListener<AvailabilityChangeEvent<?>> { private final Map<Class<? extends AvailabilityState>, AvailabilityChangeEvent<?>> events = new HashMap<>(); @Override public void onApplicationEvent(AvailabilityChangeEvent<?> event) { Class<? extends AvailabilityState> stateType = getStateType(event.getState()); this.events.put(stateType, event); } @Override public <S extends AvailabilityState> S getState(Class<S> stateType, S defaultState) { Assert.notNull(stateType, "StateType must not be null"); Assert.notNull(defaultState, "DefaultState must not be null"); S state = getState(stateType); return (state != null) ? state : defaultState; } // … } ΠϕϯτΛݕ͠ ෦Ͱঢ়ଶΛอ࣋