当前位置: 首页>>代码示例>>Java>>正文


Java IIOServiceProvider类代码示例

本文整理汇总了Java中javax.imageio.spi.IIOServiceProvider的典型用法代码示例。如果您正苦于以下问题:Java IIOServiceProvider类的具体用法?Java IIOServiceProvider怎么用?Java IIOServiceProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IIOServiceProvider类属于javax.imageio.spi包,在下文中一共展示了IIOServiceProvider类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSpi

import javax.imageio.spi.IIOServiceProvider; //导入依赖的package包/类
private void testSpi(IIOServiceProvider spi) {
    if (spi.getVendorName() == null) {
        error(spi + " getVendorName == null!");
    }
    if (spi.getVersion() == null) {
        error(spi + " getVersion == null!");
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:SpiTest.java

示例2: check

import javax.imageio.spi.IIOServiceProvider; //导入依赖的package包/类
private static void check(IIOServiceProvider spi) {
    String version = spi.getVersion();
    if (!version.equals("1.0")) {
        throw new RuntimeException("Provider " +
                                   spi.getClass().getName() +
                                   " has version " + version + "!");
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:SpiVersionNumbers.java

示例3: clearImageIORegistry

import javax.imageio.spi.IIOServiceProvider; //导入依赖的package包/类
protected void clearImageIORegistry() {
    IIORegistry registry = IIORegistry.getDefaultInstance();
    Iterator<Class<?>> categories = registry.getCategories();
    final ClassLoader webClassLoader = getWebApplicationClassLoader();
    ServiceRegistry.Filter classLoaderFilter = provider -> {
        //remove all service provider loaded by the current ClassLoader
        return webClassLoader.equals(provider.getClass().getClassLoader());
    };
    while (categories.hasNext()) {
        @SuppressWarnings("unchecked")
        Class<IIOServiceProvider> category = (Class<IIOServiceProvider>) categories.next();
        Iterator<IIOServiceProvider> serviceProviders = registry.getServiceProviders(category,
            classLoaderFilter, true);
        if (serviceProviders.hasNext()) {
            info("removing service provider of category: " + category.getSimpleName());
            //copy to list
            LinkedList<IIOServiceProvider> serviceProviderList = new LinkedList<>();
            while (serviceProviders.hasNext()) {
                serviceProviderList.add(serviceProviders.next());
            }
            for (IIOServiceProvider serviceProvider : serviceProviderList) {
                info(" - removing: " + serviceProvider.getDescription(Locale.ROOT));
                registry.deregisterServiceProvider(serviceProvider);
            }
        }
    }
}
 
开发者ID:MyCoRe-Org,项目名称:mycore,代码行数:28,代码来源:MCRClassLoaderLeakPreventor.java


注:本文中的javax.imageio.spi.IIOServiceProvider类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。