From: <svn...@os...> - 2010-07-24 13:53:46
|
Author: aaime Date: 2010-07-24 13:53:37 +0000 (Sat, 24 Jul 2010) New Revision: 35952 Modified: trunk/modules/unsupported/process/src/main/java/org/geotools/process/Processors.java Log: Adding methods to add and remove a process factory at runtime without SPI registration Modified: trunk/modules/unsupported/process/src/main/java/org/geotools/process/Processors.java =================================================================== --- trunk/modules/unsupported/process/src/main/java/org/geotools/process/Processors.java 2010-07-23 14:27:38 UTC (rev 35951) +++ trunk/modules/unsupported/process/src/main/java/org/geotools/process/Processors.java 2010-07-24 13:53:37 UTC (rev 35952) @@ -69,6 +69,26 @@ } /** + * Dynamically register a new process factory into SPI + * @param factory + */ + public static void addProcessFactory(ProcessFactory factory) { + getServiceRegistry().registerServiceProvider(factory); + } + + /** + * Dynamically removes a process factory from SPI. Normally the factory has been + * added before via {@link #addProcessFactory(ProcessFactory)} + * @param factory + */ + public static void removeProcessFactory(ProcessFactory factory) { + if(lastFactory == factory) { + lastFactory = null; + } + getServiceRegistry().deregisterServiceProvider(factory); + } + + /** * Set of available ProcessFactory; each of which is responsible for one or more processes. * * @return Set of ProcessFactory |