/** * Returns the service registry. The registry will be created the first time this method is * invoked. */ private static FactoryRegistry getServiceRegistry() { synchronized (Processors.class) { if (registry == null) { registry = new FactoryCreator(ProcessFactory.class); } } return registry; }
final int modifiers = type.getModifiers(); if (!Modifier.isAbstract(modifiers)) { final T candidate = createSafe(category, type, hints); if (candidate == null) { continue; if (isAcceptable(candidate, category, hints, filter)) { cache(category, candidate); return candidate; dispose(candidate); Iterable<T> unfilteredFactories = getUnfilteredFactories(category)::iterator; for (final T factory : unfilteredFactories) { final Class<?> implementation = factory.getClass(); if (types != null && !isTypeOf(types, implementation)) { continue; candidate = createSafe(category, implementation, hints); } catch (FactoryNotFoundException exception) { continue; if (isAcceptable(candidate, category, hints, filter)) { cache(category, candidate); return candidate; dispose(candidate);
/** * Invokes {@link #createServiceProvider}, but checks against recursive calls. If the specified * implementation is already under construction, returns {@code null} in order to tell to {@link * #getFactory} that it need to search for an other implementation. This is needed for avoiding * infinite recursivity when a factory is a wrapper around an ther factory of the same category. * For example this is the case of {@link * org.geotools.referencing.operation.BufferedCoordinateOperationFactory}. */ private <T> T createSafe( final Class<T> category, final Class<?> implementation, final Hints hints) { if (!underConstruction.add(implementation)) { return null; } try { return createServiceProvider(category, implementation, hints); } finally { if (!underConstruction.remove(implementation)) { throw new AssertionError(); } } }
return super.isAcceptable(provider, category, hints);
/** * Creates a new instance of the specified factory using the specified hints. * * @param category The category to instantiate. * @param implementation The factory class to instantiate. * @param hints The implementation hints. * @return The factory. * @throws FactoryRegistryException if the factory creation failed. */ protected Object createServiceProvider( final Class category, final Class implementation, final Hints hints) throws FactoryRegistryException { if (GeometryFactory.class.isAssignableFrom(category) && GeometryFactory.class.equals(implementation)) { return new GeometryFactory( getPrecisionModel(hints), getSRID(hints), getCoordinateSequenceFactory(hints)); } return super.createServiceProvider(category, implementation, hints); }
/** * Returns the service registry. The registry will be created the first time this method is * invoked. */ private static FactoryRegistry getServiceRegistry() { if (registry == null) { registry = new FactoryCreator( Arrays.asList(new Class<?>[] {GranuleHandlerFactorySPI.class})); } return registry; } }
/** * Returns the service registry. The registry will be created the first time this method is * invoked. */ private static FactoryRegistry getServiceRegistry() { if (registry == null) { registry = new FactoryCreator( Arrays.asList(new Class<?>[] {SubmosaicProducerFactory.class})); } return registry; } }
/** * Returns the service registry. The registry will be created the first time this method is * invoked. */ private static FactoryRegistry getServiceRegistry() { if (registry == null) { registry = new FactoryCreator( Arrays.asList(new Class<?>[] {CoverageNameCollectorSPI.class})); } return registry; } }
/** * Returns the service registry. The registry will be created the first time this method is * invoked. */ private static FactoryRegistry getServiceRegistry() { if (registry == null) { registry = new FactoryCreator( Arrays.asList(new Class<?>[] {GranuleAcceptorFactorySPI.class})); } return registry; } }
/** * Returns the service registry. The registry will be created the first time this method is * invoked. */ private static FactoryRegistry getServiceRegistry() { assert Thread.holdsLock(CoordinateHandlerFinder.class); if (registry == null) { registry = new FactoryCreator(Arrays.asList(new Class<?>[] {CoordinateHandlerSpi.class})); } return registry; }
/** * Returns the service registry. The registry will be created the first time this method is * invoked. */ private static FactoryRegistry getServiceRegistry() { assert Thread.holdsLock(CoverageIO.class); if (REGISTRY == null) { REGISTRY = new FactoryCreator(Arrays.asList(new Class<?>[] {Driver.class})); } return REGISTRY; }
/** * Returns the service registry. The registry will be created the first time this method is * invoked. */ private static FactoryRegistry getServiceRegistry() { assert Thread.holdsLock(DataAccessFinder.class); if (registry == null) { registry = new FactoryCreator(Arrays.asList(new Class<?>[] {DataAccessFactory.class})); } return registry; }
/** * Returns the service registry. The registry will be created the first time this method is * invoked. */ private static FactoryRegistry getServiceRegistry() { assert Thread.holdsLock(FootprintLoaderFinder.class); if (registry == null) { registry = new FactoryCreator(Arrays.asList(new Class<?>[] {FootprintLoaderSpi.class})); } return registry; }
/** * Returns the service registry. The registry will be created the first time this method is * invoked. */ private static FactoryRegistry getServiceRegistry() { assert Thread.holdsLock(GridFormatFinder.class); if (registry == null) { registry = new FactoryCreator(Arrays.asList(new Class<?>[] {GridFormatFactorySpi.class})); } return registry; }
/** * Returns the service registry. The registry will be created the first time this method is * invoked. */ private static FactoryRegistry getServiceRegistry() { assert Thread.holdsLock(CoverageFactoryFinder.class); if (registry == null) { registry = new FactoryCreator(Arrays.asList(new Class<?>[] {GridCoverageFactory.class})); } return registry; }
/** * Returns the service registry. The registry will be created the first time this method is * invoked. */ private static FactoryRegistry getServiceRegistry() { assert Thread.holdsLock(DataStoreFinder.class); if (registry == null) { registry = new FactoryCreator(Arrays.asList(new Class<?>[] {DataStoreFactorySpi.class})); } return registry; }
/** * Returns the service registry. The registry will be created the first time this method is * invoked. */ private static FactoryRegistry getServiceRegistry() { assert Thread.holdsLock(PropertiesCollectorFinder.class); if (registry == null) { registry = new FactoryCreator( Arrays.asList(new Class<?>[] {PropertiesCollectorSPI.class})); } return registry; }
/** * Returns the service registry. The registry will be created the first time this method is * invoked. */ private static FactoryRegistry getServiceRegistry() { assert Thread.holdsLock(DataSourceFinder.class); if (registry == null) { registry = new FactoryCreator( Arrays.asList( new Class<?>[] {DataSourceFactorySpi.class, UnWrapper.class})); } return registry; }
/** * Returns the service registry. The registry will be created the first time this method is * invoked. */ private static FactoryRegistry getServiceRegistry() { assert Thread.holdsLock(DynamicSymbolFactoryFinder.class); if (registry == null) { registry = new FactoryCreator( Arrays.asList( new Class<?>[] { MarkFactory.class, ExternalGraphicFactory.class })); } return registry; }
/** * Returns the service registry. The registry will be created the first time this method is * invoked. */ private static FactoryRegistry getServiceRegistry() { assert Thread.holdsLock(Converters.class); if (registry == null) { registry = new FactoryCreator( Arrays.asList( new Class<?>[] { ConverterFactory.class, })); } return registry; } // /**