private void transition(LifecycleState lifecycleState, LifecycleState... candidates) throws LifecycleException { LifecycleState[] augmentedCandidates = Arrays.copyOf(candidates, candidates.length + 1); augmentedCandidates[candidates.length] = FAILED; if (matches(lifecycleState, augmentedCandidates)) { this.lifecycleState = lifecycleState; String lifecycleEvent = lifecycleState.getLifecycleEvent(); if (lifecycleEvent != null) { this.lifecycleSupport.notify(lifecycleEvent, null); } } else { throw new LifecycleException(String.format("Illegal transition from %s to %s attempted", this.lifecycleState, lifecycleState)); } }
private void transition(LifecycleState lifecycleState, LifecycleState... candidates) throws LifecycleException { LifecycleState[] augmentedCandidates = Arrays.copyOf(candidates, candidates.length + 1); augmentedCandidates[candidates.length] = FAILED; if (matches(lifecycleState, augmentedCandidates)) { this.lifecycleState = lifecycleState; String lifecycleEvent = lifecycleState.getLifecycleEvent(); if (lifecycleEvent != null) { this.lifecycleSupport.notify(lifecycleEvent, null); } } else { throw new LifecycleException(String.format("Illegal transition from %s to %s attempted", this.lifecycleState, lifecycleState)); } }
/** * Provides a mechanism for sub-classes to update the component state. * Calling this method will automatically fire any associated * {@link Lifecycle} event. * * @param state The new state for this component * @param data The data to pass to the associated {@link Lifecycle} event */ protected synchronized void setState(LifecycleState state, Object data) { if (log.isDebugEnabled()) { log.debug(sm.getString("lifecycleBase.setState", this, state)); } this.state = state; String lifecycleEvent = state.getLifecycleEvent(); if (lifecycleEvent != null) { fireLifecycleEvent(lifecycleEvent, data); } }
/** * Provides a mechanism for sub-classes to update the component state. * Calling this method will automatically fire any associated * {@link Lifecycle} event. * * @param state The new state for this component * @param data The data to pass to the associated {@link Lifecycle} event */ protected synchronized void setState(LifecycleState state, Object data) { if (log.isDebugEnabled()) { log.debug(sm.getString("lifecycleBase.setState", this, state)); } this.state = state; String lifecycleEvent = state.getLifecycleEvent(); if (lifecycleEvent != null) { fireLifecycleEvent(lifecycleEvent, data); } }
/** * Provides a mechanism for sub-classes to update the component state. * Calling this method will automatically fire any associated * {@link Lifecycle} event. * * @param state The new state for this component * @param data The data to pass to the associated {@link Lifecycle} event */ protected synchronized void setState(LifecycleState state, Object data) { if (log.isDebugEnabled()) { log.debug(sm.getString("lifecycleBase.setState", this, state)); } this.state = state; String lifecycleEvent = state.getLifecycleEvent(); if (lifecycleEvent != null) { fireLifecycleEvent(lifecycleEvent, data); } }
private void assertTransition(LifecycleState lifecycleState) throws LifecycleException { reset(this.lifecycleSupport); this.lifecycleStateMachine.transition(lifecycleState); assertEquals(lifecycleState, this.lifecycleStateMachine.getLifecycleState()); String lifecycleEvent = lifecycleState.getLifecycleEvent(); if (lifecycleEvent != null) { verify(this.lifecycleSupport).notify(lifecycleEvent, null); } else { verifyZeroInteractions(this.lifecycleSupport); } } }
String lifecycleEvent = state.getLifecycleEvent(); if (lifecycleEvent != null) { fireLifecycleEvent(lifecycleEvent, data);
String lifecycleEvent = state.getLifecycleEvent(); if (lifecycleEvent != null) { fireLifecycleEvent(lifecycleEvent, data);
String lifecycleEvent = state.getLifecycleEvent(); if (lifecycleEvent != null) { fireLifecycleEvent(lifecycleEvent, data);
String lifecycleEvent = state.getLifecycleEvent(); if (lifecycleEvent != null) { fireLifecycleEvent(lifecycleEvent, data);
String lifecycleEvent = state.getLifecycleEvent(); if (lifecycleEvent != null) { fireLifecycleEvent(lifecycleEvent, data);