use of org.activiti.engine.ProcessEngineConfiguration in project Activiti by Activiti.
the class JobEntityManager method findNextTimerJobsToExecute.
@SuppressWarnings("unchecked")
public List<JobEntity> findNextTimerJobsToExecute(Page page) {
ProcessEngineConfiguration processEngineConfig = Context.getProcessEngineConfiguration();
Date now = processEngineConfig.getClock().getCurrentTime();
return getDbSqlSession().selectList("selectNextTimerJobsToExecute", now, page);
}
use of org.activiti.engine.ProcessEngineConfiguration in project Activiti by Activiti.
the class JobEntityManager method findAsyncJobsDueToExecute.
@SuppressWarnings("unchecked")
public List<JobEntity> findAsyncJobsDueToExecute(Page page) {
ProcessEngineConfiguration processEngineConfig = Context.getProcessEngineConfiguration();
Date now = processEngineConfig.getClock().getCurrentTime();
return getDbSqlSession().selectList("selectAsyncJobsDueToExecute", now, page);
}
use of org.activiti.engine.ProcessEngineConfiguration in project Activiti by Activiti.
the class JobEntityManager method findNextJobsToExecute.
@SuppressWarnings("unchecked")
public List<JobEntity> findNextJobsToExecute(Page page) {
ProcessEngineConfiguration processEngineConfig = Context.getProcessEngineConfiguration();
Date now = processEngineConfig.getClock().getCurrentTime();
return getDbSqlSession().selectList("selectNextJobsToExecute", now, page);
}
use of org.activiti.engine.ProcessEngineConfiguration in project Activiti by Activiti.
the class JobExecutorJMXClientTest method testJobExecutorJMXClient.
@Test
public void testJobExecutorJMXClient() throws InterruptedException, IOException, MalformedObjectNameException, AttributeNotFoundException, InstanceNotFoundException, MBeanException, ReflectionException {
String hostName = Utils.getHostName();
JMXServiceURL url = new JMXServiceURL("service:jmx:rmi://" + hostName + ":10111/jndi/rmi://" + hostName + ":1099/jmxrmi/activiti");
ProcessEngineConfiguration processEngineConfig = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("activiti.cfg.xml");
processEngineConfig.buildProcessEngine();
// wait for jmx server to come up
Thread.sleep(500);
JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();
ObjectName jobExecutorBeanName = new ObjectName("org.activiti.jmx.Mbeans:type=JobExecutor");
processEngineConfig.getJobExecutor().shutdown();
// first check that job executor is not activated and correctly reported as being inactive
assertFalse(processEngineConfig.isJobExecutorActivate());
assertFalse((Boolean) mbsc.getAttribute(jobExecutorBeanName, "JobExecutorActivated"));
// now activate it remotely
mbsc.invoke(jobExecutorBeanName, "setJobExecutorActivate", new Boolean[] { true }, new String[] { Boolean.class.getName() });
// check if it has the effect and correctly reported
// assertTrue(processEngineConfig.getJobExecutor().isActive());
assertTrue((Boolean) mbsc.getAttribute(jobExecutorBeanName, "JobExecutorActivated"));
//agani disable and check it
mbsc.invoke(jobExecutorBeanName, "setJobExecutorActivate", new Boolean[] { false }, new String[] { Boolean.class.getName() });
// check if it has the effect and correctly reported
assertFalse(processEngineConfig.isJobExecutorActivate());
assertFalse((Boolean) mbsc.getAttribute(jobExecutorBeanName, "JobExecutorActivated"));
}
use of org.activiti.engine.ProcessEngineConfiguration in project Activiti by Activiti.
the class Main method createJobCreatorProcessEngine.
private static void createJobCreatorProcessEngine(boolean replaceExisting, boolean isDropDatabaseSchema) {
if (processEngine == null || replaceExisting) {
System.out.println("Creating process engine with config activiti_job_creator.cfg.xml. Dropping db first = " + isDropDatabaseSchema);
ProcessEngineConfiguration processEngineConfiguration = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("activiti_job_creator.cfg.xml");
if (isDropDatabaseSchema) {
processEngineConfiguration.setDatabaseSchemaUpdate("drop-create");
}
processEngine = processEngineConfiguration.buildProcessEngine();
}
}
Aggregations