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

## org.picocontainer.gems.containers
Class ReusablePicoContainer

    java.lang.Object
      org.picocontainer.DefaultPicoContainer
          org.picocontainer.gems.containers.ReusablePicoContainer

All Implemented Interfaces:
  Serializable, org.picocontainer.ComponentMonitorStrategy, org.picocontainer.Disposable, org.picocontainer.MutablePicoContainer, org.picocontainer.PicoContainer, org.picocontainer.Startable

    public class ReusablePicoContainer

extends org.picocontainer.DefaultPicoContainer

Normal PicoContainers are meant to be created, started, stopped, disposed and garbage collected. The goal of this container is to reduce the number of registration calls (and therefore objects created) in areas where performance is key (for example, this might be used in NanoContainer request containers).

It accomplishes its goal in two ways:
(1) Once a container is disposed of, start() may be called again, allowing for recycling of the container. (This is default behavior with a picocontainer)

(2) All instance registrations will be unregistered when stop is called. (For example, HttpServletRequest would be removed), and all component adapter instance values are flushed.

#### Container Storage

It is still up to the builder of this container to decide where to store its reference. Since it is reusable, it needs to be stored someplace that doesn't easily expire. Probably the most common storage location would be ThreadLocal storage. HttpSession might be another valid storage location.

Author:
  Michael Rimov
See Also:
  Serialized Form

Field Summary

Fields inherited from class org.picocontainer.DefaultPicoContainer
`componentFactory, componentMonitor, lifecycleStrategy, orderedComponentAdapters`

Constructor Summary
`ReusablePicoContainer()`
`ReusablePicoContainer(org.picocontainer.ComponentFactory componentFactory)`
`ReusablePicoContainer(org.picocontainer.ComponentFactory componentFactory, org.picocontainer.LifecycleStrategy lifecycleStrategy, org.picocontainer.PicoContainer parent)`
`ReusablePicoContainer(org.picocontainer.ComponentFactory componentFactory, org.picocontainer.LifecycleStrategy lifecycleStrategy, org.picocontainer.PicoContainer parent, org.picocontainer.ComponentMonitor componentMonitor)`
`ReusablePicoContainer(org.picocontainer.ComponentFactory componentFactory, org.picocontainer.PicoContainer parent)`
`ReusablePicoContainer(org.picocontainer.ComponentMonitor monitor)`
`ReusablePicoContainer(org.picocontainer.ComponentMonitor monitor, org.picocontainer.LifecycleStrategy lifecycleStrategy, org.picocontainer.PicoContainer parent)`
`ReusablePicoContainer(org.picocontainer.ComponentMonitor monitor, org.picocontainer.PicoContainer parent)`
`ReusablePicoContainer(org.picocontainer.LifecycleStrategy lifecycleStrategy, org.picocontainer.PicoContainer parent)`
`ReusablePicoContainer(org.picocontainer.PicoContainer parent)`

Method Summary
`org.picocontainer.MutablePicoContainer` | `addAdapter(org.picocontainer.ComponentAdapter<?> componentAdapter)`
`org.picocontainer.MutablePicoContainer` | `addAdapter(org.picocontainer.ComponentAdapter<?> componentAdapter, Properties properties)`
`org.picocontainer.MutablePicoContainer` | `addComponent(Object implOrInstance)`
`org.picocontainer.MutablePicoContainer` | `addComponent(Object componentKey, Object componentImplementationOrInstance, org.picocontainer.Parameter... parameters)`
`org.picocontainer.MutablePicoContainer` | `makeChildContainer()`
`
`<T> org.picocontainer.ComponentAdapter<T>`
` | `removeComponent(Object componentKey)`
`
`<T> org.picocontainer.ComponentAdapter<T>`
` | `removeComponentByInstance(T componentInstance)`
`void` | `stop()`

Methods inherited from class org.picocontainer.DefaultPicoContainer
`accept, addAdapterInternal, addChildContainer, addConfig, as, change, changeMonitor, currentMonitor, dispose, getComponent, getComponent, getComponent, getComponent, getComponent, getComponentAdapter, getComponentAdapter, getComponentAdapter, getComponentAdapters, getComponentAdapters, getComponentAdapters, getComponentKeyToAdapterCache, getComponents, getComponents, getModifiableComponentAdapterList, getOrderedComponentAdapters, getParent, removeChildContainer, setLifecycleState, setName, start, toString`

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

Constructor Detail

### ReusablePicoContainer

    public ReusablePicoContainer()

### ReusablePicoContainer

    public ReusablePicoContainer(org.picocontainer.ComponentFactory componentFactory,
                                 org.picocontainer.LifecycleStrategy lifecycleStrategy,
                                 org.picocontainer.PicoContainer parent,
                                 org.picocontainer.ComponentMonitor componentMonitor)

### ReusablePicoContainer

    public ReusablePicoContainer(org.picocontainer.ComponentFactory componentFactory,
                                 org.picocontainer.LifecycleStrategy lifecycleStrategy,
                                 org.picocontainer.PicoContainer parent)

### ReusablePicoContainer

    public ReusablePicoContainer(org.picocontainer.ComponentFactory componentFactory,
                                 org.picocontainer.PicoContainer parent)

### ReusablePicoContainer

    public ReusablePicoContainer(org.picocontainer.ComponentFactory componentFactory)

### ReusablePicoContainer

    public ReusablePicoContainer(org.picocontainer.ComponentMonitor monitor,
                                 org.picocontainer.LifecycleStrategy lifecycleStrategy,
                                 org.picocontainer.PicoContainer parent)

### ReusablePicoContainer

    public ReusablePicoContainer(org.picocontainer.ComponentMonitor monitor,
                                 org.picocontainer.PicoContainer parent)

### ReusablePicoContainer

    public ReusablePicoContainer(org.picocontainer.ComponentMonitor monitor)

### ReusablePicoContainer

    public ReusablePicoContainer(org.picocontainer.LifecycleStrategy lifecycleStrategy,
                                 org.picocontainer.PicoContainer parent)

### ReusablePicoContainer

    public ReusablePicoContainer(org.picocontainer.PicoContainer parent)

Method Detail

### addComponent

    public org.picocontainer.MutablePicoContainer addComponent(Object componentKey,
                                                               Object componentImplementationOrInstance,
                                                               org.picocontainer.Parameter... parameters)
                                                        throws org.picocontainer.PicoCompositionException

  Specified by:
    `addComponent` in interface `org.picocontainer.MutablePicoContainer`
  Overrides:
    `addComponent` in class `org.picocontainer.DefaultPicoContainer`
  Throws:
    `org.picocontainer.PicoCompositionException`

### addComponent

    public org.picocontainer.MutablePicoContainer addComponent(Object implOrInstance)
                                                        throws org.picocontainer.PicoCompositionException

  Specified by:
    `addComponent` in interface `org.picocontainer.MutablePicoContainer`
  Overrides:
    `addComponent` in class `org.picocontainer.DefaultPicoContainer`
  Throws:
    `org.picocontainer.PicoCompositionException`

### stop

    public void stop()

  Specified by:
    `stop` in interface `org.picocontainer.Startable`
  Overrides:
    `stop` in class `org.picocontainer.DefaultPicoContainer`

### addAdapter

    public org.picocontainer.MutablePicoContainer addAdapter(org.picocontainer.ComponentAdapter<?> componentAdapter,
                                                             Properties properties)

  Overrides:
    `addAdapter` in class `org.picocontainer.DefaultPicoContainer`

### addAdapter

    public org.picocontainer.MutablePicoContainer addAdapter(org.picocontainer.ComponentAdapter<?> componentAdapter)

  Specified by:
    `addAdapter` in interface `org.picocontainer.MutablePicoContainer`
  Overrides:
    `addAdapter` in class `org.picocontainer.DefaultPicoContainer`

### removeComponent

    public <T> org.picocontainer.ComponentAdapter<T> removeComponent(Object componentKey)

  Specified by:
    `removeComponent` in interface `org.picocontainer.MutablePicoContainer`
  Overrides:
    `removeComponent` in class `org.picocontainer.DefaultPicoContainer`

### removeComponentByInstance

    public <T> org.picocontainer.ComponentAdapter<T> removeComponentByInstance(T componentInstance)

  Specified by:
    `removeComponentByInstance` in interface `org.picocontainer.MutablePicoContainer`
  Overrides:
    `removeComponentByInstance` in class `org.picocontainer.DefaultPicoContainer`

### makeChildContainer

    public org.picocontainer.MutablePicoContainer makeChildContainer()

  Specified by:
    `makeChildContainer` in interface `org.picocontainer.MutablePicoContainer`
  Overrides:
    `makeChildContainer` in class `org.picocontainer.DefaultPicoContainer`

Overview | 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-2009 Codehaus. All Rights Reserved.