org.nanocontainer.script.bsh
Class BeanShellComponentAdapter
java.lang.Object
org.picocontainer.defaults.MonitoringComponentAdapter
org.picocontainer.defaults.AbstractComponentAdapter
org.nanocontainer.script.bsh.BeanShellComponentAdapter
- All Implemented Interfaces:
- Serializable, org.picocontainer.ComponentAdapter, org.picocontainer.defaults.ComponentMonitorStrategy
public class BeanShellComponentAdapter
- extends org.picocontainer.defaults.AbstractComponentAdapter
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:
- adapter - the adapter calling the script
- picoContainer - the MutablePicoContainer calling the adapter
- componentKey - the component key
- componentImplementation - the component implementation
- parameters - the ComponentParameters (as a List)
- Version:
- $Id: BeanShellComponentAdapter.java 3144 2006-12-26 10:12:19Z mauro $
- Author:
- Leo Simons, Aslak Hellesoy
- See Also:
- Serialized Form
Methods inherited from class org.picocontainer.defaults.AbstractComponentAdapter |
accept, checkTypeCompatibility, getComponentImplementation, getComponentKey, toString |
Methods inherited from class org.picocontainer.defaults.MonitoringComponentAdapter |
changeMonitor, currentMonitor |
BeanShellComponentAdapter
public BeanShellComponentAdapter(Object componentKey,
Class componentImplementation,
org.picocontainer.Parameter[] parameters,
ClassLoader classLoader)
BeanShellComponentAdapter
public BeanShellComponentAdapter(Object componentKey,
Class componentImplementation,
org.picocontainer.Parameter[] parameters)
getComponentInstance
public Object getComponentInstance(org.picocontainer.PicoContainer pico)
throws org.picocontainer.PicoInitializationException,
org.picocontainer.PicoIntrospectionException
- Throws:
org.picocontainer.PicoInitializationException
org.picocontainer.PicoIntrospectionException
verify
public void verify(org.picocontainer.PicoContainer pico)
throws org.picocontainer.defaults.UnsatisfiableDependenciesException
- Throws:
org.picocontainer.defaults.UnsatisfiableDependenciesException
Copyright © 2003-2009 Codehaus. All Rights Reserved.