public Integer getJobInstanceId() { return jm.jobInstanceID(); } }
@Override public void run() { System.out.println("Spring job 1"); if (parameters == null || parameters.size() == 0) { throw new RuntimeException("parameters were not set"); } if (s1 == null) { throw new RuntimeException("services were not set"); } if (!s1.getBeanName().equals("com.enioka.jqm.spring.service.Service1")) { throw new RuntimeException("wrong service bean name - custom bean name generator not in used. Name found: " + s1.getBeanName()); } s1.getInt(); if (jm == null) { throw new RuntimeException("JobManager was not set"); } System.out.println("Job instance ID is " + jm.getObject().jobInstanceID()); } }
@Override public void run() { System.out.println("Spring job 2"); if (parameters == null || parameters.size() == 0) { throw new RuntimeException("parameters were not set"); } if (s1 == null) { throw new RuntimeException("services were not set"); } s1.getInt(); if (jmp == null) { throw new RuntimeException("JobManager was not set"); } JobManager jm = jmp.getObject(); System.out.println("Job instance ID is " + jm.jobInstanceID()); int instanceId = jm.jobInstanceID(); jm.enqueueSync("Job1", jm.userName(), null, null, null, jm.module(), null, null, null, jm.parameters()); if (instanceId != jmp.getObject().jobInstanceID()) { throw new RuntimeException("The job manager was not really thread local"); } } }
System.out.println("Session ID: " + jm.sessionID()); System.out.println("Restart enabled: " + jm.canBeRestarted()); System.out.println("JI ID: " + jm.jobInstanceID()); System.out.println("Parent JI ID: " + jm.parentID()); System.out.println("Nb of parameters: " + jm.parameters().size());
System.out.println("Session ID: " + jm.sessionID()); System.out.println("Restart enabled: " + jm.canBeRestarted()); System.out.println("JI ID: " + jm.jobInstanceID()); System.out.println("Parent JI ID: " + jm.parentID()); System.out.println("Nb of parameters: " + jm.parameters().size());
System.out.println("Session ID: " + jm.sessionID()); System.out.println("Restart enabled: " + jm.canBeRestarted()); System.out.println("JI ID: " + jm.jobInstanceID()); System.out.println("Parent JI ID: " + jm.parentID()); System.out.println("Nb of parameters: " + jm.parameters().size());
System.out.println("Session ID: " + jm.sessionID()); System.out.println("Restart enabled: " + jm.canBeRestarted()); System.out.println("JI ID: " + jm.jobInstanceID()); System.out.println("Parent JI ID: " + jm.parentID()); System.out.println("Nb of parameters: " + jm.parameters().size());
System.out.println("Session ID: " + jm.sessionID()); System.out.println("Restart enabled: " + jm.canBeRestarted()); System.out.println("JI ID: " + jm.jobInstanceID()); System.out.println("Parent JI ID: " + jm.parentID()); System.out.println("Nb of parameters: " + jm.parameters().size());
return this.api.jobInstanceID();