org.springframework.scripting.ScriptFactory implementation
for a BeanShell script.
Typically used in combination with a
org.;
see the latter's javadoc for a configuration example.
BshScriptUtils, org.springframework.scripting.support.ScriptFactoryPostProcessor
| Modifier and Type | Field and Description |
|---|---|
| private ClassLoader | |
| private Class | |
| private final Object | |
| private final Class | |
| private final String | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | BshScriptFactory(String
a locator that points to the source of the script.
Interpreted by the post-processor that actually creates the script. scriptSourceLocator)Create a new BshScriptFactory for the given script source. |
| public | BshScriptFactory(String
a locator that points to the source of the script.
Interpreted by the post-processor that actually creates the script. scriptSourceLocator, Class<?>... the Java interfaces that the scripted object
is supposed to implement (may be scriptInterfaces)null)Create a new BshScriptFactory for the given script source. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | getScriptedObject(ScriptSource
the actual ScriptSource to retrieve
the script source text from (never scriptSource, Class<?>... null)the actual interfaces to expose,
including script interfaces as well as a generated config interface
(if applicable; may be actualInterfaces)null)Implements org. Load and parse the BeanShell script via |
| public Class | getScriptedObjectType(ScriptSource
the actual ScriptSource to retrieve
the script source text from (never scriptSource)null)Implements org. Determine the type of the scripted Java object. |
| public Class | getScriptInterfaces()
Implements org. Return the business interfaces that the script is supposed to implement. |
| public String | getScriptSourceLocator()
Implements org. Return a locator that points to the source of the script. |
| public boolean | requiresConfigInterface()
Implements org. BeanShell scripts do require a config interface. |
| public boolean | requiresScriptedObjectRefresh(ScriptSource
the actual ScriptSource to retrieve
the script source text from (never scriptSource)null)Implements org. Determine whether a refresh is required (e.g. through
ScriptSource's |
| public void | setBeanClassLoader(ClassLoader
the owning class loader classLoader)Implements org. Callback that supplies the bean |
| public String |
| beanClassLoader | back to summary |
|---|---|
| private ClassLoader beanClassLoader
| |
| scriptClass | back to summary |
|---|---|
| private Class<?> scriptClass
| |
| scriptClassMonitor | back to summary |
|---|---|
| private final Object scriptClassMonitor | |
| scriptInterfaces | back to summary |
|---|---|
| private final Class<?>[] scriptInterfaces
| |
| scriptSourceLocator | back to summary |
|---|---|
| private final String scriptSourceLocator | |
| wasModifiedForTypeCheck | back to summary |
|---|---|
| private boolean wasModifiedForTypeCheck | |
| BshScriptFactory | back to summary |
|---|---|
| public BshScriptFactory(String scriptSourceLocator) Create a new BshScriptFactory for the given script source. With this
| |
| BshScriptFactory | back to summary |
|---|---|
| public BshScriptFactory(String scriptSourceLocator, Class<?>... scriptInterfaces) Create a new BshScriptFactory for the given script source. The script may either be a simple script that needs a corresponding proxy generated (implementing the specified interfaces), or declare a full class or return an actual instance of the scripted object (in which case the specified interfaces, if any, need to be implemented by that class/instance). | |
| getScriptedObject | back to summary |
|---|---|
| public Object getScriptedObject(ScriptSource scriptSource, Class<?>... actualInterfaces) throws IOException, ScriptCompilationException Implements org. Load and parse the BeanShell script via
| |
| getScriptedObjectType | back to summary |
|---|---|
| public Class Implements org. Doc from org. Determine the type of the scripted Java object. Implementations are encouraged to cache script metadata such as a generated script class. Note that this method may be invoked concurrently and must be implemented in a thread-safe fashion.
| |
| getScriptInterfaces | back to summary |
|---|---|
| public Class Implements org. Doc from org. Return the business interfaces that the script is supposed to implement. Can return | |
| getScriptSourceLocator | back to summary |
|---|---|
| public String getScriptSourceLocator() Implements org. Doc from org. Return a locator that points to the source of the script. Interpreted by the post-processor that actually creates the script. Typical supported locators are Spring resource locations (such as "file:C:/myScript.bsh" or "classpath:myPackage/myScript.bsh") and inline scripts ("inline:myScriptText..."). | |
| requiresConfigInterface | back to summary |
|---|---|
| public boolean requiresConfigInterface() Implements org. BeanShell scripts do require a config interface.
| |
| requiresScriptedObjectRefresh | back to summary |
|---|---|
| public boolean requiresScriptedObjectRefresh(ScriptSource scriptSource) Implements org. Doc from org. Determine whether a refresh is required (e.g. through
ScriptSource's
| |
| setBeanClassLoader | back to summary |
|---|---|
| public void setBeanClassLoader(ClassLoader classLoader) Implements org. Doc from org. Callback that supplies the bean Invoked after the population of normal bean properties but
before an initialization callback such as
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |