|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface OptionalFactory
An optional factory that may not be available in all configurations.
Such factories often need some external resources. For example the default EPSG factory need a MS-Access database installed on the client machine. This database is not bundle in Geotools distribution; if the user have not installed it, the factory can't work.
This interface is not a manager for automatic download of external resources.
It is just a way to tell to FactoryFinder
that this factory exists, but can't do its
job for whatever reasons (usually a missing resource that the user shall download and install
himself), so FactoryFinder
has to choose an other factory. In other words, the
OptionalFactory
interface is used as a filter, nothing else. The process is as follows:
FactoryRegistry.getServiceProvider(java.lang.Class, javax.imageio.spi.ServiceRegistry.Filter, org.geotools.factory.Hints, org.geotools.factory.Hints.Key)
is invoked, it starts to iterate over all
registered factories. If an ordering is set, it is taken in account for the iteration order.isAvailable()
is invoked. If it returns true
, then this optional factory
is processed like any other factories. Otherwise it is ignored.
NOTE: OptionalFactory
is not designed for factories with intermittent
state (i.e. return value of isAvailable()
varying in an unpredictable way). The behavior
is undetermined if the isAvailable()
state changes with time.
DataAccessFactory.isAvailable()
Method Summary | |
---|---|
boolean |
isAvailable()
Returns true if this factory is ready for use. |
Methods inherited from interface Factory |
---|
getImplementationHints |
Method Detail |
---|
boolean isAvailable()
true
if this factory is ready for use.
An optional factory may returns false
for now but returns true
later.
However, the converse is not recommended.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |