int unregisteredCount = 0; for (Iterator factories = opRegistry.getFactoryIterator(mode, red.getName()); factories != null && factories.hasNext(); ) { Object factory = factories.next(); opRegistry.getOrderedProductList(mode, red.getName()); if (orderedProductList != null) { for (Iterator products = orderedProductList.iterator(); try { opRegistry.unregisterFactory( mode, red.getName(), product, factory); LOGGER.info( "Unregistering JAI factory " + factory.getClass());
/** * Constructs a parameter descriptor wrapping the specified JAI operation, including sources. * The properties map is given unchanged to the {@linkplain * AbstractIdentifiedObject#AbstractIdentifiedObject(Map) super-class constructor}. * * @param properties Set of properties. Should contains at least {@code "name"}. * @param operation The JAI's operation descriptor, usually as an instance of {@link * OperationDescriptor}. * @param sourceTypeMap Mapping from JAI source type to this group source type. Typically a * singleton with the (<code>{@linkplain RenderedImage}.class</code>, <code> * {@linkplain GridCoverage}.class</code>) key-value pair. * @param registryMode The JAI's registry mode (usually {@value * javax.media.jai.registry.RenderedRegistryMode#MODE_NAME}). * @deprecated Replaced by {@link #ImagingParameterDescriptors(Map, * RegistryElementDescriptor,String,Map,Collection}. */ public ImagingParameterDescriptors( final Map<String, ?> properties, final RegistryElementDescriptor operation, final Map<Class<?>, Class<?>> sourceTypeMap, final String registryMode) { this( properties, operation.getParameterListDescriptor(registryMode), operation, registryMode, sourceTypeMap, null); }
descriptor = (RegistryElementDescriptor)it.next(); descriptorNode = new NamedTreeNode(getName(descriptor, locale), descriptor); param = descriptor.getParameterListDescriptor(mode); if (param != null) { final String[] names = param.getParamNames(); final String operationName = descriptor.getName(); final List/*<String>*/ products = registry.getOrderedProductList(mode, operationName); if (products != null) {
String name = operation.getName(); final Map<String, Object> properties = new HashMap<String, Object>(); if (operation instanceof OperationDescriptor) {
this( properties, operation.getParameterListDescriptor(registryMode), operation, registryMode,
mode = operation.getRegistryModeName(); element = operation.getRegistry().getDescriptor(mode, name); param = element.getParameterListDescriptor(mode);
/** * Returns the localized name for the given descriptor. The name will be fecth from the * "{@link OperationDescriptor#getResourceBundle LocalName}" resource, if available. * Otherwise, the {@linkplain RegistryElementDescriptor#getName non-localized name} is returned. */ private static String getName(final RegistryElementDescriptor descriptor, final Locale locale) { if (descriptor instanceof OperationDescriptor) { ResourceBundle resources = ((OperationDescriptor)descriptor).getResourceBundle(locale); if (resources != null) try { return resources.getString("LocalName"); } catch (MissingResourceException exception) { // No localized name. Fallback on the default (non-localized) descriptor name. // No warning to report here, this exception is really not a problem. } } return descriptor.getName(); }
final String mode = operation.getRegistryModeName(); descriptor = operation.getRegistry().getDescriptor(mode, name) .getParameterListDescriptor(mode);
public void unregisterDescriptor(RegistryElementDescriptor descriptor) { Lock writeLock = lock.writeLock(); boolean changed = false; try { writeLock.lock(); super.unregisterDescriptor(descriptor); changed = true; if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.log(Level.FINEST, "Unregistered descriptor for the operation: " + descriptor.getName()); } // If the collection is present, then it is updated if(collection != null && changed && descriptor instanceof OperationDescriptor){ OperationItem item = new OperationItem((OperationDescriptor) descriptor); collection.removeSingleOp(item); if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.log(Level.FINEST, "Removed descriptor for the operation: " + descriptor.getName() + " from the registry operation list"); } } } finally { writeLock.unlock(); } }
public void unregisterDescriptor(RegistryElementDescriptor descriptor) { Lock writeLock = lock.writeLock(); boolean changed = false; try { writeLock.lock(); super.unregisterDescriptor(descriptor); changed = true; if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.log(Level.FINEST, "Unregistered descriptor for the operation: " + descriptor.getName()); } // If the collection is present, then it is updated if(collection != null && changed && descriptor instanceof OperationDescriptor){ OperationItem item = new OperationItem((OperationDescriptor) descriptor); collection.removeSingleOp(item); if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.log(Level.FINEST, "Removed descriptor for the operation: " + descriptor.getName() + " from the registry operation list"); } } } finally { writeLock.unlock(); } }
/** * Unregisters all Geotk JAI operations. */ @Override public void shutdown() { if (initialized) { final OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry(); for (final String mode : registry.getRegistryModes()) { @SuppressWarnings("unchecked") final List<RegistryElementDescriptor> descriptors = registry.getDescriptors(mode); for (final RegistryElementDescriptor descriptor : descriptors) { final String operationName = descriptor.getName(); if (operationName.startsWith("org.geotoolkit.")) { @SuppressWarnings("unchecked") final Iterator<RenderedImageFactory> rif = RIFRegistry.getIterator(registry, operationName); while (rif.hasNext()) { RIFRegistry.unregister(registry, operationName, PRODUCT_NAME, rif.next()); } registry.unregisterDescriptor(descriptor); } } } } } }
/** * Counts the number of Geotk operations registered in the default JAI instance. */ private static int countGeotkOperations() { int count = 0; final OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry(); for (final String mode : registry.getRegistryModes()) { @SuppressWarnings("unchecked") final List<RegistryElementDescriptor> descriptors = registry.getDescriptors(mode); for (final RegistryElementDescriptor descriptor : descriptors) { final String operationName = descriptor.getName(); if (operationName.startsWith("org.geotoolkit.")) { count++; } } } return count; } }