DAO
- the type of factory used as Data Access Object (DAO).public abstract class ConcurrentAuthorityFactory<DAO extends GeodeticAuthorityFactory> extends GeodeticAuthorityFactory implements AutoCloseable
createFoo(String)
methods first check if a previously created object exists for the given code.
If such object exists, it is returned. Otherwise, the object creation is delegated to another factory given
by newDataAccess()
and the result is cached in this factory.
ConcurrentAuthorityFactory
delays the call to newDataAccess()
until first needed,
and closes the factory used as a Data Access Object
(DAO) after some timeout. This approach allows to establish a connection to a database (for example)
and keep it only for a relatively short amount of time.
ConcurrentAuthorityFactory
construction time. If more Data Access Object instances are needed, some of the threads will block until an
instance become available.
DatumAuthorityFactory
, CSAuthorityFactory
,
CRSAuthorityFactory
and CoordinateOperationAuthorityFactory
interfaces.
Subclasses should select the interfaces that they choose to implement.Defined in the sis-referencing
module
Modifier | Constructor and Description |
---|---|
protected |
ConcurrentAuthorityFactory(Class<DAO> dataAccessClass)
Constructs an instance with a default number of threads and a default number of entries to keep
by strong references.
|
protected |
ConcurrentAuthorityFactory(Class<DAO> dataAccessClass,
int maxStrongReferences,
int maxConcurrentQueries)
Constructs an instance with the specified number of entries to keep by strong references.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canClose(DAO factory)
Returns
true if the given Data Access Object (DAO) can be closed. |
void |
close()
Immediately closes all Data Access Objects that are closeable.
|
CartesianCS |
createCartesianCS(String code)
Returns a 2- or 3-dimensional Cartesian coordinate system made of straight orthogonal axes.
|
CompoundCRS |
createCompoundCRS(String code)
Returns a CRS describing the position of points through two or more independent coordinate reference systems.
|
CoordinateOperation |
createCoordinateOperation(String code)
Returns an operation for transforming coordinates in the source CRS to coordinates in the target CRS.
|
CoordinateReferenceSystem |
createCoordinateReferenceSystem(String code)
Returns an arbitrary coordinate reference system from a code.
|
CoordinateSystem |
createCoordinateSystem(String code)
Returns an arbitrary coordinate system from a code.
|
CoordinateSystemAxis |
createCoordinateSystemAxis(String code)
Returns a coordinate system axis with name, direction, unit and range of values.
|
CylindricalCS |
createCylindricalCS(String code)
Returns a 3-dimensional coordinate system made of a polar coordinate system
extended by a straight perpendicular axis.
|
Datum |
createDatum(String code)
Returns an arbitrary datum from a code.
|
DerivedCRS |
createDerivedCRS(String code)
Returns a CRS that is defined by its coordinate conversion from another CRS (not by a datum).
|
Ellipsoid |
createEllipsoid(String code)
Returns a geometric figure that can be used to describe the approximate shape of the earth.
|
EllipsoidalCS |
createEllipsoidalCS(String code)
Returns a 2- or 3-dimensional coordinate system for geodetic latitude and longitude, sometime with ellipsoidal height.
|
EngineeringCRS |
createEngineeringCRS(String code)
Returns a 1-, 2- or 3-dimensional contextually local coordinate reference system.
|
EngineeringDatum |
createEngineeringDatum(String code)
Returns a datum defining the origin of an engineering coordinate reference system.
|
Extent |
createExtent(String code)
Returns information about spatial, vertical, and temporal extent (usually a domain of validity) from a code.
|
Set<CoordinateOperation> |
createFromCoordinateReferenceSystemCodes(String sourceCRS,
String targetCRS)
Returns operations from source and target coordinate reference system codes.
|
GeocentricCRS |
createGeocentricCRS(String code)
Returns a 3-dimensional coordinate reference system with the origin at the approximate centre of mass of the earth.
|
GeodeticDatum |
createGeodeticDatum(String code)
Returns a datum defining the location and orientation of an ellipsoid that approximates the shape of the earth.
|
GeographicCRS |
createGeographicCRS(String code)
Returns a 2- or 3-dimensional coordinate reference system based on an ellipsoidal approximation of the geoid.
|
ImageCRS |
createImageCRS(String code)
Returns a 2-dimensional engineering coordinate reference system applied to locations in images.
|
ImageDatum |
createImageDatum(String code)
Returns a datum defining the origin of an image coordinate reference system.
|
IdentifiedObject |
createObject(String code)
Returns an arbitrary object from a code.
|
OperationMethod |
createOperationMethod(String code)
Returns a description of the algorithm and parameters used to perform a coordinate operation.
|
ParameterDescriptor<?> |
createParameterDescriptor(String code)
Returns a definition of a single parameter used by an operation method.
|
PolarCS |
createPolarCS(String code)
Returns a 2-dimensional coordinate system for coordinates represented by a distance from the origin
and an angle from a fixed direction.
|
PrimeMeridian |
createPrimeMeridian(String code)
Returns a prime meridian defining the origin from which longitude values are determined.
|
ProjectedCRS |
createProjectedCRS(String code)
Returns a 2-dimensional coordinate reference system used to approximate the shape of the earth on a planar surface.
|
SphericalCS |
createSphericalCS(String code)
Returns a 3-dimensional coordinate system with one distance measured from the origin and two angular coordinates.
|
TemporalCRS |
createTemporalCRS(String code)
Returns a 1-dimensional coordinate reference system used for the recording of time.
|
TemporalDatum |
createTemporalDatum(String code)
Returns a datum defining the origin of a temporal coordinate reference system.
|
TimeCS |
createTimeCS(String code)
Returns a 1-dimensional coordinate system for heights or depths of points.
|
Unit<?> |
createUnit(String code)
Returns an unit of measurement from a code.
|
VerticalCRS |
createVerticalCRS(String code)
Returns a 1-dimensional coordinate reference system used for recording heights or depths.
|
VerticalCS |
createVerticalCS(String code)
Returns a 1-dimensional coordinate system for heights or depths of points.
|
VerticalDatum |
createVerticalDatum(String code)
Returns a datum identifying a particular reference level surface used as a zero-height surface.
|
Citation |
getAuthority()
Returns the database or specification that defines the codes recognized by this factory.
|
Set<String> |
getAuthorityCodes(Class<? extends IdentifiedObject> type)
Returns the set of authority codes for objects of the given type.
|
InternationalString |
getDescriptionText(String code)
Gets a description of the object corresponding to a code.
|
long |
getTimeout(TimeUnit unit)
Returns the amount of time that
ConcurrentAuthorityFactory will wait before to close a Data Access Object. |
protected boolean |
isCacheable(String code,
Object object)
Returns whether the given object can be cached.
|
protected abstract DAO |
newDataAccess()
Creates a factory which will perform the actual geodetic object creation work.
|
IdentifiedObjectFinder |
newIdentifiedObjectFinder()
Returns a finder which can be used for looking up unidentified objects.
|
protected String |
normalizeCode(String code)
Returns a code equivalent to the given code but with unnecessary elements eliminated.
|
void |
printCacheContent(PrintWriter out)
Prints the cache content to the given writer.
|
void |
setTimeout(long delay,
TimeUnit unit)
Sets a timer for closing the Data Access Object after the specified amount of time of inactivity.
|
String |
toString()
Returns a string representation of this factory for debugging purpose only.
|
createParametricCRS, createParametricCS, createParametricDatum, getCodeSpaces, trimNamespace
getVendor
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getVendor
protected ConcurrentAuthorityFactory(Class<DAO> dataAccessClass)
dataAccessClass
- The class of Data Access Object (DAO) created by newDataAccess()
.protected ConcurrentAuthorityFactory(Class<DAO> dataAccessClass, int maxStrongReferences, int maxConcurrentQueries)
maxStrongReferences
are created, then the strong references
for the eldest objects will be replaced by weak references.dataAccessClass
- the class of Data Access Object (DAO) created by newDataAccess()
.maxStrongReferences
- the maximum number of objects to keep by strong reference.maxConcurrentQueries
- the maximal amount of Data Access Objects to use concurrently.
If more than this amount of threads are querying this ConcurrentAuthorityFactory
concurrently,
additional threads will be blocked until a Data Access Object become available.protected abstract DAO newDataAccess() throws UnavailableFactoryException, FactoryException
createFoo(String)
method is invoked.
It may also be invoked again if additional factories are needed in different threads,
or if all factories have been closed after the timeout.
ConcurrentAuthorityFactory
does not hold any lock when invoking this method.
Subclasses are responsible to apply their own synchronization if needed,
but are encouraged to avoid doing so if possible.
In addition, implementations should not invoke other ConcurrentAuthorityFactory
methods during this method execution in order to avoid never-ending loop.createFoo(String)
methods.UnavailableFactoryException
- if the Data Access Object is unavailable because an optional resource is missing.FactoryException
- if the creation of Data Access Object failed for another reason.protected boolean canClose(DAO factory)
true
if the given Data Access Object (DAO) can be closed. This method is invoked automatically
after the timeout if the given DAO has been idle during all that time.
Subclasses can override this method and return false
if they want to prevent the DAO disposal
under some circumstances.
The default implementation always returns true
.
factory
- the Data Access Object which is about to be closed.true
if the given Data Access Object can be closed.close()
public long getTimeout(TimeUnit unit)
ConcurrentAuthorityFactory
will wait before to close a Data Access Object.
This delay is measured from the last time the Data Access Object has been used by a createFoo(String)
method.unit
- the desired unit of measurement for the timeout.public void setTimeout(long delay, TimeUnit unit)
newDataAccess()
method will be invoked again.delay
- the delay of inactivity before to close a Data Access Object.unit
- the unit of measurement of the given delay.public Citation getAuthority()
GeodeticAuthorityFactory.getAuthority()
method,null
.getAuthority
in interface AuthorityFactory
getAuthority
in class GeodeticAuthorityFactory
null
if unavailable.AbstractFactory.getVendor()
public Set<String> getAuthorityCodes(Class<? extends IdentifiedObject> type) throws FactoryException
AuthorityFactory.getAuthorityCodes(Class)
method,getAuthorityCodes
in interface AuthorityFactory
type
- the spatial reference objects type (e.g. ProjectedCRS.class
).FactoryException
- if access to the underlying database failed.public InternationalString getDescriptionText(String code) throws NoSuchAuthorityCodeException, FactoryException
GeodeticAuthorityFactory.getDescriptionText(String)
method,getDescriptionText
in interface AuthorityFactory
getDescriptionText
in class GeodeticAuthorityFactory
code
- value allocated by authority.null
if the object
corresponding to the specified code
has no description.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the query failed for some other reason.protected String normalizeCode(String code) throws FactoryException
The default implementation performs the following steps:
"EPSG:"
prefix, then that prefix is removed.code
- the code to normalize.FactoryException
- if an error occurred while normalizing the given code.public IdentifiedObject createObject(String code) throws FactoryException
GeodeticAuthorityFactory.createObject(String)
method,createObject
in interface AuthorityFactory
createObject
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.AbstractIdentifiedObject
public CoordinateReferenceSystem createCoordinateReferenceSystem(String code) throws FactoryException
createCoordinateReferenceSystem(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createCoordinateReferenceSystem(String)
method in the parent class. This allows to check if the more generic
createObject(String)
method cached a value before to try that method.createCoordinateReferenceSystem
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.AbstractCRS
,
CRS.forCode(String)
public GeographicCRS createGeographicCRS(String code) throws FactoryException
createGeographicCRS(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createGeographicCRS(String)
method in the parent class. This allows to check if the more generic
createCoordinateReferenceSystem(String)
method cached a value before to try that method.createGeographicCRS
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultGeographicCRS
,
CommonCRS.geographic()
,
CommonCRS.geographic3D()
public GeocentricCRS createGeocentricCRS(String code) throws FactoryException
createGeocentricCRS(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createGeocentricCRS(String)
method in the parent class. This allows to check if the more generic
createCoordinateReferenceSystem(String)
method cached a value before to try that method.createGeocentricCRS
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultGeocentricCRS
,
CommonCRS.geocentric()
public ProjectedCRS createProjectedCRS(String code) throws FactoryException
createProjectedCRS(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createProjectedCRS(String)
method in the parent class. This allows to check if the more generic
createCoordinateReferenceSystem(String)
method cached a value before to try that method.createProjectedCRS
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultProjectedCRS
public VerticalCRS createVerticalCRS(String code) throws FactoryException
createVerticalCRS(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createVerticalCRS(String)
method in the parent class. This allows to check if the more generic
createCoordinateReferenceSystem(String)
method cached a value before to try that method.createVerticalCRS
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultVerticalCRS
,
CommonCRS.Vertical.crs()
public TemporalCRS createTemporalCRS(String code) throws FactoryException
createTemporalCRS(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createTemporalCRS(String)
method in the parent class. This allows to check if the more generic
createCoordinateReferenceSystem(String)
method cached a value before to try that method.createTemporalCRS
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultTemporalCRS
,
CommonCRS.Temporal.crs()
public CompoundCRS createCompoundCRS(String code) throws FactoryException
createCompoundCRS(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createCompoundCRS(String)
method in the parent class. This allows to check if the more generic
createCoordinateReferenceSystem(String)
method cached a value before to try that method.createCompoundCRS
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultCompoundCRS
public DerivedCRS createDerivedCRS(String code) throws FactoryException
createDerivedCRS(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createDerivedCRS(String)
method in the parent class. This allows to check if the more generic
createCoordinateReferenceSystem(String)
method cached a value before to try that method.createDerivedCRS
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultDerivedCRS
public EngineeringCRS createEngineeringCRS(String code) throws FactoryException
createEngineeringCRS(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createEngineeringCRS(String)
method in the parent class. This allows to check if the more generic
createCoordinateReferenceSystem(String)
method cached a value before to try that method.createEngineeringCRS
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultEngineeringCRS
public ImageCRS createImageCRS(String code) throws FactoryException
createImageCRS(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createImageCRS(String)
method in the parent class. This allows to check if the more generic
createCoordinateReferenceSystem(String)
method cached a value before to try that method.createImageCRS
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultImageCRS
public Datum createDatum(String code) throws FactoryException
createDatum(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createDatum(String)
method in the parent class. This allows to check if the more generic
createObject(String)
method cached a value before to try that method.createDatum
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.AbstractDatum
public GeodeticDatum createGeodeticDatum(String code) throws FactoryException
createGeodeticDatum(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createGeodeticDatum(String)
method in the parent class. This allows to check if the more generic
createDatum(String)
method cached a value before to try that method.createGeodeticDatum
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultGeodeticDatum
,
CommonCRS.datum()
public VerticalDatum createVerticalDatum(String code) throws FactoryException
createVerticalDatum(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createVerticalDatum(String)
method in the parent class. This allows to check if the more generic
createDatum(String)
method cached a value before to try that method.createVerticalDatum
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultVerticalDatum
,
CommonCRS.Vertical.datum()
public TemporalDatum createTemporalDatum(String code) throws FactoryException
createTemporalDatum(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createTemporalDatum(String)
method in the parent class. This allows to check if the more generic
createDatum(String)
method cached a value before to try that method.createTemporalDatum
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultTemporalDatum
,
CommonCRS.Temporal.datum()
public EngineeringDatum createEngineeringDatum(String code) throws FactoryException
createEngineeringDatum(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createEngineeringDatum(String)
method in the parent class. This allows to check if the more generic
createDatum(String)
method cached a value before to try that method.createEngineeringDatum
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultEngineeringDatum
public ImageDatum createImageDatum(String code) throws FactoryException
createImageDatum(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createImageDatum(String)
method in the parent class. This allows to check if the more generic
createDatum(String)
method cached a value before to try that method.createImageDatum
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultImageDatum
public Ellipsoid createEllipsoid(String code) throws FactoryException
createEllipsoid(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createEllipsoid(String)
method in the parent class. This allows to check if the more generic
createObject(String)
method cached a value before to try that method.createEllipsoid
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultEllipsoid
,
CommonCRS.ellipsoid()
public PrimeMeridian createPrimeMeridian(String code) throws FactoryException
createPrimeMeridian(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createPrimeMeridian(String)
method in the parent class. This allows to check if the more generic
createObject(String)
method cached a value before to try that method.createPrimeMeridian
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultPrimeMeridian
,
CommonCRS.primeMeridian()
public Extent createExtent(String code) throws FactoryException
createExtent(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createExtent(String)
method in the parent class.createExtent
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultExtent
public CoordinateSystem createCoordinateSystem(String code) throws FactoryException
createCoordinateSystem(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createCoordinateSystem(String)
method in the parent class. This allows to check if the more generic
createObject(String)
method cached a value before to try that method.createCoordinateSystem
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.AbstractCS
,
CoordinateSystems.getEpsgCode(Unit, AxisDirection...)
public EllipsoidalCS createEllipsoidalCS(String code) throws FactoryException
createEllipsoidalCS(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createEllipsoidalCS(String)
method in the parent class. This allows to check if the more generic
createCoordinateSystem(String)
method cached a value before to try that method.createEllipsoidalCS
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultEllipsoidalCS
public VerticalCS createVerticalCS(String code) throws FactoryException
createVerticalCS(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createVerticalCS(String)
method in the parent class. This allows to check if the more generic
createCoordinateSystem(String)
method cached a value before to try that method.createVerticalCS
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultVerticalCS
public TimeCS createTimeCS(String code) throws FactoryException
createTimeCS(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createTimeCS(String)
method in the parent class. This allows to check if the more generic
createCoordinateSystem(String)
method cached a value before to try that method.createTimeCS
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultTimeCS
public CartesianCS createCartesianCS(String code) throws FactoryException
createCartesianCS(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createCartesianCS(String)
method in the parent class. This allows to check if the more generic
createCoordinateSystem(String)
method cached a value before to try that method.createCartesianCS
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultCartesianCS
public SphericalCS createSphericalCS(String code) throws FactoryException
createSphericalCS(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createSphericalCS(String)
method in the parent class. This allows to check if the more generic
createCoordinateSystem(String)
method cached a value before to try that method.createSphericalCS
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultSphericalCS
public CylindricalCS createCylindricalCS(String code) throws FactoryException
createCylindricalCS(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createCylindricalCS(String)
method in the parent class. This allows to check if the more generic
createCoordinateSystem(String)
method cached a value before to try that method.createCylindricalCS
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultCylindricalCS
public PolarCS createPolarCS(String code) throws FactoryException
createPolarCS(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createPolarCS(String)
method in the parent class. This allows to check if the more generic
createCoordinateSystem(String)
method cached a value before to try that method.createPolarCS
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultPolarCS
public CoordinateSystemAxis createCoordinateSystemAxis(String code) throws FactoryException
createCoordinateSystemAxis(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createCoordinateSystemAxis(String)
method in the parent class. This allows to check if the more generic
createObject(String)
method cached a value before to try that method.createCoordinateSystemAxis
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultCoordinateSystemAxis
public Unit<?> createUnit(String code) throws FactoryException
createUnit(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createUnit(String)
method in the parent class.createUnit
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.Units.valueOfEPSG(int)
public ParameterDescriptor<?> createParameterDescriptor(String code) throws FactoryException
createParameterDescriptor(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createParameterDescriptor(String)
method in the parent class. This allows to check if the more generic
createObject(String)
method cached a value before to try that method.createParameterDescriptor
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultParameterDescriptor
,
Apache SIS™ Coordinate Operation Methodspublic OperationMethod createOperationMethod(String code) throws FactoryException
createOperationMethod(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createOperationMethod(String)
method in the parent class. This allows to check if the more generic
createObject(String)
method cached a value before to try that method.createOperationMethod
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.DefaultOperationMethod
,
Apache SIS™ Coordinate Operation Methodspublic CoordinateOperation createCoordinateOperation(String code) throws FactoryException
createCoordinateOperation(String)
method, invoke that method and cache the result for future use.GeodeticAuthorityFactory.createCoordinateOperation(String)
method in the parent class. This allows to check if the more generic
createObject(String)
method cached a value before to try that method.createCoordinateOperation
in class GeodeticAuthorityFactory
code
- value allocated by authority.FactoryException
- if the object creation failed.AbstractCoordinateOperation
public Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(String sourceCRS, String targetCRS) throws FactoryException
GeodeticAuthorityFactory.createFromCoordinateReferenceSystemCodes(String, String)
method,createFromCoordinateReferenceSystemCodes
in class GeodeticAuthorityFactory
sourceCRS
- coded value of source coordinate reference system.targetCRS
- coded value of target coordinate reference system.sourceCRS
to targetCRS
.FactoryException
- if the object creation failed.public IdentifiedObjectFinder newIdentifiedObjectFinder() throws FactoryException
newIdentifiedObjectFinder
in class GeodeticAuthorityFactory
FactoryException
- if the finder can not be created.IdentifiedObjects.newFinder(String)
protected boolean isCacheable(String code, Object object)
isCacheable(…)
method returns true
, then the newly created object will be cached so
that next calls to the same createFoo(String)
method with the same code may return the same object.
If this method returns false
, then the newly created object will not be cached and next call to
the createFoo(String)
method with the same code will return a new object.
The default implementation always returns true
.
Subclasses can override this method for filtering the objects to store in the cache.
code
- the authority code specified by the caller for creating an object.object
- the object created for the given authority code.printCacheContent(PrintWriter)
@Debug public void printCacheContent(PrintWriter out)
out
- the output printer, or null
for the standard output stream.isCacheable(String, Object)
public void close() throws FactoryException
ConcurrentAuthorityFactory
can still be used as usual after it has been "closed".
New Data Access Objects will be created if needed for replacing
the ones closed by this method.
The main purpose of this method is to force immediate release of JDBC connections or other kind of resources
that Data Access Objects may hold. If this method is not invoked, Data Access Objects will be closed
when this ConcurrentAuthorityFactory
will be garbage collected or at JVM shutdown time,
depending which event happen first.
close
in interface AutoCloseable
FactoryException
- if an error occurred while closing the Data Access Objects.canClose(GeodeticAuthorityFactory)
@Debug public String toString()
toString
in class GeodeticAuthorityFactory
printCacheContent(PrintWriter)
Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.