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:
Refreshable
,TargetClassAware
,TargetSource
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
ConstructorDescriptionRefreshableScriptTargetSource
(BeanFactory beanFactory, String beanName, ScriptFactory scriptFactory, ScriptSource scriptSource, boolean isFactoryBean) Create a new RefreshableScriptTargetSource. -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
obtainFreshBean
(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'srequiresScriptedObjectRefresh
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
-
Constructor Details
-
RefreshableScriptTargetSource
public RefreshableScriptTargetSource(BeanFactory beanFactory, String beanName, ScriptFactory scriptFactory, ScriptSource scriptSource, boolean isFactoryBean) Create a new RefreshableScriptTargetSource.- Parameters:
beanFactory
- the BeanFactory to fetch the scripted bean frombeanName
- the name of the target beanscriptFactory
- the ScriptFactory to delegate to for determining whether a refresh is requiredscriptSource
- the ScriptSource for the script definitionisFactoryBean
- whether the target script defines a FactoryBean
-
-
Method Details
-
requiresRefresh
protected boolean requiresRefresh()Determine whether a refresh is required through calling ScriptFactory'srequiresScriptedObjectRefresh
method.- Overrides:
requiresRefresh
in classAbstractRefreshableTargetSource
- Returns:
- whether a refresh is required
- See Also:
-
obtainFreshBean
Obtain a fresh target object, retrieving a FactoryBean if necessary.- Overrides:
obtainFreshBean
in classBeanFactoryRefreshableTargetSource
- See Also:
-