Examples of OperationRegistry


Examples of javax.media.jai.OperationRegistry

                ioRegistry.deregisterServiceProvider(provider);
                LOGGER.info("Unregistering Image I/O provider " + provider);
            }
           
            // unload everything that JAI can still refer to
            final OperationRegistry opRegistry = JAI.getDefaultInstance().getOperationRegistry();
            for(String mode : RegistryMode.getModeNames()) {
                for (Iterator descriptors = opRegistry.getDescriptors(mode).iterator(); descriptors != null && descriptors.hasNext();) {
                    RegistryElementDescriptor red = (RegistryElementDescriptor) descriptors.next();
                    int factoryCount = 0;
                    int unregisteredCount = 0;
                    // look for all the factories for that operation
                    for (Iterator factories = opRegistry.getFactoryIterator(mode, red.getName()); factories != null && factories.hasNext();) {
                        Object factory = factories.next();
                        if(factory == null) {
                            continue;
                        }
                        factoryCount++;
                        if(webappClassLoader.equals(factory.getClass().getClassLoader())) {
                            boolean unregistered = false;
                            // we need to scan against all "products" to unregister the factory
                            Vector orderedProductList = opRegistry.getOrderedProductList(mode, red.getName());
                            if(orderedProductList != null) {
                                for(Iterator products = orderedProductList.iterator(); products != null && products.hasNext();) {
                                    String product = (String) products.next();
                                    try {
                                        opRegistry.unregisterFactory(mode, red.getName(), product, factory);
                                        LOGGER.info("Unregistering JAI factory " + factory.getClass());
                                    } catch(Throwable t) {
                                        // may fail due to the factory not being registered against that product
                                    }
                                }
                            }
                            if(unregistered) {
                                unregisteredCount++;
                            }
                           
                        }
                    }
                   
                    // if all the factories were unregistered, get rid of the descriptor as well
                    if(factoryCount > 0 && unregisteredCount == factoryCount) {
                        opRegistry.unregisterDescriptor(red);
                    }
                }
            }
           
            // flush all javabean introspection caches as this too can keep a webapp classloader from being unloaded
View Full Code Here

Examples of javax.media.jai.OperationRegistry

            if (url == null) {
                throw new RuntimeException("Could not find the main registry file");
            }

            OperationRegistry registry = new ConcurrentOperationRegistry();

            if (url != null) {
                registry.updateFromStream(url);
            }

            registry.registerServices(null);

            return registry;

        } catch (IOException ioe) {
            ImagingListener listener = JAI.getDefaultInstance().getImagingListener();
View Full Code Here

Examples of javax.media.jai.OperationRegistry

                ioRegistry.deregisterServiceProvider(provider);
                LOGGER.info("Unregistering Image I/O provider " + provider);
            }
           
            // unload everything that JAI can still refer to
            final OperationRegistry opRegistry = JAI.getDefaultInstance().getOperationRegistry();
            for(String mode : RegistryMode.getModeNames()) {
                for (Iterator descriptors = opRegistry.getDescriptors(mode).iterator(); descriptors != null && descriptors.hasNext();) {
                    RegistryElementDescriptor red = (RegistryElementDescriptor) descriptors.next();
                    int factoryCount = 0;
                    int unregisteredCount = 0;
                    // look for all the factories for that operation
                    for (Iterator factories = opRegistry.getFactoryIterator(mode, red.getName()); factories != null && factories.hasNext();) {
                        Object factory = factories.next();
                        if(factory == null) {
                            continue;
                        }
                        factoryCount++;
                        if(webappClassLoader.equals(factory.getClass().getClassLoader())) {
                            boolean unregistered = false;
                            // we need to scan against all "products" to unregister the factory
                            Vector orderedProductList = opRegistry.getOrderedProductList(mode, red.getName());
                            if(orderedProductList != null) {
                                for(Iterator products = orderedProductList.iterator(); products != null && products.hasNext();) {
                                    String product = (String) products.next();
                                    try {
                                        opRegistry.unregisterFactory(mode, red.getName(), product, factory);
                                        LOGGER.info("Unregistering JAI factory " + factory.getClass());
                                    } catch(Throwable t) {
                                        // may fail due to the factory not being registered against that product
                                    }
                                }
                            }
                            if(unregistered) {
                                unregisteredCount++;
                            }
                           
                        }
                    }
                   
                    // if all the factories were unregistered, get rid of the descriptor as well
                    if(factoryCount > 0 && unregisteredCount == factoryCount) {
                        opRegistry.unregisterDescriptor(red);
                    }
                }
            }
           
            // flush all javabean introspection caches as this too can keep a webapp classloader from being unloaded
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.