/** * All {@link Space}-related goals need to have a tenant configured. * @throws GoalConfigurationException if no tenant is specified */ protected void checkPreconditions() throws GoalConfigurationException { if(!this.getGoalContext().hasTenant()) throw new GoalConfigurationException("No tenant configured"); }
public final void run() { try { this.execute(); } catch (GoalConfigurationException e) { log.error("Error while configuring " + this + ": " + e.getMessage(), e); } catch (GoalExecutionException e) { log.error("Error while executing " + this + ": " + e.getMessage(), e); } }
/** * Cleans the cache of the {@link BackendConnector}. * CAN be overridden in subclasses to perform additional, goal-specific checks and preparations. */ protected void prepareExecution() throws GoalConfigurationException { BackendConnector.getInstance().cleanCache(); try { this.getConfiguration().checkSettings(); } catch (ConfigurationException e) { throw new GoalConfigurationException(e); } }
public ExecutionMonitor() { try { final Application app_ctx = CoreConfiguration.getAppContext(); final Configuration cfg = VulasConfiguration.getGlobal().getConfiguration(); // Always create and register shutdown uploader this.shutdownUploader = new UploadScheduler(this); Runtime.getRuntime().addShutdownHook(new Thread(this.shutdownUploader, "vulas-shutdown-trace-upload")); // Configure uploader: Create and start periodic uploader according to configuration if(cfg.getBoolean(CoreConfiguration.MONI_PERIODIC_UPL_ENABLED, true)) this.enablePeriodicUpload(cfg.getInt(CoreConfiguration.MONI_PERIODIC_UPL_INTERVAL, 300000), cfg.getInt(CoreConfiguration.MONI_PERIODIC_UPL_BATCH_SIZE, 1000)); // Goal execution this.exe = new TestGoal(); this.exe.setGoalClient(GoalClient.AGENT); this.startGoal(); } catch(ConfigurationException ce) { ExecutionMonitor.getLog().error(ce.getMessage()); } catch(GoalConfigurationException gce) { ExecutionMonitor.getLog().error(gce.getMessage()); } }
throw new GoalConfigurationException("Application context is required to execute goal [" + this.getGoalType().toString() + "]"); throw new GoalConfigurationException("Upload of goal execution failed, aborting the goal execution..."); throw new GoalConfigurationException(e.getMessage());
throw new GoalConfigurationException("No goals have been added to the sequence"); throw new GoalConfigurationException("Cannot add goal [" + g + "] to sequence: " + e.getMessage()); throw new GoalConfigurationException("Cannot add goal [" + g + "] to sequence: " + e.getMessage());
throw new GoalConfigurationException("Exactly one of the configuration settings [" + CoreConfiguration.APP_PREFIXES + "] and [" + CoreConfiguration.APP_JAR_NAMES + "] must be set"); throw new GoalConfigurationException("Exactly one of the configuration settings [" + CoreConfiguration.APP_PREFIXES + "] and [" + CoreConfiguration.APP_JAR_NAMES + "] must be set");
throw new GoalConfigurationException(e.getMessage()); throw new GoalConfigurationException(ioe.getMessage());