Class RefreshableScriptTargetSource

java.lang.Object
org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
org.springframework.aop.target.dynamic.BeanFactoryRefreshableTargetSource
org.springframework.scripting.support.RefreshableScriptTargetSource
All Implemented Interfaces:
org.springframework.aop.target.dynamic.Refreshable, org.springframework.aop.TargetClassAware, org.springframework.aop.TargetSource

public class RefreshableScriptTargetSource extends org.springframework.aop.target.dynamic.BeanFactoryRefreshableTargetSource
Subclass of BeanFactoryRefreshableTargetSource that determines whether a refresh is required through the given ScriptFactory.
Since:
2.0
Author:
Rob Harrop, Juergen Hoeller, Mark Fisher
  • Field Summary

    Fields inherited from class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource

    logger, targetObject
  • Constructor Summary

    Constructors
    Constructor
    Description
    RefreshableScriptTargetSource(org.springframework.beans.factory.BeanFactory beanFactory, String beanName, ScriptFactory scriptFactory, ScriptSource scriptSource, boolean isFactoryBean)
    Create a new RefreshableScriptTargetSource.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Object
    obtainFreshBean(org.springframework.beans.factory.BeanFactory beanFactory, String beanName)
    Obtain a fresh target object, retrieving a FactoryBean if necessary.
    protected boolean
    Determine whether a refresh is required through calling ScriptFactory's requiresScriptedObjectRefresh method.

    Methods inherited from class org.springframework.aop.target.dynamic.BeanFactoryRefreshableTargetSource

    freshTarget

    Methods inherited from class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource

    getLastRefreshTime, getRefreshCount, getTarget, getTargetClass, isStatic, refresh, releaseTarget, setRefreshCheckDelay

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RefreshableScriptTargetSource

      public RefreshableScriptTargetSource(org.springframework.beans.factory.BeanFactory beanFactory, String beanName, ScriptFactory scriptFactory, ScriptSource scriptSource, boolean isFactoryBean)
      Create a new RefreshableScriptTargetSource.
      Parameters:
      beanFactory - the BeanFactory to fetch the scripted bean from
      beanName - the name of the target bean
      scriptFactory - the ScriptFactory to delegate to for determining whether a refresh is required
      scriptSource - the ScriptSource for the script definition
      isFactoryBean - whether the target script defines a FactoryBean
  • Method Details

    • requiresRefresh

      protected boolean requiresRefresh()
      Determine whether a refresh is required through calling ScriptFactory's requiresScriptedObjectRefresh method.
      Overrides:
      requiresRefresh in class org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
      See Also:
    • obtainFreshBean

      protected Object obtainFreshBean(org.springframework.beans.factory.BeanFactory beanFactory, String beanName)
      Obtain a fresh target object, retrieving a FactoryBean if necessary.
      Overrides:
      obtainFreshBean in class org.springframework.aop.target.dynamic.BeanFactoryRefreshableTargetSource