public void sendProgress(Integer progress) { jm.sendProgress(progress); }
@Override public void run() { int i = 0; while (true) { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } jm.sendProgress(i); i++; } } }
@Override public void run() { int i = 0; while (true) { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } jm.sendProgress(i); i++; } } }
public static void main(String[] args) { for (int i = 0; i <= 50; i++) { if (i == 5 || i == 10 || i == 35 || i == 50) { jm.sendProgress(i); System.out.println("Progress: " + i); } try { Thread.sleep(100); } catch (InterruptedException e) { // Nothing } } } }
@Override public void run() { MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); try { ObjectName name = new ObjectName("com.test:type=Node,name=test"); mbs.registerMBean(this, name); } catch (Exception e) { throw new RuntimeException(e); } int i = 0; while (true) { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } jm.sendProgress(i); i++; } }
jm.sendProgress(0); c = ds.getConnection(); c.setAutoCommit(false); jm.sendProgress(20); PreparedStatement s2 = c.prepareStatement(String.format( "DELETE FROM %sMESSAGE o WHERE o.JOB_INSTANCE IN (SELECT h.id FROM %sHISTORY h %s)", tablePrefix, tablePrefix, wh)); jm.sendProgress(5); PreparedStatement s1 = c.prepareStatement(String.format( "DELETE FROM %sDELIVERABLE o WHERE o.JOB_INSTANCE IN (SELECT h.id FROM %sHISTORY h %s)", tablePrefix, tablePrefix, wh)); jm.sendProgress(40); PreparedStatement s3 = c.prepareStatement( String.format("DELETE FROM %sJOB_INSTANCE_PARAMETER o WHERE o.JOB_INSTANCE IN (SELECT h.id FROM %sHISTORY h %s)", jm.sendProgress(60); PreparedStatement s4 = c.prepareStatement(String.format("DELETE FROM %sHISTORY h %s", tablePrefix, wh)); s4.setTimestamp(1, new Timestamp(((Calendar) limit).getTimeInMillis())); jm.sendProgress(95); c.commit(); jm.sendMsg("Purge was committed to database"); jm.sendProgress(100);
jm.sendProgress(10); jm.sendMsg("houba hop"); jm.sendProgress(33); Map<String, String> prms = new HashMap<String, String>(); prms.put("rr", "2nd run"); System.out.println("New request is number " + i); jm.sendProgress(66); prms.put("rrr", "3rd run"); System.out.println("creating a new sync job instance request"); jm.enqueueSync(jm.applicationName(), null, null, null, jm.application(), jm.module(), null, null, null, prms); System.out.println("New request is number " + i + " and should be done now"); jm.sendProgress(100);
jm.sendProgress(10); jm.sendMsg("houba hop"); jm.sendProgress(33); Map<String, String> prms = new HashMap<>(); prms.put("rr", "2nd run"); System.out.println("New request is number " + i); jm.sendProgress(66); prms.put("rrr", "3rd run"); System.out.println("creating a new sync job instance request"); jm.enqueueSync(jm.applicationName(), null, null, null, jm.application(), jm.module(), null, null, null, prms); System.out.println("New request is number " + i + " and should be done now"); jm.sendProgress(100);
jm.sendProgress(10); jm.sendMsg("houba hop"); jm.sendProgress(33); Map<String, String> prms = new HashMap<>(); prms.put("rr", "2nd run"); System.out.println("New request is number " + i); jm.sendProgress(66); prms.put("rrr", "3rd run"); System.out.println("creating a new sync job instance request"); jm.enqueueSync(jm.applicationName(), null, null, null, jm.application(), jm.module(), null, null, null, prms); System.out.println("New request is number " + i + " and should be done now"); jm.sendProgress(100);
jm.sendProgress(10); jm.sendMsg("houba hop"); jm.sendProgress(33); Map<String, String> prms = new HashMap<String, String>(); prms.put("rr", "2nd run"); System.out.println("New request is number " + i); jm.sendProgress(66); prms.put("rrr", "3rd run"); System.out.println("creating a new sync job instance request"); jm.enqueueSync(jm.applicationName(), null, null, null, jm.application(), jm.module(), null, null, null, prms); System.out.println("New request is number " + i + " and should be done now"); jm.sendProgress(100);
jm.sendProgress(10); jm.sendMsg("houba hop"); jm.sendProgress(33); Map<String, String> prms = new HashMap<>(); prms.put("rr", "2nd run"); System.out.println("New request is number " + i); jm.sendProgress(66); prms.put("rrr", "3rd run"); System.out.println("creating a new sync job instance request"); jm.sendProgress(100);
this.api.sendProgress((Integer) args[0]); return null;