Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

Constructor Summary
`BeanShellComponentAdapter(Object componentKey, Class componentImplementation, org.picocontainer.Parameter[] parameters)`
`BeanShellComponentAdapter(Object componentKey, Class componentImplementation, org.picocontainer.Parameter[] parameters, ClassLoader classLoader)`

Method Summary
`Object` | `getComponentInstance(org.picocontainer.PicoContainer pico)`
`void` | `verify(org.picocontainer.PicoContainer pico)`

Methods inherited from class org.picocontainer.defaults.AbstractComponentAdapter
`accept, checkTypeCompatibility, getComponentImplementation, getComponentKey, toString`

Methods inherited from class org.picocontainer.defaults.MonitoringComponentAdapter
`changeMonitor, currentMonitor`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### BeanShellComponentAdapter

    public BeanShellComponentAdapter(Object componentKey,
                                     Class componentImplementation,
                                     org.picocontainer.Parameter[] parameters,
                                     ClassLoader classLoader)

### BeanShellComponentAdapter

    public BeanShellComponentAdapter(Object componentKey,
                                     Class componentImplementation,
                                     org.picocontainer.Parameter[] parameters)

Method Detail

### 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`

Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2007 Codehaus. All Rights Reserved.