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


org.geotools.referencing.factory.DeferredAuthorityFactory
   org.geotools.referencing.factory.epsg.ThreadedEpsgFactory

All known Subclasses:   org.geotools.referencing.factory.epsg.ThreadedPostgreSQLEpsgFactory,  org.geotools.referencing.factory.epsg.DefaultFactory,
ThreadedEpsgFactory
public class ThreadedEpsgFactory extends DeferredAuthorityFactory implements CRSAuthorityFactory,CSAuthorityFactory,DatumAuthorityFactory,CoordinateOperationAuthorityFactory(Code)
Base class for EPSG factories to be registered in ReferencingFactoryFinder . Various subclasses are defined for different database backends: Access, PostgreSQL, HSQL, etc..

Users should not creates instance of this class directly. They should invoke one of .getFooAuthorityFactory("EPSG") methods instead.

This class will change in Geotools 2.5; avoid direct dependence if possible. The current ThreadedEpsgFactory name does not reflect its actual behavior in Geotools 2.4. It should reflect the behavior expected in Geotools 2.5.
since:
   2.4
version:
   $Id: ThreadedEpsgFactory.java 26328 2007-07-24 16:57:19Z desruisseaux $
author:
   Martin Desruisseaux



Field Summary
final public static  StringDATASOURCE_NAME
     The default JDBC name in JNDI.
final static  intPRIORITY
     The default priority level for this factory.

Constructor Summary
public  ThreadedEpsgFactory()
     Constructs an authority factory using the default set of factories.
public  ThreadedEpsgFactory(Hints userHints)
     Constructs an authority factory with the default priority.
public  ThreadedEpsgFactory(Hints userHints, int priority)
     Constructs an authority factory using a set of factories created from the specified hints.

Method Summary
protected  booleancanDisposeBackingStore(AbstractAuthorityFactory backingStore)
     Returns true if the backing store can be disposed now.
protected  AbstractAuthorityFactorycreateBackingStore(Hints hints)
     Creates the backing store for the specified data source.
protected  AbstractAuthorityFactorycreateBackingStore()
     Creates the backing store authority factory.
protected  DataSourcecreateDataSource()
     Setup a data source for a connection to the EPSG database.
public  CitationgetAuthority()
     Returns the authority for this EPSG database.
final public synchronized  DataSourcegetDataSource()
     Returns the data source for the EPSG database.
public static  voidmain(String[] args)
     Constructs an object from the EPSG database and print its WKT (Well Know Text) to the .
public synchronized  voidonDeregistration(ServiceRegistry registry, Class category)
     Called when this factory is removed from the given category of the given registry .
public synchronized  voidonRegistration(ServiceRegistry registry, Class category)
     Called when this factory is added to the given category of the given registry .
public synchronized  voidsetDataSource(DataSource datasource)
     Set the data source for the EPSG database.

Field Detail
DATASOURCE_NAME
final public static String DATASOURCE_NAME(Code)
The default JDBC name in JNDI. This is the name used if no other name were specified through the Hints.EPSG_DATA_SOURCE EPSG_DATA_SOURCE hint.
See Also:   ThreadedEpsgFactory.createDataSource



PRIORITY
final static int PRIORITY(Code)
The default priority level for this factory.




Constructor Detail
ThreadedEpsgFactory
public ThreadedEpsgFactory()(Code)
Constructs an authority factory using the default set of factories.



ThreadedEpsgFactory
public ThreadedEpsgFactory(Hints userHints)(Code)
Constructs an authority factory with the default priority.



ThreadedEpsgFactory
public ThreadedEpsgFactory(Hints userHints, int priority)(Code)
Constructs an authority factory using a set of factories created from the specified hints. This constructor recognizes the Hints.CRS_FACTORY CRS , Hints.CS_FACTORY CS , Hints.DATUM_FACTORY DATUM and Hints.MATH_TRANSFORM_FACTORY MATH_TRANSFORM FACTORY hints, in addition of Hints.EPSG_DATA_SOURCE EPSG_DATA_SOURCE .
Parameters:
  userHints - An optional set of hints, or null if none.
Parameters:
  priority - The priority for this factory, as a number betweenThreadedEpsgFactory.MINIMUM_PRIORITY MINIMUM_PRIORITY andThreadedEpsgFactory.MAXIMUM_PRIORITY MAXIMUM_PRIORITY inclusive.




Method Detail
canDisposeBackingStore
protected boolean canDisposeBackingStore(AbstractAuthorityFactory backingStore)(Code)
Returns true if the backing store can be disposed now. This method is invoked automatically after the amount of time specified by ThreadedEpsgFactory.setTimeout if the factory were not used during that time.
Parameters:
  backingStore - The backing store in process of being disposed.



createBackingStore
protected AbstractAuthorityFactory createBackingStore(Hints hints) throws SQLException(Code)
Creates the backing store for the specified data source. This method usually returns a new instance of AccessDialectEpsgFactory or AnsiDialectEpsgFactory . Subclasses may override this method in order to returns an instance tuned for the SQL syntax of the underlying database. Example for a PostgreSQL data source:
 protected AbstractAuthorityFactory createBackingStore(Hints hints) throws SQLException {
 return new AnsiDialectEpsgFactory(hints, getDataSource().getConnection());
 }
 

Parameters:
  hints - A map of hints, including the low-level factories to use for CRS creation.This argument should be given unchanged to DirectEpsgFactory constructor. The using SQL queries appropriatefor this data source.
throws:
  SQLException - if connection to the database failed.



createBackingStore
protected AbstractAuthorityFactory createBackingStore() throws FactoryException(Code)
Creates the backing store authority factory. The backing store to uses in createXXX(...) methods.
throws:
  FactoryException - if the constructor failed to connect to the EPSG database.This exception usually has a SQLException as its cause.



createDataSource
protected DataSource createDataSource() throws SQLException(Code)
Setup a data source for a connection to the EPSG database. This method is invoked by ThreadedEpsgFactory.getDataSource() when no data source has been . The default implementation searchs for a DataSource instance binded to the Hints.EPSG_DATA_SOURCE name ( by default) using Java Naming and Directory Interfaces (JNDI). If no data source were found, then this method returns null .

Subclasses override this method in order to initialize a default data source when none were found with JNDI. For example plugin/epsg-access defines a default data source using the JDBC-ODBC bridge, which expects an " EPSG " database registered as an ODBC data source (see the for installation instructions). Example for a PostgreSQL data source:

 protected DataSource createDataSource() throws SQLException {
 DataSource candidate = super.createDataSource();
 if (candidate instanceof Jdbc3SimpleDataSource) {
 return candidate;
 }
 Jdbc3SimpleDataSource ds = new Jdbc3SimpleDataSource();
 ds.setServerName("localhost");
 ds.setDatabaseName("EPSG");
 ds.setUser("postgre");
 return ds;
 }
 
The EPSG data source, or null if none where found.
throws:
  SQLException - if an error occured while creating the data source.



getAuthority
public Citation getAuthority()(Code)
Returns the authority for this EPSG database. This authority will contains the database version in the attribute, together with the .



getDataSource
final public synchronized DataSource getDataSource() throws SQLException(Code)
Returns the data source for the EPSG database. If no data source has been previously , then this method invokes ThreadedEpsgFactory.createDataSource . Note: invoking this method may force immediate connection to the EPSG database. The data source.
throws:
  SQLException - if the connection to the EPSG database failed.
See Also:   ThreadedEpsgFactory.setDataSource
See Also:   ThreadedEpsgFactory.createDataSource



main
public static void main(String[] args)(Code)
Constructs an object from the EPSG database and print its WKT (Well Know Text) to the . org.geotools.referencing.CRS.main "-authority=EPSG"



onDeregistration
public synchronized void onDeregistration(ServiceRegistry registry, Class category)(Code)
Called when this factory is removed from the given category of the given registry . The object may still be registered under another category.



onRegistration
public synchronized void onRegistration(ServiceRegistry registry, Class category)(Code)
Called when this factory is added to the given category of the given registry . The object may already be registered under another category.



setDataSource
public synchronized void setDataSource(DataSource datasource) throws SQLException(Code)
Set the data source for the EPSG database. If an other EPSG database was already in use, it will be disconnected. Users should not invoke this method on the factory returned by ReferencingFactoryFinder , since it could have a system-wide effect.
Parameters:
  datasource - The new datasource.
throws:
  SQLException - if an error occured.



Methods inherited from org.geotools.referencing.factory.DeferredAuthorityFactory
protected boolean canDisposeBackingStore(AbstractAuthorityFactory backingStore)(Code)(Java Doc)
abstract protected AbstractAuthorityFactory createBackingStore() throws FactoryException(Code)(Java Doc)
public synchronized void dispose() throws FactoryException(Code)(Java Doc)
public boolean isAvailable()(Code)(Java Doc)
public synchronized boolean isConnected()(Code)(Java Doc)
public synchronized void setTimeout(long delay)(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.