ScriptFactoryPostProcessor.java | Class | org.springframework.beans.factory.config.BeanPostProcessor that
handles
org.springframework.scripting.ScriptFactory definitions,
replacing each factory with the actual scripted Java object generated by it.
This is similar to the
org.springframework.beans.factory.FactoryBean mechanism, but is
specifically tailored for scripts and not built into Spring's core
container itself but rather implemented as an extension.
NOTE: The most important characteristic of this post-processor
is that constructor arguments are applied to the
org.springframework.scripting.ScriptFactory instance
while bean property values are applied to the generated scripted object.
Typically, constructor arguments include a script source locator and
potentially script interfaces, while bean property values include
references and config values to inject into the scripted object itself.
The following
ScriptFactoryPostProcessor will automatically
be applied to the two
org.springframework.scripting.ScriptFactory definitions below.
At runtime, the actual scripted objects will be exposed for
"bshMessenger" and "groovyMessenger", rather than the
org.springframework.scripting.ScriptFactory instances. |