org.springframework.context.Phased Java Examples

The following examples show how to use org.springframework.context.Phased. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JmsNamespaceHandlerTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
private int getPhase(String containerBeanName) {
	Object container = this.context.getBean(containerBeanName);
	if (!(container instanceof Phased)) {
		throw new IllegalStateException("Container '" + containerBeanName + "' does not implement Phased.");
	}
	return ((Phased) container).getPhase();
}
 
Example #2
Source File: JmsNamespaceHandlerTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
private int getPhase(String containerBeanName) {
	Object container = this.context.getBean(containerBeanName);
	if (!(container instanceof Phased)) {
		throw new IllegalStateException("Container '" + containerBeanName + "' does not implement Phased.");
	}
	return ((Phased) container).getPhase();
}
 
Example #3
Source File: JmsNamespaceHandlerTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
private int getPhase(String containerBeanName) {
	Object container = this.context.getBean(containerBeanName);
	if (!(container instanceof Phased)) {
		throw new IllegalStateException("Container '" + containerBeanName + "' does not implement Phased.");
	}
	return ((Phased) container).getPhase();
}
 
Example #4
Source File: DefaultLifecycleProcessor.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * Determine the lifecycle phase of the given bean.
 * <p>The default implementation checks for the {@link Phased} interface, using
 * a default of 0 otherwise. Can be overridden to apply other/further policies.
 * @param bean the bean to introspect
 * @return the phase (an integer value)
 * @see Phased#getPhase()
 * @see SmartLifecycle
 */
protected int getPhase(Lifecycle bean) {
	return (bean instanceof Phased ? ((Phased) bean).getPhase() : 0);
}
 
Example #5
Source File: DefaultLifecycleProcessor.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * Determine the lifecycle phase of the given bean.
 * <p>The default implementation checks for the {@link Phased} interface, using
 * a default of 0 otherwise. Can be overridden to apply other/further policies.
 * @param bean the bean to introspect
 * @return the phase (an integer value)
 * @see Phased#getPhase()
 * @see SmartLifecycle
 */
protected int getPhase(Lifecycle bean) {
	return (bean instanceof Phased ? ((Phased) bean).getPhase() : 0);
}
 
Example #6
Source File: DefaultLifecycleProcessor.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Determine the lifecycle phase of the given bean.
 * <p>The default implementation checks for the {@link Phased} interface.
 * Can be overridden to apply other/further policies.
 * @param bean the bean to introspect
 * @return the phase an integer value. The suggested default is 0.
 * @see Phased
 * @see SmartLifecycle
 */
protected int getPhase(Lifecycle bean) {
	return (bean instanceof Phased ? ((Phased) bean).getPhase() : 0);
}
 
Example #7
Source File: DefaultLifecycleProcessor.java    From spring4-understanding with Apache License 2.0 2 votes vote down vote up
/**
 * Determine the lifecycle phase of the given bean.
 * <p>The default implementation checks for the {@link Phased} interface.
 * Can be overridden to apply other/further policies.
 * @param bean the bean to introspect
 * @return the phase an an integer value. The suggested default is 0.
 * @see Phased
 * @see SmartLifecycle
 */
protected int getPhase(Lifecycle bean) {
	return (bean instanceof Phased ? ((Phased) bean).getPhase() : 0);
}