/** * 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); }
/** * 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); }
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(); }
/** * 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); }