Java Doc for Factory.java in  » GIS » GeoTools-2.4.1 » org » geotools » factory » 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 » GIS » GeoTools 2.4.1 » org.geotools.factory 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.geotools.factory.Factory

All known Subclasses:   org.geotools.feature.FeatureCollections,  org.geotools.data.FeatureLockFactory,  org.geotools.feature.iso.FeatureCollections,  org.geotools.feature.AttributeTypeFactory,  org.geotools.factory.AbstractFactory,  org.geotools.feature.FeatureTypeBuilder,
Factory
public interface Factory (Code)
Base interface for Geotools factories (i.e. service discovery).

This interfaces forms the core of the Geotools plug-in system, by which capabilities can be added to the library at runtime. Each sub-interface defines a service. Most services are set up with concrete implementation being registered for use in a service registry, which acts as a container for service implementations.

Service registries don't need to be a Geotools implementation. They can be (but are not limited to) any ServiceRegistry subclass. If the standard ServiceRegistry (or its Geotools extension FactoryRegistry ) is selected as a container for services, then factory implementations should be declared as below (select only one way):

  • Register for automatic discovery
    • Provide a public no-arguments constructor.
    • Add the fully qualified name of the implementation class in the META-INF/services/ classname file where classname is the fully qualified name of the service interface.
    • The factory implementations will be discovered when FactoryRegistry.scanForPlugins will be invoked.
  • Or register explicitly by application code

In addition, it is recommended that implementations provide a constructor expecting a single Hints argument. This optional argument gives to the user some control of the factory's low-level details. The amount of control is factory specific. The geotools library defines a global class called Hints that is ment as API (i.e. you can assume these hints are supported). Factories may also provide information on their own custom hints as part of their javadoc class description.

Examples:
  • An application supplied a , being passed to a so that all datum created from an authority code will come from the supplied datum factory.

  • An application supplied a org.geotools.feature.FeatureFactory (ensuring all constructed features support the Eclipse's IAdaptable interface), being passed to a org.geotools.feature.FeatureTypeFactory so that all FeatureTypes constructed will produce features supporting the indicated interface.

As seen in those examples this concept of a hint becomes more interesting when the operation being controlled is discovery of other services used by the Factory. By supplying appropriate hints one can chain together several factories and retarget them to an application specific task.


author:
   Ian Schneider
author:
   Martin Desruisseaux
author:
   Jody Garnett
version:
   $Id: Factory.java 25262 2007-04-23 21:11:16Z desruisseaux $
See Also:   Hints
See Also:   FactoryRegistry




Method Summary
 MapgetImplementationHints()
     Map of hints (maybe ) used by this factory to customize its use.



Method Detail
getImplementationHints
Map getImplementationHints()(Code)
Map of hints (maybe ) used by this factory to customize its use. This map is not guaranteed to contains all the hints supplied by the user; it may be only a subset. Consequently, hints provided here are usually not suitable for creating new factories, unless the implementation make some additional garantees (e.g. FactoryUsingVolatileDependencies ).

The primary purpose of this method is to determine if an existing factory instance can be reused for a set of user-supplied hints. This method is invoked by FactoryRegistry in order to compare this factory's hints against user's hints. This is dependency introspection only; FactoryRegistry never invokes this method for creating new factories.

Keys are usually static constants from the Hints class, while values are instances of some key-dependent class. The must contains at least all hints impacting functionality. While the key set may contains all hints supplied by the user, it is recommended to limit the set to only the hints used by this particular factory instance. A minimal set will helps FactoryRegistry to compare only hints that matter and avoid the creation of unnecessary instances of this factory.

The hint values may be different than the one supplied by the user. If a user supplied a hint as a Class object, this method shall replace it by the actual instance used, if possible.

Implementations of this method are usually quite simple. For example if a uses an ordinary , its method could be implemented as below (note that we should not check if the datum factory is null, since key with null value is the expected behaviour in this case). Example:


 Map hints = new HashMap();
 hints.put(
 , datumFactory);
 return hints;
 
The map of hints, or an if none.



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