@Override public void run(Class<? extends Object> toRun, Map<String, String> metaParameters, Map<String, String> jobParameters, Object handlerProxy) { @SuppressWarnings("unchecked") Class<Runnable> c = (Class<Runnable>) toRun; Runnable o = null; try { o = c.newInstance(); } catch (Exception e) { throw new JobRunnerException("Could not instanciate runnable payload. Does it have a nullary constructor?", e); } // Injection stuff (if needed) Common.inject(o.getClass(), o, handlerProxy, false); // Go o.run(); }
@Override public void run(Class<? extends Object> toRun, Map<String, String> metaParameters, Map<String, String> jobParameters, Object handlerProxy) { @SuppressWarnings("unchecked") Class<Runnable> c = (Class<Runnable>) toRun; Runnable o = null; try { o = c.newInstance(); } catch (Exception e) { throw new JobRunnerException("Could not instanciate runnable payload. Does it have a nullary constructor?", e); } // Injection stuff (if needed) Common.inject(o.getClass(), o, handlerProxy, false); // Go o.run(); }
throw new JobRunnerException( "Cannot create an instance of class " + toRun.getCanonicalName() + ". Does it have an argumentless constructor?", e); throw new JobRunnerException("Payload has failed", e); throw new JobRunnerException("Payload " + toRun.getCanonicalName() + " is incorrect - missing fields and methods.", e); throw new JobRunnerException("Payload launch failed for " + toRun.getCanonicalName() + ".", e);
throw new JobRunnerException( "Cannot create an instance of class " + toRun.getCanonicalName() + ". Does it have an argumentless constructor?", e); throw new JobRunnerException("Payload has failed", e); throw new JobRunnerException("Payload " + toRun.getCanonicalName() + " is incorrect - missing fields and methods.", e); throw new JobRunnerException("Payload launch failed for " + toRun.getCanonicalName() + ".", e);
JavaJobInstanceTracker(JobInstance job, JobRunnerCallback cb, ClassloaderManager clm, JobManager engineApi) { this.engineCallback = cb; this.clm = clm; this.job = job; this.engineApi = engineApi; // JMX if (cb != null && cb.isJmxEnabled()) { MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); try { name = new ObjectName(cb.getJmxBeanName()); mbs.registerMBean(this, name); } catch (Exception e) { throw new JobRunnerException("Could not create JMX bean for running job instance", e); } } }
throw new JobRunnerException("Could not load JQM internal interface", e); throw new JobRunnerException("Could not inject JQM interface into target payload", e);
throw new JobRunnerException("Could not load JQM internal interface", e); throw new JobRunnerException("Could not inject JQM interface into target payload", e);
throw new JobRunnerException("Payload has failed", e); throw new JobRunnerException("Payload launch failed for " + toRun.getCanonicalName() + ".", e);
throw new JobRunnerException("Payload has failed", e); throw new JobRunnerException("Payload launch failed for " + toRun.getCanonicalName() + ".", e);
@Override public void initialize(DbConn cnx) { // API user login = this.cb.getWebApiUser(cnx).getKey(); pwd = this.cb.getWebApiUser(cnx).getValue(); url = this.cb.getWebApiLocalUrl(cnx); // JMX if (cb != null && cb.isJmxEnabled()) { MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); try { name = new ObjectName(cb.getJmxBeanName()); mbs.registerMBean(this, name); } catch (Exception e) { throw new JobRunnerException("Could not create JMX bean for running job instance", e); } } // Temp work directory tmpDir = this.engineApi.getWorkDir(); // Delivery deliveryDir = new File(tmpDir.getAbsolutePath() + "_delivery"); if (!deliveryDir.mkdirs()) { throw new JobRunnerException("Could not create delivery directory"); } }
@Override public void initialize(DbConn cnx) { // API user login = this.cb.getWebApiUser(cnx).getKey(); pwd = this.cb.getWebApiUser(cnx).getValue(); url = this.cb.getWebApiLocalUrl(cnx); // JMX if (cb != null && cb.isJmxEnabled()) { MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); try { name = new ObjectName(cb.getJmxBeanName()); mbs.registerMBean(this, name); } catch (Exception e) { throw new JobRunnerException("Could not create JMX bean for running job instance", e); } } // Temp work directory tmpDir = this.engineApi.getWorkDir(); // Delivery deliveryDir = new File(tmpDir.getAbsolutePath() + "_delivery"); if (!deliveryDir.mkdirs()) { throw new JobRunnerException("Could not create delivery directory"); } }
static List<String> getProcessArguments(String commandLine, Map<String, String> prms, PathType pathType) { switch (pathType) { case DEFAULTSHELLCOMMAND: return getDefaultShell(commandLine, prms); case POWERSHELLCOMMAND: return getPowerShell(commandLine, prms); case DIRECTEXECUTABLE: return getSimpleProcess(commandLine, prms); default: throw new JobRunnerException("Unsupported path type " + pathType); } } }
static List<String> getProcessArguments(String commandLine, Map<String, String> prms, PathType pathType) { switch (pathType) { case DEFAULTSHELLCOMMAND: return getDefaultShell(commandLine, prms); case POWERSHELLCOMMAND: return getPowerShell(commandLine, prms); case DIRECTEXECUTABLE: return getSimpleProcess(commandLine, prms); default: throw new JobRunnerException("Unsupported path type " + pathType); } } }
@Override public void initialize(DbConn cnx) { mainThread = Thread.currentThread(); // Set CL cache inside JD this.job.getJD().getClassLoader(cnx); // Create a proxy able to cross CL boundaries for the Engine API. handler = new EngineApiProxy(engineApi); // Class loader creation (or retrieval from cache) try { this.jobClassLoader = this.clm.getClassloader(this.job, this.engineCallback); } catch (Exception e) { throw new JobRunnerException(e); } }
throw new JobRunnerException("could not create proxy API object", e); throw new JobRunnerException("could not load class " + classQualifiedName, e); throw new JobRunnerException( "could not load a runner: check your global parameters, or that the plugin for this runner is actually present " + runnerClassName, throw new JobRunnerException( "could not create an instance of a runner: it may not have a no-args constructor. " + runnerClassName, e); throw new JobRunnerException("invocation of canRun failed on the runner plugin " + runnerClassName, e); throw new JobRunnerException("could not find run method for runner plugin " + runnerClassName, e); throw new JobRunnerException("event handler could not be loaded or run: " + handlerClass, e); throw new JobRunnerException("Payload has failed", e); throw new JobRunnerException("Could not launch a job instance (engine issue, not a payload issue", e); throw new JobRunnerException( "This type of class cannot be launched by JQM. Please consult the documentation for more details. Available runners: " + allowedRunners);