org.picocontainer.script.bsh
Class BeanShellAdapter
java.lang.Object
org.picocontainer.adapters.AbstractAdapter
org.picocontainer.script.bsh.BeanShellAdapter
- All Implemented Interfaces:
- Serializable, org.picocontainer.ComponentAdapter, org.picocontainer.ComponentMonitorStrategy
public class BeanShellAdapter
- extends org.picocontainer.adapters.AbstractAdapter
This adapter relies on Bsh for instantiation
(and possibly also initialisation) of component instances.
When ComponentAdapter.getComponentInstance(org.picocontainer.PicoContainer)
is called (by PicoContainer),
the adapter instance will look for a script with the same name as the component implementation
class (but with the .bsh extension). This script must reside in the same folder as the class.
(It's ok to have them both in a jar).
The bsh script's only contract is that it will have to instantiate a bsh variable called
"instance".
The script will have access to the following variables:
- addAdapter - the adapter calling the script
- picoContainer - the MutablePicoContainer calling the addAdapter
- componentKey - the component key
- componentImplementation - the component implementation
- parameters - the ComponentParameters (as a List)
- Author:
- Leo Simons, Aslak Hellesoy
- See Also:
- Serialized Form
Nested classes/interfaces inherited from interface org.picocontainer.ComponentAdapter |
org.picocontainer.ComponentAdapter.NOTHING |
Methods inherited from class org.picocontainer.adapters.AbstractAdapter |
accept, changeMonitor, checkTypeCompatibility, currentMonitor, findAdapterOfType, getComponentImplementation, getComponentInstance, getComponentKey, getDelegate, toString |
BeanShellAdapter
public BeanShellAdapter(Object componentKey,
Class<?> componentImplementation,
org.picocontainer.Parameter[] parameters,
ClassLoader classLoader)
BeanShellAdapter
public BeanShellAdapter(Object componentKey,
Class<?> componentImplementation,
org.picocontainer.Parameter... parameters)
getComponentInstance
public Object getComponentInstance(org.picocontainer.PicoContainer pico,
Type into)
throws org.picocontainer.PicoCompositionException
- Throws:
org.picocontainer.PicoCompositionException
verify
public void verify(org.picocontainer.PicoContainer pico)
getDescriptor
public String getDescriptor()
Copyright © 2003-2010 Codehaus. All Rights Reserved.