/** * Method returns the transformation leading from the root location to the given unit. * * @param unitConfig the unit where the transformation leads to. * @return a transformation future */ public static Future<Transform> getRootToUnitTransformationFuture(final UnitConfig unitConfig) { final Future<LocationRegistryDataType.LocationRegistryData> dataFuture; try { try { dataFuture = Registries.getLocationRegistry().getDataFuture(); return GlobalCachedExecutorService.allOfInclusiveResultFuture(Registries.getLocationRegistry().getRootToUnitTransformationFuture(unitConfig), dataFuture); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); throw new FatalImplementationErrorException("getLocationRegistry should not throw InterruptedExceptions anymore!", Units.class, ex); } } catch (CouldNotPerformException ex) { return FutureProcessor.canceledFuture(Transform.class, new NotAvailableException("UnitTransformation", ex)); } }
/** * Method returns the transformation leading from the given unit to the root location. * * @param unitConfig the unit where the transformation leads to. * @return a transformation future */ public static Future<Transform> getUnitToRootTransformationFuture(final UnitConfig unitConfig) { final Future<LocationRegistryDataType.LocationRegistryData> dataFuture; try { try { dataFuture = Registries.getLocationRegistry().getDataFuture(); return GlobalCachedExecutorService.allOfInclusiveResultFuture(Registries.getLocationRegistry().getUnitToRootTransformationFuture(unitConfig), dataFuture); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); throw new FatalImplementationErrorException("getLocationRegistry should not throw InterruptedExceptions anymore!", Units.class, ex); } } catch (CouldNotPerformException ex) { return FutureProcessor.canceledFuture(Transform.class, new NotAvailableException("UnitTransformation", ex)); } }
/** * Method returns the transformation between the given unit A and the given * unit B. * * @param unitConfigA the unit used as transformation base. * @param unitConfigB the unit where the transformation leads to. * @return a transformation future * @throws InterruptedException is thrown if the thread was externally interrupted. * @deprecated please use {@code getUnitTransformationFuture()} instead. */ @Deprecated public static Future<Transform> getUnitTransformation(final UnitConfig unitConfigA, final UnitConfig unitConfigB) throws InterruptedException { final Future<LocationRegistryDataType.LocationRegistryData> dataFuture; try { dataFuture = Registries.getLocationRegistry().getDataFuture(); return GlobalCachedExecutorService.allOfInclusiveResultFuture(Registries.getLocationRegistry().getUnitTransformationFuture(unitConfigA, unitConfigB), dataFuture); } catch (CouldNotPerformException ex) { return FutureProcessor.canceledFuture(Transform.class, new NotAvailableException("UnitTransformation", ex)); } }
/** * Method returns the transformation between the given unit A and the given * unit B. * * @param unitConfigA the unit used as transformation base. * @param unitConfigB the unit where the transformation leads to. * @return a transformation future */ public static Future<Transform> getUnitTransformationFuture(final UnitConfig unitConfigA, final UnitConfig unitConfigB) { final Future<LocationRegistryDataType.LocationRegistryData> dataFuture; try { try { dataFuture = Registries.getLocationRegistry().getDataFuture(); return GlobalCachedExecutorService.allOfInclusiveResultFuture(Registries.getLocationRegistry().getUnitTransformationFuture(unitConfigA, unitConfigB), dataFuture); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); throw new FatalImplementationErrorException("getLocationRegistry should not throw InterruptedExceptions anymore!", Units.class, ex); } } catch (CouldNotPerformException ex) { return FutureProcessor.canceledFuture(Transform.class, new NotAvailableException("UnitTransformation", ex)); } } }