Java Doc for MutablePicoContainer.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) 


org.picocontainer.MutablePicoContainer

All known Subclasses:   org.picocontainer.gems.containers.Log4jTracingContainerDecorator,  org.picocontainer.DefaultPicoContainer,  org.picocontainer.gems.containers.CommonsLoggingTracingContainerDecorator,  org.picocontainer.containers.AbstractDelegatingMutablePicoContainer,
MutablePicoContainer
public interface MutablePicoContainer extends PicoContainer,Startable,Disposable(Code)
This is the core interface used for registration of components with a container. It is possible to register implementations and instances here
author:
   Paul Hammant
author:
   Aslak Hellesøy
author:
   Jon Tirsén
See Also:    See package description for basic overview how to use PicoContainer.




Method Summary
 MutablePicoContaineraddAdapter(ComponentAdapter componentAdapter)
     Register a component via a ComponentAdapter.
 MutablePicoContaineraddChildContainer(PicoContainer child)
     Add a child container.
 MutablePicoContaineraddComponent(Object componentKey, Object componentImplementationOrInstance, Parameter... parameters)
     Register a component and creates specific instructions on which constructor to use, along with which components and/or constants to provide as constructor arguments.
 MutablePicoContaineraddComponent(Object implOrInstance)
     Register an arbitrary object.
 MutablePicoContaineraddConfig(String name, Object val)
     Register a config item.
 MutablePicoContaineras(Properties... properties)
     You can set for the following operation only the characteristic of registration of a component on the fly.
 MutablePicoContainerchange(Properties... properties)
     You can change the characteristic of registration of all subsequent components in this container.
 MutablePicoContainermakeChildContainer()
     Make a child container, using the same implementation of MutablePicoContainer as the parent. It will have a reference to this as parent.
 booleanremoveChildContainer(PicoContainer child)
     Remove a child container from this container.
 ComponentAdapter<T>removeComponent(Object componentKey)
     Unregister a component by key.
Parameters:
  componentKey - key of the component to unregister.
 ComponentAdapter<T>removeComponentByInstance(T componentInstance)
     Unregister a component by instance.
Parameters:
  componentInstance - the component instance to unregister.



Method Detail
addAdapter
MutablePicoContainer addAdapter(ComponentAdapter componentAdapter)(Code)
Register a component via a ComponentAdapter. Use this if you need fine grained control over what ComponentAdapter to use for a specific component. The adapter will be wrapped in whatever behaviors that the the container has been set up with. If you want to bypass that behavior for the adapter you are adding, you should use Characteristics.NONE like so pico.as(Characteristics.NONE).addAdapter(...)
Parameters:
  componentAdapter - the adapter the same instance of MutablePicoContainer
throws:
  PicoCompositionException - if registration fails.



addChildContainer
MutablePicoContainer addChildContainer(PicoContainer child)(Code)
Add a child container. This action will list the the 'child' as exactly that in the parents scope. It will not change the child's view of a parent. That is determined by the constructor arguments of the child itself. Lifecycle events will be cascaded from parent to child as a consequence of calling this method.
Parameters:
  child - the child container the same instance of MutablePicoContainer



addComponent
MutablePicoContainer addComponent(Object componentKey, Object componentImplementationOrInstance, Parameter... parameters)(Code)
Register a component and creates specific instructions on which constructor to use, along with which components and/or constants to provide as constructor arguments. These "directives" are provided through an array of Parameter objects. Parameter[0] correspondes to the first constructor argument, Parameter[N] corresponds to the N+1th constructor argument.

Tips for Parameter usage

  • Partial Autowiring: If you have two constructor args to match and you only wish to specify one of the constructors and let PicoContainer wire the other one, you can use as parameters: new ComponentParameter(), new ComponentParameter("someService") The default constructor for the component parameter indicates auto-wiring should take place for that parameter.
  • Force No-Arg constructor usage: If you wish to force a component to be constructed with the no-arg constructor, use a zero length Parameter array. Ex: new Parameter[0]

      Parameters:
        componentKey - a key that identifies the component. Must be unique within the container. The typeof the key object has no semantic significance unless explicitly specified in thedocumentation of the implementing container.
      Parameters:
        componentImplementationOrInstance - the component's implementation class. This must be a concrete class (ie, aclass that can be instantiated). Or an intance of the compoent.
      Parameters:
        parameters - the parameters that gives the container hints about what arguments to passto the constructor when it is instantiated. Container implementations may ignoreone or more of these hints. the same instance of MutablePicoContainer
      throws:
        PicoCompositionException - if registration of the component fails.
      See Also:   org.picocontainer.Parameter
      See Also:   org.picocontainer.parameters.ConstantParameter
      See Also:   org.picocontainer.parameters.ComponentParameter



addComponent
MutablePicoContainer addComponent(Object implOrInstance)(Code)
Register an arbitrary object. The class of the object will be used as a key. Calling this method is equivalent to calling addComponent(componentImplementation, componentImplementation).
Parameters:
  implOrInstance - Component implementation or instance the same instance of MutablePicoContainer
throws:
  PicoCompositionException - if registration fails.



addConfig
MutablePicoContainer addConfig(String name, Object val)(Code)
Register a config item.
Parameters:
  name - the name of the config item
Parameters:
  val - the value of the config item the same instance of MutablePicoContainer
throws:
  PicoCompositionException - if registration fails.



as
MutablePicoContainer as(Properties... properties)(Code)
You can set for the following operation only the characteristic of registration of a component on the fly.
Parameters:
  properties - the same Pico instance with temporary properties



change
MutablePicoContainer change(Properties... properties)(Code)
You can change the characteristic of registration of all subsequent components in this container.
Parameters:
  properties - the same Pico instance with changed properties



makeChildContainer
MutablePicoContainer makeChildContainer()(Code)
Make a child container, using the same implementation of MutablePicoContainer as the parent. It will have a reference to this as parent. This will list the resulting MPC as a child. Lifecycle events will be cascaded from parent to child as a consequence of this. the new child container.



removeChildContainer
boolean removeChildContainer(PicoContainer child)(Code)
Remove a child container from this container. It will not change the child's view of a parent. Lifecycle event will no longer be cascaded from the parent to the child.
Parameters:
  child - the child container true if the child container has been removed.



removeComponent
ComponentAdapter<T> removeComponent(Object componentKey)(Code)
Unregister a component by key.
Parameters:
  componentKey - key of the component to unregister. the ComponentAdapter that was associated with this component.



removeComponentByInstance
ComponentAdapter<T> removeComponentByInstance(T componentInstance)(Code)
Unregister a component by instance.
Parameters:
  componentInstance - the component instance to unregister. the same instance of MutablePicoContainer



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