JAIExt { private JAIExt(ConcurrentOperationRegistry registry) { this.registry = registry; this.lock = new ReentrantReadWriteLock(); } private  JAIExt(ConcurrentOperationRegistry registry); synchronized static void initJAIEXT(); synchronized static void initJAIEXT(boolean useJaiExtOps); synchronized static void initJAIEXT(boolean useJaiExtOps, boolean forceReInit); static void registerAllOperations(boolean jaiextOperations); static void registerOperations(Set<String> operations, boolean jaiext); static void registerJAIEXTDescriptor(String descriptorName); static void registerJAIDescriptor(String descriptorName); static void setJAIAcceleration(String descriptorName, boolean accelerated); static List<OperationItem> getOperations(); static List<OperationItem> getJAIEXTOperations(); static List<OperationItem> getJAIOperations(); static ConcurrentOperationRegistry getRegistry(); static String getOperationName(String name); static String getJAIExtName(String name); static List<String> getJAINames(String name); static boolean isJAIExtOperation(String descriptorName); static boolean isJAIAPI(String descriptorName); static boolean isMedialibavailable(); static final String OPERATION_CONST_NAME; static final String ALGEBRIC_NAME; static final String STATS_NAME; }
@Test public void testJAIEXT() { ConcurrentOperationRegistry registry = JAIExt.getRegistry(); OperationCollection operations = registry.getOperationCollection(); OperationItem operationItem = operations.get(SCALE); assertTrue(operationItem != null); JAIExt.registerJAIEXTDescriptor(SCALE); operations = registry.getOperationCollection(); operationItem = operations.get(SCALE); assertTrue(operationItem.getDescriptor().getClass() .isAssignableFrom(DummyScaleDescriptor.class)); assertTrue(operationItem.getCurrentFactory().getClass() .isAssignableFrom(DummyScaleCRIF.class)); JAIExt.registerJAIDescriptor(SCALE); operations = registry.getOperationCollection(); operationItem = operations.get(SCALE); assertTrue(operationItem.getDescriptor().getClass().isAssignableFrom(ScaleDescriptor.class)); assertTrue(operationItem.getCurrentFactory().getClass().isAssignableFrom(ScaleCRIF.class)); JAIExt.registerJAIDescriptor(SCALE); if (JAIExt.isMedialibavailable()) { JAIExt.setJAIAcceleration(SCALE, true); operations = registry.getOperationCollection(); operationItem = operations.get(SCALE); assertTrue(operationItem.getCurrentFactory().getClass() .isAssignableFrom(MlibScaleRIF.class)); JAIExt.setJAIAcceleration(SCALE, false); operations = registry.getOperationCollection(); operationItem = operations.get(SCALE); assertTrue(operationItem.getCurrentFactory().getClass() .isAssignableFrom(ScaleCRIF.class)); } }