public abstract class DeferredAuthorityFactory extends BufferedAuthorityFactory implements OptionalFactory
LOGGER
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority
Modifier | Constructor and Description |
---|---|
protected |
DeferredAuthorityFactory(Hints userHints,
int priority)
Constructs an instance without initial backing store.
|
protected |
DeferredAuthorityFactory(Hints userHints,
int priority,
int maxStrongReferences)
Constructs an instance without initial backing store.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canDisposeBackingStore(AbstractAuthorityFactory backingStore)
Returns
true if the backing store can be disposed now. |
protected abstract AbstractAuthorityFactory |
createBackingStore()
Creates the backing store authority factory.
|
void |
dispose()
Releases resources immediately instead of waiting for the garbage collector.
|
protected void |
disposeBackingStore()
Disposes of the backing store
|
static void |
exit()
Gets rid of the timer thread at application shutdown
|
protected AbstractAuthorityFactory |
getBackingStore()
Returns the backing store authority factory.
|
boolean |
isAvailable()
Returns
true if this factory is available. |
boolean |
isConnected()
Returns
true if this deferred factory is connected to its backing store. |
void |
setTimeout(long delay)
Set a timer for disposing the backing store after the specified amount of milliseconds of
inactivity.
|
createCartesianCS, createCompoundCRS, createCoordinateOperation, createCoordinateReferenceSystem, createCoordinateSystem, createCoordinateSystemAxis, createCylindricalCS, createDatum, createDerivedCRS, createEllipsoid, createEllipsoidalCS, createEngineeringCRS, createEngineeringDatum, createExtent, createFromCoordinateReferenceSystemCodes, createGeocentricCRS, createGeodeticDatum, createGeographicCRS, createImageCRS, createImageDatum, createObject, createOperationMethod, createParameterDescriptor, createPolarCS, createPrimeMeridian, createProjectedCRS, createSphericalCS, createTemporalCRS, createTemporalDatum, createTimeCS, createUnit, createVerticalCRS, createVerticalCS, createVerticalDatum, getAuthority, getAuthorityCodes, getBackingStoreDescription, getDescriptionText, getIdentifiedObjectFinder, getVendor
noSuchAuthorityCode, trimAuthority
ensureNonNull
addImplementationHints, equals, getImplementationHints, getPriority, hashCode, onDeregistration, onRegistration, toString
getImplementationHints
protected DeferredAuthorityFactory(Hints userHints, int priority)
createBackingStore()
method is invoked.userHints
- An optional set of hints, or null
if none.priority
- The priority for this factory, as a number between MINIMUM_PRIORITY
and MAXIMUM_PRIORITY
inclusive.createBackingStore()
protected DeferredAuthorityFactory(Hints userHints, int priority, int maxStrongReferences)
createBackingStore()
method is invoked.userHints
- An optional set of hints, or null
if none.priority
- The priority for this factory, as a number between MINIMUM_PRIORITY
and MAXIMUM_PRIORITY
inclusive.maxStrongReferences
- The maximum number of objects to keep by strong reference.createBackingStore()
public boolean isAvailable()
true
if this factory is available. The default implementation returns false
if createBackingStore()
throws an exception.isAvailable
in interface OptionalFactory
protected final AbstractAuthorityFactory getBackingStore() throws FactoryException
createXXX(...)
methods.FactoryException
- if the creation of backing store failed.protected abstract AbstractAuthorityFactory createBackingStore() throws FactoryException
createXXX(...)
method is invoked.createXXX(...)
methods.FactoryNotFoundException
- if the backing store has not been found.FactoryException
- if the creation of backing store failed for an other reason.public boolean isConnected()
public void setTimeout(long delay)
createBackingStore()
method will be responsible for creating a new
backing store when needed. Note that the backing store disposal can be vetoed if canDisposeBackingStore(org.geotools.referencing.factory.AbstractAuthorityFactory)
returns false
.delay
- The minimal delay before to close the backing store. This delay is very
approximative. The backing store will not be closed before, but may take as much as twice
that time before to be closed.protected boolean canDisposeBackingStore(AbstractAuthorityFactory backingStore)
true
if the backing store can be disposed now. This method is invoked
automatically after the amount of time specified by setTimeout(long)
if the factory were
not used during that time. The default implementation always returns true
. Subclasses
should override this method and returns false
if they want to prevent the backing
store disposal under some circonstances.backingStore
- The backing store in process of being disposed.public void dispose() throws FactoryException
canDisposeBackingStore(org.geotools.referencing.factory.AbstractAuthorityFactory)
value.dispose
in class BufferedAuthorityFactory
FactoryException
- if an error occured while disposing the factory.public static void exit()
protected void disposeBackingStore()
FactoryException
Copyright © 1996–2019 Geotools. All rights reserved.