/** * Looks up a certain factory using two methods: * * <ul> * <li>First and un-synchronized lookup in the hints, should the user have provided the * preferred factroy * <li>A standard SPI registry scan, which has to be fully synchronized * * @param category * @param hints * @param key * @return */ private static <T> T lookup(Class<T> category, Hints hints, Hints.Key key) { // nulls? if (hints == null || key == null) { return null; } // see if the user expressed a preference in the hints final Object hint = hints.get(key); if (hint != null) { if (category.isInstance(hint)) { return category.cast(hint); } } // otherwise do the lousy slow system scan synchronized (CommonFactoryFinder.class) { return getServiceRegistry().getFactory(category, null, hints, key); } }
/** * Returns a set of all available implementations for the {@link FeatureLockFactory} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set<FeatureLockFactory> of available style factory implementations. * @deprecated FeatureLockFactory is no longer needed */ public static synchronized Set<FeatureLockFactory> getFeatureLockFactories(Hints hints) { hints = mergeSystemHints(hints); return new LazySet<FeatureLockFactory>( getServiceRegistry().getFactories(FeatureLockFactory.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link Function} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available function expression implementations. */ public static synchronized Set<Function> getFunctions(Hints hints) { hints = mergeSystemHints(hints); return new LazySet<Function>( getServiceRegistry().getFactories(Function.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link FeatureCollections} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available feature collections implementations. */ public static synchronized Set<FeatureCollections> getFeatureCollectionsSet(Hints hints) { hints = mergeSystemHints(hints); return new LazySet<FeatureCollections>( getServiceRegistry().getFactories(FeatureCollections.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link FilterFactory} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available filter factory implementations. */ public static synchronized Set<FilterFactory> getFilterFactories(Hints hints) { hints = mergeSystemHints(hints); return new LazySet<FilterFactory>( getServiceRegistry().getFactories(FilterFactory.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link StyleFactory} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available style factory implementations. */ public static synchronized Set<StyleFactory> getStyleFactories(Hints hints) { hints = mergeSystemHints(hints); return new LazySet<StyleFactory>( getServiceRegistry().getFactories(StyleFactory.class, null, hints)); }
/** * Returns a set of all available implementations of {@link FunctionFactory}. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available function factory implementations. */ public static synchronized Set<FunctionFactory> getFunctionFactories(Hints hints) { hints = mergeSystemHints(hints); return new LazySet<FunctionFactory>( getServiceRegistry().getFactories(FunctionFactory.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link FileDataStoreFactorySpi} * interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available file data store factory implementations. */ public static synchronized Set<FileDataStoreFactorySpi> getFileDataStoreFactories(Hints hints) { hints = mergeSystemHints(hints); return new LazySet<FileDataStoreFactorySpi>( getServiceRegistry().getFactories(FileDataStoreFactorySpi.class, null, hints)); }
/** * Returns the first implementation of {@link StyleFactory} matching the specified hints. * If no implementation matches, a new one is created if possible or an exception is thrown * otherwise. * * @param hints An optional map of hints, or {@code null} if none. * @return The first style factory that matches the supplied hints. * @throws FactoryRegistryException if no implementation was found or can be created for the * {@link StyleFactory} interface. * * @see Hints#STYLE_FACTORY */ public static synchronized StyleFactory getStyleFactory(Hints hints) throws FactoryRegistryException { hints = mergeSystemHints(hints); return (StyleFactory) getServiceRegistry().getServiceProvider( StyleFactory.class, null, hints, Hints.STYLE_FACTORY); }
/** * Returns the first implementation of {@link FeatureCollections} matching the specified hints. * If no implementation matches, a new one is created if possible or an exception is thrown * otherwise. * * @param hints An optional map of hints, or {@code null} if none. * @return The first feature collections that matches the supplied hints. * @throws FactoryRegistryException if no implementation was found or can be created for the * {@link FeatureCollections} interface. * * @see Hints#FEATURE_COLLECTIONS */ public static synchronized FeatureCollections getFeatureCollections(Hints hints) { hints = mergeSystemHints(hints); return (FeatureCollections) getServiceRegistry().getServiceProvider( FeatureCollections.class, null, hints, Hints.FEATURE_COLLECTIONS); }
/** * Returns the first implementation of {@link FeatureLockFactory} matching the specified hints. * If no implementation matches, a new one is created if possible or an exception is thrown * otherwise. * * @param hints An optional map of hints, or {@code null} if none. * @return The first feature lock factory that matches the supplied hints. * @throws FactoryRegistryException if no implementation was found or can be created for the * {@link FeatureLockFactory} interface. * * @see Hints#FEATURE_LOCK_FACTORY */ public static synchronized FeatureLockFactory getFeatureLockFactory(Hints hints) { hints = mergeSystemHints(hints); return (FeatureLockFactory) getServiceRegistry().getServiceProvider( FeatureLockFactory.class, null, hints, Hints.FEATURE_LOCK_FACTORY); }
/** * Returns a set of all available implementations for the {@link FileDataStoreFactorySpi} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available file data store factory implementations. */ public static synchronized Set getFileDataStoreFactories(Hints hints) { hints = mergeSystemHints(hints); return new LazySet(getServiceRegistry().getServiceProviders( FileDataStoreFactorySpi.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link FeatureCollections} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available feature collections implementations. */ public static synchronized Set getFeatureCollectionsSet(Hints hints) { hints = mergeSystemHints(hints); return new LazySet(getServiceRegistry().getServiceProviders( FeatureCollections.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link FilterFactory} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available filter factory implementations. */ public static synchronized Set getFilterFactories(Hints hints) { hints = mergeSystemHints(hints); return new LazySet(getServiceRegistry().getServiceProviders( FilterFactory.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link StyleFactory} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available style factory implementations. */ public static synchronized Set getStyleFactories(Hints hints) { hints = mergeSystemHints(hints); return new LazySet(getServiceRegistry().getServiceProviders( StyleFactory.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link FunctionExpression} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available style factory implementations. * @deprecated Use FunctionExpression is now @deprecated */ public static synchronized Set getFunctionExpressions(Hints hints) { hints = mergeSystemHints(hints); return new LazySet(getServiceRegistry().getServiceProviders( Function.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link FunctionExpression} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available function expression implementations. */ public static synchronized Set getFunctions(Hints hints) { hints = mergeSystemHints(hints); return new LazySet(getServiceRegistry().getServiceProviders( FunctionImpl.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link FeatureLockFactory} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set<FeatureLockFactory> of available style factory implementations. */ public static synchronized Set getFeatureLockFactories(Hints hints) { hints = mergeSystemHints(hints); return new LazySet(getServiceRegistry().getServiceProviders( FeatureLockFactory.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link AttributeTypeFactory} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available attribute type factory implementations. */ public static synchronized Set getAttributeTypeFactories(Hints hints) { hints = mergeSystemHints(hints); return new LazySet(getServiceRegistry().getServiceProviders( AttributeTypeFactory.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link FeatureTypeFactory} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available feature type factory implementations. */ public static synchronized Set getAttributeFeatureFactories(Hints hints) { hints = mergeSystemHints(hints); return new LazySet(getServiceRegistry().getServiceProviders( FeatureTypeFactory.class, null, hints)); }