@Override public <R, T> R callMethod(String methodName, T argument, long timeout) throws CouldNotPerformException, TimeoutException, InterruptedException { throw new NotSupportedException("callMethod[applyAction]", this); }
/** * {@inheritDoc} * * @param pointingRay3DFloatCollection {@inheritDoc} * @return {@inheritDoc} * @throws CouldNotPerformException {@inheritDoc} */ @Override public Future<UnitProbabilityCollection> computeUnitIntersection(PointingRay3DFloatCollection pointingRay3DFloatCollection) throws CouldNotPerformException { //TODO jdaberkow throw new NotSupportedException("Method[computeUnitIntersection]", this); } }
@Override public <R> R callMethod(String methodName) throws CouldNotPerformException, InterruptedException { throw new NotSupportedException("Method[callMethod]", this); }
/** * {@inheritDoc} * * @param pointingRay3DFloat {@inheritDoc} * @return {@inheritDoc} * @throws CouldNotPerformException {@inheritDoc} */ @Override public Future<UnitProbabilityCollection> computeUnitIntersection(PointingRay3DFloat pointingRay3DFloat) throws CouldNotPerformException { //TODO jdaberkow throw new NotSupportedException("Method[computeUnitIntersection]", this); }
public static String getServicePrefix(final ServicePattern pattern) throws CouldNotPerformException { switch (pattern) { case CONSUMER: return ""; case OPERATION: return "set"; case PROVIDER: return "get"; default: throw new NotSupportedException(pattern, Services.class); } }
@Override public Future<ActionFuture> applyAction(ActionDescription actionDescription) throws CouldNotPerformException, InterruptedException, RejectedException { throw new NotSupportedException("Method[applyAction]", this); }
@Override public <R, T> R callMethod(String methodName, T argument) throws CouldNotPerformException, InterruptedException { throw new NotSupportedException("Method[callMethod]", this); }
@Override public <R> R callMethod(String methodName, long timeout) throws CouldNotPerformException, TimeoutException, InterruptedException { throw new NotSupportedException("callMethod[applyAction]", this); }
@Override public <R, T> Future<R> callMethodAsync(String methodName, T argument) throws CouldNotPerformException { throw new NotSupportedException("Method[callMethodAsync]", this); }
@Override public <R> Future<R> callMethodAsync(String methodName) throws CouldNotPerformException { throw new NotSupportedException("Method[callMethodAsync]", this); }
@Override public String generateId(AppConfig message) throws CouldNotPerformException { throw new NotSupportedException("generateId", this); // try { // // if (!message.hasLabel()) { // throw new InvalidStateException("Field [Label] is missing!"); // } // // String id; // // id = message.getLabel(); // return StringProcessor.transformToIdString(id); // // } catch (CouldNotPerformException ex) { // throw new CouldNotPerformException("Could not generate id!", ex); // } }
@Override public ServiceFactory getServiceFactory() throws NotAvailableException { if (serviceFactory == null) { throw new NotAvailableException("ServiceFactory", new NotSupportedException("Unit hosting", this)); } return serviceFactory; }
@Override public <UNIT extends StandbyStateOperationService & Unit> StandbyStateOperationService newStandbyService(final UNIT unit) throws InstantiationException { throw new InstantiationException(this, new NotSupportedException(StandbyStateOperationService.class, this)); }
public AbstractServiceRemote getServiceRemote(final ServiceType serviceType) throws NotAvailableException { synchronized (serviceRemoteMapLock) { AbstractServiceRemote serviceRemote = serviceRemoteMap.get(serviceType); if (serviceRemote == null) { final String responsible = (responsibleInstance != null ? responsibleInstance.toString() : "the underlying instance"); throw new NotAvailableException("ServiceRemote", serviceType.name(), new NotSupportedException("ServiceType[" + serviceType + "]", responsible)); } return serviceRemote; } }
private boolean detectAutostart() { try { return isAutostartEnabled(); } catch (CouldNotPerformException ex) { ExceptionPrinter.printHistory(new NotSupportedException("autostart", (AbstractExecutableBaseUnitController) this, (Throwable) ex), logger, LogLevel.WARN); return true; } }
private boolean detectAutostart() { try { return isAutostartEnabled(); } catch (CouldNotPerformException ex) { ExceptionPrinter.printHistory(new NotSupportedException("autostart", (AbstractExecutableController) this, (Throwable) ex), logger, LogLevel.WARN); return true; } }
public static Boolean hasServiceState(final ServiceType serviceType, final ServiceTempus serviceTempus, final MessageOrBuilder instance, final Object... arguments) throws CouldNotPerformException, NotSupportedException, IllegalArgumentException { try { return (Boolean) detectServiceMethod(serviceType, "has", serviceTempus, instance.getClass(), getArgumentClasses(arguments)).invoke(instance, arguments); } catch (IllegalAccessException | ExceptionInInitializerError ex) { throw new NotSupportedException("ServiceType[" + serviceType.name() + "] not provided by Message[" + instance.getClass().getSimpleName() + "]!", instance, ex); } catch (NullPointerException ex) { throw new CouldNotPerformException("Invocation failed because given instance is not available!", ex); } catch (InvocationTargetException ex) { if (ex.getTargetException() instanceof CouldNotPerformException) { throw (CouldNotPerformException) ex.getTargetException(); } else { throw new CouldNotPerformException("Invocation failed!", ex.getTargetException()); } } }
public static Object invokeServiceMethod(final ServiceType serviceType, final ServicePattern servicePattern, final ServiceTempus serviceTempus, final Object instance, final Object... arguments) throws CouldNotPerformException, NotSupportedException, IllegalArgumentException { try { return detectServiceMethod(serviceType, servicePattern, serviceTempus, instance.getClass(), getArgumentClasses(arguments)).invoke(instance, arguments); } catch (IllegalAccessException | ExceptionInInitializerError ex) { throw new NotSupportedException("ServiceType[" + serviceType.name() + "] with Pattern[" + servicePattern + "]", instance, ex); } catch (NullPointerException ex) { throw new CouldNotPerformException("Invocation failed because given instance is not available!", ex); } catch (InvocationTargetException ex) { if (ex.getTargetException() instanceof CouldNotPerformException) { throw (CouldNotPerformException) ex.getTargetException(); } else { throw new CouldNotPerformException("Invocation failed!", ex.getTargetException()); } } }
public static Object invokeServiceMethod(final ServiceDescription description, final ServiceTempus serviceTempus, final Service instance, final Object... arguments) throws CouldNotPerformException { try { return detectServiceMethod(description, serviceTempus, instance.getClass(), getArgumentClasses(arguments)).invoke(instance, arguments); } catch (IllegalAccessException | ExceptionInInitializerError ex) { throw new NotSupportedException("ServiceType[" + description.getType().name() + "] with Pattern[" + description.getPattern() + "]", instance, ex); } catch (NullPointerException ex) { throw new CouldNotPerformException("Invocation failed because given instance is not available!", ex); } catch (InvocationTargetException ex) { if (ex.getTargetException() instanceof CouldNotPerformException) { throw (CouldNotPerformException) ex.getTargetException(); } else { throw new CouldNotPerformException("Invocation failed!", ex.getTargetException()); } } }
@Override public void internalNotify(Event event) { try { internalReceiveUpdate((OpenhabCommand) event.getData()); } catch (ClassCastException ex) { ExceptionPrinter.printHistory(new NotSupportedException(event.getData().getClass().getSimpleName(), this), logger, LogLevel.DEBUG); } catch (CouldNotPerformException ex) { ExceptionPrinter.printHistory(new CouldNotPerformException("Could not handle openhab update!", ex), logger); } } }, true);