Java Doc for ComponentContainer.java in  » UML » AndroMDA-3.2 » org » andromda » core » common » 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 » UML » AndroMDA 3.2 » org.andromda.core.common 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.andromda.core.common.ComponentContainer

ComponentContainer
public class ComponentContainer (Code)

This handles all registration and retrieval of components within the framework. The purpose of this container is so that we can register default services in a consistent manner by creating a component interface and then placing the file which defines the default implementation in the 'META-INF/services/' directory found on the classpath.

In order to create a new component that can be registered/found through this container you must perform the following steps:

  1. Create the component interface (i.e. org.andromda.core.repository.RepositoryFacade)
  2. Create the component implementation (i.e. org.andromda.repositories.mdr.MDRepositoryFacade)
  3. Create a file with the exact same name as the fully qualified name of the component (i.e. org.andromda.core.repository.RepositoryFacade) that contains the name of the implementation class (i.e. org.andromda.repositories.mdr.MDRepostioryFacade) and place this in the META-INF/services/ directory within the core.
After you perform the above steps, the component can be found by the methods within this class. See each below method for more information on how each performs lookup/retrieval of the components.


author:
   Chad Brandon




Method Summary
public  ObjectfindComponent(Object key)
     Finds the component with the specified key.
Parameters:
  key - the unique key of the component as an Object.
public  ObjectfindComponent(Class key)
     Finds the component with the specified Class key.
public  ObjectfindComponent(String key, Class type)
     Attempts to find the component with the specified unique key, if it can't be found, the default of the specified type is returned, if no default is set, null is returned.
public  ObjectfindComponentByNamespace(String namespace, Object key)
     Finds a component in this container with a unique (within this container) key registered by the specified namespace.
Parameters:
  namespace - the namespace for which to search.
Parameters:
  key - the unique key.
public  CollectionfindComponentsOfType(Class type)
     Finds all components having the given type.
Parameters:
  type - the component type.
public  ObjectfindRequiredComponent(Class key)
     Attempts to Find the component with the specified type, throwing a ComponentContainerException exception if one can not be found.
Parameters:
  key - the unique key of the component as an Object.
final protected  StringgetComponentDefaultConfigurationPath(Class type)
     Returns the expected path to the component's default configuration file.
Parameters:
  type - the component type.
public static  ComponentContainerinstance()
     Gets the shared instance of this ComponentContainer.
public  booleanisRegistered(Object key)
     Registers true (false otherwise) if the component in this container with a unique (within this container) key is registered.
Parameters:
  key - the unique key.
public  booleanisRegisteredByNamespace(String namespace, Object key)
     Registers true (false otherwise) if the component in this container with a unique (within this container) key is registered by the specified namespace.
Parameters:
  namespace - the namespace for which to register the component.
Parameters:
  key - the unique key.
public  ObjectnewComponent(String implementation, Class type)
     Creates a new component of the given implementation (if it isn't null or empty), otherwise attempts to find the default implementation of the given type by searching the META-INF/services directory for the default implementation.
Parameters:
  implementation - the fully qualified name of the implementationclass.
Parameters:
  type - the type to retrieve if the implementation is empty.
public  ObjectnewComponent(Class implementation, Class type)
     Creates a new component of the given implementation (if it isn't null or empty), otherwise attempts to find the default implementation of the given type by searching the META-INF/services directory for the default implementation.
Parameters:
  implementation - the implementation class.
Parameters:
  type - the type to retrieve if the implementation is empty.
public  ObjectnewDefaultComponent(Class type)
     Creates a new component of the given type by searching the META-INF/services directory and finding its default implementation.
public  ObjectregisterComponent(Object key, Object component)
     Registers the component in this container with a unique (within this container) key.
Parameters:
  key - the unique key.
public  voidregisterComponentByNamespace(String namespace, Object key, Object component)
     Registers the component in this container with a unique (within this container) key by the specified namespace.
public  voidregisterComponentType(Class type)
     Registers the component of the specified type.
public  ObjectregisterComponentType(String type)
     Registers the components of the specified type.
public  voidregisterDefaultComponent(Class componentInterface, String defaultTypeName)
     Registers the "default" for the specified componentInterface.
Parameters:
  componentInterface - the interface for the component.
Parameters:
  defaultTypeName - the name of the "default" type of theimplementation to use for the componentInterface.
public  ObjectregisterDefaultComponent(Class componentInterface, Class defaultType)
     Registers the "default" for the specified componentInterface.
Parameters:
  componentInterface - the interface for the component.
Parameters:
  defaultType - the "default" implementation to use for thecomponentInterface.
public  voidshutdown()
     Shuts down this container instance.
public  ObjectunregisterComponent(String key)
     Unregisters the component in this container with a unique (within this container) key.
Parameters:
  key - the unique key.



Method Detail
findComponent
public Object findComponent(Object key)(Code)
Finds the component with the specified key.
Parameters:
  key - the unique key of the component as an Object. Object the component instance.



findComponent
public Object findComponent(Class key)(Code)
Finds the component with the specified Class key. If the component wasn't explicitly registered then the META-INF/services directory on the classpath will be searched in order to find the default component implementation.
Parameters:
  key - the unique key as a Class. Object the component instance.



findComponent
public Object findComponent(String key, Class type)(Code)
Attempts to find the component with the specified unique key, if it can't be found, the default of the specified type is returned, if no default is set, null is returned. The default is the service found within the META-INF/services directory on your classpath.
Parameters:
  key - the unique key of the component.
Parameters:
  type - the default type to retrieve if the component can not befound. Object the component instance.



findComponentByNamespace
public Object findComponentByNamespace(String namespace, Object key)(Code)
Finds a component in this container with a unique (within this container) key registered by the specified namespace.
Parameters:
  namespace - the namespace for which to search.
Parameters:
  key - the unique key. the found component, or null.



findComponentsOfType
public Collection findComponentsOfType(Class type)(Code)
Finds all components having the given type.
Parameters:
  type - the component type. Collection all components



findRequiredComponent
public Object findRequiredComponent(Class key)(Code)
Attempts to Find the component with the specified type, throwing a ComponentContainerException exception if one can not be found.
Parameters:
  key - the unique key of the component as an Object. Object the component instance.



getComponentDefaultConfigurationPath
final protected String getComponentDefaultConfigurationPath(Class type)(Code)
Returns the expected path to the component's default configuration file.
Parameters:
  type - the component type. the path to the component configuration file.



instance
public static ComponentContainer instance()(Code)
Gets the shared instance of this ComponentContainer. PluginDiscoverer the static instance.



isRegistered
public boolean isRegistered(Object key)(Code)
Registers true (false otherwise) if the component in this container with a unique (within this container) key is registered.
Parameters:
  key - the unique key. boolean true/false depending on whether or not it is registerd.



isRegisteredByNamespace
public boolean isRegisteredByNamespace(String namespace, Object key)(Code)
Registers true (false otherwise) if the component in this container with a unique (within this container) key is registered by the specified namespace.
Parameters:
  namespace - the namespace for which to register the component.
Parameters:
  key - the unique key. boolean true/false depending on whether or not it is registerd.



newComponent
public Object newComponent(String implementation, Class type)(Code)
Creates a new component of the given implementation (if it isn't null or empty), otherwise attempts to find the default implementation of the given type by searching the META-INF/services directory for the default implementation.
Parameters:
  implementation - the fully qualified name of the implementationclass.
Parameters:
  type - the type to retrieve if the implementation is empty. a new instance of the given type



newComponent
public Object newComponent(Class implementation, Class type)(Code)
Creates a new component of the given implementation (if it isn't null or empty), otherwise attempts to find the default implementation of the given type by searching the META-INF/services directory for the default implementation.
Parameters:
  implementation - the implementation class.
Parameters:
  type - the type to retrieve if the implementation is empty. a new instance of the given type



newDefaultComponent
public Object newDefaultComponent(Class type)(Code)
Creates a new component of the given type by searching the META-INF/services directory and finding its default implementation. a new instance of the given type



registerComponent
public Object registerComponent(Object key, Object component)(Code)
Registers the component in this container with a unique (within this container) key.
Parameters:
  key - the unique key. Object the registered component.



registerComponentByNamespace
public void registerComponentByNamespace(String namespace, Object key, Object component)(Code)
Registers the component in this container with a unique (within this container) key by the specified namespace.
Parameters:
  namespace - the namespace for which to register the component.
Parameters:
  key - the unique key.



registerComponentType
public void registerComponentType(Class type)(Code)
Registers the component of the specified type.
Parameters:
  type - the type Class.



registerComponentType
public Object registerComponentType(String type)(Code)
Registers the components of the specified type.
Parameters:
  type - the name of a type (must have be able to be instantiated intoa Class instance) Object an instance of the type registered.



registerDefaultComponent
public void registerDefaultComponent(Class componentInterface, String defaultTypeName)(Code)
Registers the "default" for the specified componentInterface.
Parameters:
  componentInterface - the interface for the component.
Parameters:
  defaultTypeName - the name of the "default" type of theimplementation to use for the componentInterface. Its expectedthat this is the name of a class.



registerDefaultComponent
public Object registerDefaultComponent(Class componentInterface, Class defaultType)(Code)
Registers the "default" for the specified componentInterface.
Parameters:
  componentInterface - the interface for the component.
Parameters:
  defaultType - the "default" implementation to use for thecomponentInterface. Object the registered component.



shutdown
public void shutdown()(Code)
Shuts down this container instance.



unregisterComponent
public Object unregisterComponent(String key)(Code)
Unregisters the component in this container with a unique (within this container) key.
Parameters:
  key - the unique key. Object the registered component.



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.