Java Doc for DefaultPicoContainer.java in  » Inversion-of-Control » PicoContainer » org » picocontainer » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Inversion of Control » PicoContainer » org.picocontainer 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.picocontainer.DefaultPicoContainer

All known Subclasses:   org.picocontainer.containers.TransientPicoContainer,
DefaultPicoContainer
public class DefaultPicoContainer implements MutablePicoContainer,ComponentMonitorStrategy,Serializable(Code)

The Standard PicoContainer / MutablePicoContainer implementation. Constructing a container c with a parent p container will cause c to look up components in p if they cannot be found inside c itself.

Using Class objects as keys to the various registerXXX() methods makes a subtle semantic difference:

If there are more than one registered components of the same type and one of them are registered with a java.lang.Class key of the corresponding type, this addComponent will take precedence over other components during type resolution.

Another place where keys that are classes make a subtle difference is in HiddenImplementation .

This implementation of MutablePicoContainer also supports ComponentMonitorStrategy .


author:
   Paul Hammant
author:
   Aslak Hellesøy
author:
   Jon Tirsén
author:
   Thomas Heller
author:
   Mauro Talevi


Field Summary
final protected  List<ComponentAdapter<?>>orderedComponentAdapters
    

Constructor Summary
public  DefaultPicoContainer(ComponentFactory componentFactory, PicoContainer parent)
     Creates a new container with a custom ComponentFactory and a parent container.

Important note about caching: If you intend the components to be cached, you should pass in a factory that creates Cached instances, such as for example Caching .

public  DefaultPicoContainer(ComponentFactory componentFactory, LifecycleStrategy lifecycleStrategy, PicoContainer parent)
     Creates a new container with a custom ComponentFactory, LifecycleStrategy for instance registration, and a parent container.

Important note about caching: If you intend the components to be cached, you should pass in a factory that creates Cached instances, such as for example Caching .

public  DefaultPicoContainer(ComponentFactory componentFactory, LifecycleStrategy lifecycleStrategy, PicoContainer parent, ComponentMonitor componentMonitor)
    
public  DefaultPicoContainer(ComponentMonitor monitor, PicoContainer parent)
    
public  DefaultPicoContainer(ComponentMonitor monitor, LifecycleStrategy lifecycleStrategy, PicoContainer parent)
    
public  DefaultPicoContainer(LifecycleStrategy lifecycleStrategy, PicoContainer parent)
    
public  DefaultPicoContainer(ComponentFactory componentFactory)
     Creates a new container with a custom ComponentFactory and no parent container.
public  DefaultPicoContainer(ComponentMonitor monitor)
    
public  DefaultPicoContainer(PicoContainer parent)
     Creates a new container with a (caching) AdaptingInjection and a parent container.
public  DefaultPicoContainer()
     Creates a new container with a AdaptingBehavior and no parent container.

Method Summary
public  voidaccept(PicoVisitor visitor)
    
public  MutablePicoContaineraddAdapter(ComponentAdapter componentAdapter)
     This method can be used to override the ComponentAdapter created by the ComponentFactory passed to the constructor of this container.
public  MutablePicoContaineraddAdapter(ComponentAdapter componentAdapter, Properties properties)
    
protected  MutablePicoContaineraddAdapterInternal(ComponentAdapter componentAdapter)
    
public  MutablePicoContaineraddChildContainer(PicoContainer child)
    
public  MutablePicoContaineraddComponent(Object implOrInstance)
     The returned ComponentAdapter will be an org.picocontainer.adapters.InstanceAdapter .
public  MutablePicoContaineraddComponent(Object componentKey, Object componentImplementationOrInstance, Parameter... parameters)
     The returned ComponentAdapter will be instantiated by the ComponentFactory passed to the container's constructor.
public  MutablePicoContaineraddConfig(String name, Object val)
    
public  MutablePicoContaineras(Properties... properties)
    
public  MutablePicoContainerchange(Properties... properties)
    
public  voidchangeMonitor(ComponentMonitor monitor)
     Changes monitor in the ComponentFactory, the component adapters and the child containers, if these support a ComponentMonitorStrategy.
public  ComponentMonitorcurrentMonitor()
     Returns the first current monitor found in the ComponentFactory, the component adapters and the child containers, if these support a ComponentMonitorStrategy.
public  voiddispose()
     Dispose the components of this PicoContainer and all its logical child containers.
public  ObjectgetComponent(Object componentKeyOrType)
    
public  ObjectgetComponent(Object componentKeyOrType, Class<? extends Annotation> annotation)
    
public  TgetComponent(Class<T> componentType)
    
public  TgetComponent(Class<T> componentType, Class<? extends Annotation> binding)
    
final public  ComponentAdaptergetComponentAdapter(Object componentKey)
    
public  ComponentAdapter<T>getComponentAdapter(Class<T> componentType, NameBinding componentNameBinding)
    
public  ComponentAdapter<T>getComponentAdapter(Class<T> componentType, Class<? extends Annotation> binding)
    
public  Collection<ComponentAdapter<?>>getComponentAdapters()
    
public  List<ComponentAdapter<T>>getComponentAdapters(Class<T> componentType)
    
public  List<ComponentAdapter<T>>getComponentAdapters(Class<T> componentType, Class<? extends Annotation> binding)
    
protected  Map<Object, ComponentAdapter<?>>getComponentKeyToAdapterCache()
    
public  List<Object>getComponents()
    
public  List<T>getComponents(Class<T> componentType)
    
protected  List<ComponentAdapter<?>>getModifiableComponentAdapterList()
    
protected  List<ComponentAdapter<?>>getOrderedComponentAdapters()
    
public  PicoContainergetParent()
    
public  MutablePicoContainermakeChildContainer()
    
public  booleanremoveChildContainer(PicoContainer child)
    
public  ComponentAdapter<T>removeComponent(Object componentKey)
    
public  ComponentAdapter<T>removeComponentByInstance(T componentInstance)
    
public  voidstart()
     Start the components of this PicoContainer and all its logical child containers. The starting of the child container is only attempted if the parent container start successfully.
public  voidstop()
     Stop the components of this PicoContainer and all its logical child containers.

Field Detail
orderedComponentAdapters
final protected List<ComponentAdapter<?>> orderedComponentAdapters(Code)




Constructor Detail
DefaultPicoContainer
public DefaultPicoContainer(ComponentFactory componentFactory, PicoContainer parent)(Code)
Creates a new container with a custom ComponentFactory and a parent container.

Important note about caching: If you intend the components to be cached, you should pass in a factory that creates Cached instances, such as for example Caching . Caching can delegate to other ComponentAdapterFactories.
Parameters:
  componentFactory - the factory to use for creation of ComponentAdapters.
Parameters:
  parent - the parent container (used for component dependency lookups).




DefaultPicoContainer
public DefaultPicoContainer(ComponentFactory componentFactory, LifecycleStrategy lifecycleStrategy, PicoContainer parent)(Code)
Creates a new container with a custom ComponentFactory, LifecycleStrategy for instance registration, and a parent container.

Important note about caching: If you intend the components to be cached, you should pass in a factory that creates Cached instances, such as for example Caching . Caching can delegate to other ComponentAdapterFactories.
Parameters:
  componentFactory - the factory to use for creation of ComponentAdapters.
Parameters:
  lifecycleStrategy - the lifecycle strategy chosen for registeredinstance (not implementations!)
Parameters:
  parent - the parent container (used for component dependency lookups).




DefaultPicoContainer
public DefaultPicoContainer(ComponentFactory componentFactory, LifecycleStrategy lifecycleStrategy, PicoContainer parent, ComponentMonitor componentMonitor)(Code)



DefaultPicoContainer
public DefaultPicoContainer(ComponentMonitor monitor, PicoContainer parent)(Code)
Creates a new container with the AdaptingInjection using a custom ComponentMonitor
Parameters:
  monitor - the ComponentMonitor to use
Parameters:
  parent - the parent container (used for component dependency lookups).



DefaultPicoContainer
public DefaultPicoContainer(ComponentMonitor monitor, LifecycleStrategy lifecycleStrategy, PicoContainer parent)(Code)
Creates a new container with the AdaptingInjection using a custom ComponentMonitor and lifecycle strategy
Parameters:
  monitor - the ComponentMonitor to use
Parameters:
  lifecycleStrategy - the lifecycle strategy to use.
Parameters:
  parent - the parent container (used for component dependency lookups).



DefaultPicoContainer
public DefaultPicoContainer(LifecycleStrategy lifecycleStrategy, PicoContainer parent)(Code)
Creates a new container with the AdaptingInjection using a custom lifecycle strategy
Parameters:
  lifecycleStrategy - the lifecycle strategy to use.
Parameters:
  parent - the parent container (used for component dependency lookups).



DefaultPicoContainer
public DefaultPicoContainer(ComponentFactory componentFactory)(Code)
Creates a new container with a custom ComponentFactory and no parent container.
Parameters:
  componentFactory - the ComponentFactory to use.



DefaultPicoContainer
public DefaultPicoContainer(ComponentMonitor monitor)(Code)
Creates a new container with the AdaptingInjection using a custom ComponentMonitor
Parameters:
  monitor - the ComponentMonitor to use



DefaultPicoContainer
public DefaultPicoContainer(PicoContainer parent)(Code)
Creates a new container with a (caching) AdaptingInjection and a parent container.
Parameters:
  parent - the parent container (used for component dependency lookups).



DefaultPicoContainer
public DefaultPicoContainer()(Code)
Creates a new container with a AdaptingBehavior and no parent container.




Method Detail
accept
public void accept(PicoVisitor visitor)(Code)



addAdapter
public MutablePicoContainer addAdapter(ComponentAdapter componentAdapter)(Code)
This method can be used to override the ComponentAdapter created by the ComponentFactory passed to the constructor of this container.



addAdapter
public MutablePicoContainer addAdapter(ComponentAdapter componentAdapter, Properties properties)(Code)
*



addAdapterInternal
protected MutablePicoContainer addAdapterInternal(ComponentAdapter componentAdapter)(Code)



addChildContainer
public MutablePicoContainer addChildContainer(PicoContainer child)(Code)



addComponent
public MutablePicoContainer addComponent(Object implOrInstance)(Code)
The returned ComponentAdapter will be an org.picocontainer.adapters.InstanceAdapter .



addComponent
public MutablePicoContainer addComponent(Object componentKey, Object componentImplementationOrInstance, Parameter... parameters)(Code)
The returned ComponentAdapter will be instantiated by the ComponentFactory passed to the container's constructor.



addConfig
public MutablePicoContainer addConfig(String name, Object val)(Code)



as
public MutablePicoContainer as(Properties... properties)(Code)



change
public MutablePicoContainer change(Properties... properties)(Code)



changeMonitor
public void changeMonitor(ComponentMonitor monitor)(Code)
Changes monitor in the ComponentFactory, the component adapters and the child containers, if these support a ComponentMonitorStrategy.



currentMonitor
public ComponentMonitor currentMonitor()(Code)
Returns the first current monitor found in the ComponentFactory, the component adapters and the child containers, if these support a ComponentMonitorStrategy.
throws:
  PicoCompositionException - if no component monitor is found in container or its children



dispose
public void dispose()(Code)
Dispose the components of this PicoContainer and all its logical child containers. The lifecycle operation is delegated to the component adapter, if it is an instance of Behavior lifecycle manager . The actual LifecycleStrategy lifecycle strategy supported depends on the concrete implementation of the adapter.
See Also:   Behavior
See Also:   LifecycleStrategy
See Also:   DefaultPicoContainer.makeChildContainer()
See Also:   DefaultPicoContainer.addChildContainer(PicoContainer)
See Also:   DefaultPicoContainer.removeChildContainer(PicoContainer)



getComponent
public Object getComponent(Object componentKeyOrType)(Code)



getComponent
public Object getComponent(Object componentKeyOrType, Class<? extends Annotation> annotation)(Code)



getComponent
public T getComponent(Class<T> componentType)(Code)



getComponent
public T getComponent(Class<T> componentType, Class<? extends Annotation> binding)(Code)



getComponentAdapter
final public ComponentAdapter getComponentAdapter(Object componentKey)(Code)
*



getComponentAdapter
public ComponentAdapter<T> getComponentAdapter(Class<T> componentType, NameBinding componentNameBinding)(Code)
*



getComponentAdapter
public ComponentAdapter<T> getComponentAdapter(Class<T> componentType, Class<? extends Annotation> binding)(Code)
*



getComponentAdapters
public Collection<ComponentAdapter<?>> getComponentAdapters()(Code)
*



getComponentAdapters
public List<ComponentAdapter<T>> getComponentAdapters(Class<T> componentType)(Code)
*



getComponentAdapters
public List<ComponentAdapter<T>> getComponentAdapters(Class<T> componentType, Class<? extends Annotation> binding)(Code)
*



getComponentKeyToAdapterCache
protected Map<Object, ComponentAdapter<?>> getComponentKeyToAdapterCache()(Code)
the componentKeyToAdapterCache



getComponents
public List<Object> getComponents() throws PicoException(Code)



getComponents
public List<T> getComponents(Class<T> componentType)(Code)



getModifiableComponentAdapterList
protected List<ComponentAdapter<?>> getModifiableComponentAdapterList()(Code)
the componentAdapters



getOrderedComponentAdapters
protected List<ComponentAdapter<?>> getOrderedComponentAdapters()(Code)
the orderedComponentAdapters



getParent
public PicoContainer getParent()(Code)
*



makeChildContainer
public MutablePicoContainer makeChildContainer()(Code)



removeChildContainer
public boolean removeChildContainer(PicoContainer child)(Code)



removeComponent
public ComponentAdapter<T> removeComponent(Object componentKey)(Code)
*



removeComponentByInstance
public ComponentAdapter<T> removeComponentByInstance(T componentInstance)(Code)
*



start
public void start()(Code)
Start the components of this PicoContainer and all its logical child containers. The starting of the child container is only attempted if the parent container start successfully. The child container for which start is attempted is tracked so that upon stop, only those need to be stopped. The lifecycle operation is delegated to the component adapter, if it is an instance of Behavior lifecycle manager . The actual LifecycleStrategy lifecycle strategy supported depends on the concrete implementation of the adapter.
See Also:   Behavior
See Also:   LifecycleStrategy
See Also:   DefaultPicoContainer.makeChildContainer()
See Also:   DefaultPicoContainer.addChildContainer(PicoContainer)
See Also:   DefaultPicoContainer.removeChildContainer(PicoContainer)



stop
public void stop()(Code)
Stop the components of this PicoContainer and all its logical child containers. The stopping of the child containers is only attempted for those that have been started, possibly not successfully. The lifecycle operation is delegated to the component adapter, if it is an instance of Behavior lifecycle manager . The actual LifecycleStrategy lifecycle strategy supported depends on the concrete implementation of the adapter.
See Also:   Behavior
See Also:   LifecycleStrategy
See Also:   DefaultPicoContainer.makeChildContainer()
See Also:   DefaultPicoContainer.addChildContainer(PicoContainer)
See Also:   DefaultPicoContainer.removeChildContainer(PicoContainer)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.