@Test(expected = NoApplicableCodeException.class) public void testSubmit() throws OwsException { SensorPlugin nonBlockInstance = NonBlockingTaskingDecorator.enableNonBlockingTasking(instance); nonBlockInstance.submit(null, null); }
@Override public SensorTask submit(final SubmitTaskingRequest submit, final OwsExceptionReport owsExceptionReport) throws OwsException { try { FutureTask<SensorTask> createSensorTask = new FutureTask<SensorTask>(new Callable<SensorTask>() { public SensorTask call() throws Exception { return sensorPlugin.submit(submit, owsExceptionReport); } }); taskingExecutor.execute(createSensorTask); return createSensorTask.get(NON_BLOCK_TIMEOUT, TimeUnit.MILLISECONDS); } catch (ExecutionException e) { LOGGER.warn("No SensorTask could be created for submit request {}", submit, e); NoApplicableCodeException ex = new NoApplicableCodeException(OwsException.INTERNAL_SERVER_ERROR); ex.addExceptionText("Sensor plugin did not succeed creating a sensor task for submit request."); ex.addExceptionText(e.getMessage()); throw ex; } catch (InterruptedException e) { LOGGER.error("No SensorTask could be created for submit request {}", submit, e); NoApplicableCodeException ex = new NoApplicableCodeException(OwsException.INTERNAL_SERVER_ERROR); ex.addExceptionText("Sensor plugin was interrupted while creating a sensor task for submit request."); ex.addExceptionText(e.getMessage()); throw ex; } catch (TimeoutException e) { LOGGER.error("Unacceptable delay creating sensor task (> {} ms)", NON_BLOCK_TIMEOUT, e); NoApplicableCodeException ex = new NoApplicableCodeException(OwsException.INTERNAL_SERVER_ERROR); ex.addExceptionText("Sensor plugin got stuck in creating sensor task."); throw ex; } }
NonBlockingTaskingDecorator extends SensorPlugin { @Override public SensorTask submit(final SubmitTaskingRequest submit, final OwsExceptionReport owsExceptionReport) throws OwsException { try { FutureTask<SensorTask> createSensorTask = new FutureTask<SensorTask>(new Callable<SensorTask>() { public SensorTask call() throws Exception { return sensorPlugin.submit(submit, owsExceptionReport); } }); taskingExecutor.execute(createSensorTask); return createSensorTask.get(NON_BLOCK_TIMEOUT, TimeUnit.MILLISECONDS); } catch (ExecutionException e) { LOGGER.warn("No SensorTask could be created for submit request {}", submit, e); NoApplicableCodeException ex = new NoApplicableCodeException(OwsException.INTERNAL_SERVER_ERROR); ex.addExceptionText("Sensor plugin did not succeed creating a sensor task for submit request."); ex.addExceptionText(e.getMessage()); throw ex; } catch (InterruptedException e) { LOGGER.error("No SensorTask could be created for submit request {}", submit, e); NoApplicableCodeException ex = new NoApplicableCodeException(OwsException.INTERNAL_SERVER_ERROR); ex.addExceptionText("Sensor plugin was interrupted while creating a sensor task for submit request."); ex.addExceptionText(e.getMessage()); throw ex; } catch (TimeoutException e) { LOGGER.error("Unacceptable delay creating sensor task (> {} ms)", NON_BLOCK_TIMEOUT, e); NoApplicableCodeException ex = new NoApplicableCodeException(OwsException.INTERNAL_SERVER_ERROR); ex.addExceptionText("Sensor plugin got stuck in creating sensor task."); throw ex; } } }
NonBlockingTaskingDecorator extends SensorPlugin { @Override public SensorTask submit(final SubmitTaskingRequest submit, final OwsExceptionReport owsExceptionReport) throws OwsException { try { FutureTask<SensorTask> createSensorTask = new FutureTask<SensorTask>(new Callable<SensorTask>() { public SensorTask call() throws Exception { return sensorPlugin.submit(submit, owsExceptionReport); } }); taskingExecutor.execute(createSensorTask); return createSensorTask.get(NON_BLOCK_TIMEOUT, TimeUnit.MILLISECONDS); } catch (ExecutionException e) { LOGGER.warn("No SensorTask could be created for submit request {}", submit, e); NoApplicableCodeException ex = new NoApplicableCodeException(OwsException.INTERNAL_SERVER_ERROR); ex.addExceptionText("Sensor plugin did not succeed creating a sensor task for submit request."); ex.addExceptionText(e.getMessage()); throw ex; } catch (InterruptedException e) { LOGGER.error("No SensorTask could be created for submit request {}", submit, e); NoApplicableCodeException ex = new NoApplicableCodeException(OwsException.INTERNAL_SERVER_ERROR); ex.addExceptionText("Sensor plugin was interrupted while creating a sensor task for submit request."); ex.addExceptionText(e.getMessage()); throw ex; } catch (TimeoutException e) { LOGGER.error("Unacceptable delay creating sensor task (> {} ms)", NON_BLOCK_TIMEOUT, e); NoApplicableCodeException ex = new NoApplicableCodeException(OwsException.INTERNAL_SERVER_ERROR); ex.addExceptionText("Sensor plugin got stuck in creating sensor task."); throw ex; } } private  NonBlockingTaskingDecorator(SensorPlugin sensorPlugin); }
NonBlockingTaskingDecorator extends SensorPlugin { @Override public SensorTask submit(final SubmitTaskingRequest submit, final OwsExceptionReport owsExceptionReport) throws OwsException { try { FutureTask<SensorTask> createSensorTask = new FutureTask<SensorTask>(new Callable<SensorTask>() { public SensorTask call() throws Exception { return sensorPlugin.submit(submit, owsExceptionReport); } }); taskingExecutor.execute(createSensorTask); return createSensorTask.get(NON_BLOCK_TIMEOUT, TimeUnit.MILLISECONDS); } catch (ExecutionException e) { LOGGER.warn("No SensorTask could be created for submit request {}", submit, e); NoApplicableCodeException ex = new NoApplicableCodeException(OwsException.INTERNAL_SERVER_ERROR); ex.addExceptionText("Sensor plugin did not succeed creating a sensor task for submit request."); ex.addExceptionText(e.getMessage()); throw ex; } catch (InterruptedException e) { LOGGER.error("No SensorTask could be created for submit request {}", submit, e); NoApplicableCodeException ex = new NoApplicableCodeException(OwsException.INTERNAL_SERVER_ERROR); ex.addExceptionText("Sensor plugin was interrupted while creating a sensor task for submit request."); ex.addExceptionText(e.getMessage()); throw ex; } catch (TimeoutException e) { LOGGER.error("Unacceptable delay creating sensor task (> {} ms)", NON_BLOCK_TIMEOUT, e); NoApplicableCodeException ex = new NoApplicableCodeException(OwsException.INTERNAL_SERVER_ERROR); ex.addExceptionText("Sensor plugin got stuck in creating sensor task."); throw ex; } } private  NonBlockingTaskingDecorator(SensorPlugin sensorPlugin); static SensorPlugin enableNonBlockingTasking(SensorPlugin sensorPlugin); SensorTaskService getSensorTaskService(); void setSensorTaskService(SensorTaskService sensorTaskService); String getSensorPluginType(); SensorConfiguration getSensorConfiguration(); ResultAccessDataServiceReference getResultAccessDataServiceReference(); SensorConfiguration mergeSensorConfigurations(SensorConfiguration sensorConfiguration); String toString(); Availability getResultAccessibility(); boolean isDataAvailable(); @Override SensorTask submit(final SubmitTaskingRequest submit, final OwsExceptionReport owsExceptionReport); @Override void qualifyDataComponent(AbstractDataComponentType componentToQualify); @Override Availability getResultAccessibilityFor(SensorTask sensorTask); }
NonBlockingTaskingDecorator extends SensorPlugin { @Override public SensorTask submit(final SubmitTaskingRequest submit, final OwsExceptionReport owsExceptionReport) throws OwsException { try { FutureTask<SensorTask> createSensorTask = new FutureTask<SensorTask>(new Callable<SensorTask>() { public SensorTask call() throws Exception { return sensorPlugin.submit(submit, owsExceptionReport); } }); taskingExecutor.execute(createSensorTask); return createSensorTask.get(NON_BLOCK_TIMEOUT, TimeUnit.MILLISECONDS); } catch (ExecutionException e) { LOGGER.warn("No SensorTask could be created for submit request {}", submit, e); NoApplicableCodeException ex = new NoApplicableCodeException(OwsException.INTERNAL_SERVER_ERROR); ex.addExceptionText("Sensor plugin did not succeed creating a sensor task for submit request."); ex.addExceptionText(e.getMessage()); throw ex; } catch (InterruptedException e) { LOGGER.error("No SensorTask could be created for submit request {}", submit, e); NoApplicableCodeException ex = new NoApplicableCodeException(OwsException.INTERNAL_SERVER_ERROR); ex.addExceptionText("Sensor plugin was interrupted while creating a sensor task for submit request."); ex.addExceptionText(e.getMessage()); throw ex; } catch (TimeoutException e) { LOGGER.error("Unacceptable delay creating sensor task (> {} ms)", NON_BLOCK_TIMEOUT, e); NoApplicableCodeException ex = new NoApplicableCodeException(OwsException.INTERNAL_SERVER_ERROR); ex.addExceptionText("Sensor plugin got stuck in creating sensor task."); throw ex; } } private  NonBlockingTaskingDecorator(SensorPlugin sensorPlugin); static SensorPlugin enableNonBlockingTasking(SensorPlugin sensorPlugin); SensorTaskService getSensorTaskService(); void setSensorTaskService(SensorTaskService sensorTaskService); String getSensorPluginType(); SensorConfiguration getSensorConfiguration(); ResultAccessDataServiceReference getResultAccessDataServiceReference(); SensorConfiguration mergeSensorConfigurations(SensorConfiguration sensorConfiguration); String toString(); Availability getResultAccessibility(); boolean isDataAvailable(); @Override SensorTask submit(final SubmitTaskingRequest submit, final OwsExceptionReport owsExceptionReport); @Override void qualifyDataComponent(AbstractDataComponentType componentToQualify); @Override Availability getResultAccessibilityFor(SensorTask sensorTask);  }