persistentdbStorage.setCheckDbConsistencyAtStartup(true);
PersistentPriorityProcessorPool persistentPriorityProcessorPool = new PersistentPriorityProcessorPool(PersistentProcessorPool.DEFAULT_POOL_ID,txnController);
PersistentScottyEngine persistentengine = new PersistentScottyEngine();
persistentengine.setIdFactory(new JdkRandomUUIDFactory());
persistentengine.setDbStorage(persistentdbStorage);
persistentengine.setWfRepository(wfRepository);
persistentengine.setEngineIdProvider(ENGINE_ID_PROVIDER);
persistentengine.setStatisticsCollector(runtimeStatisticsCollector);
DefaultProcessorPoolManager<PersistentPriorityProcessorPool> defaultProcessorPoolManager = new DefaultProcessorPoolManager<PersistentPriorityProcessorPool>();
defaultProcessorPoolManager.setProcessorPools(Arrays.asList(persistentPriorityProcessorPool));
defaultProcessorPoolManager.setEngine(persistentengine);
persistentengine.setProcessorPoolManager(defaultProcessorPoolManager);
//persistentengine.shutdown();
BatchingAuditTrail auditTrail = new BatchingAuditTrail();
auditTrail.setBatcher(batcher);
auditTrail.setDataSource(databaseData.dataSource);
auditTrail.setMessagePostProcessor(new CompressedBase64PostProcessor());
try {
auditTrail.startup();
} catch (Exception e) {
throw new RuntimeException(e);
}
PojoDependencyInjector dependyInjector = new PojoDependencyInjector();
MonitoringDataStorage monitoringDataStorage;
try {
monitoringDataStorage = new MonitoringDataStorage(File.createTempFile("test", ".tmp").getParentFile(), "copperMonitorLog");
} catch (IOException e1) {
throw new RuntimeException(e1);
}
final MonitoringDataAccessQueue monitoringQueue = new MonitoringDataAccessQueue(new MonitoringDataAccesor(monitoringDataStorage),new MonitoringDataAdder(monitoringDataStorage));
final MonitoringDataCollector monitoringDataCollector = new MonitoringDataCollector(monitoringQueue);
MonitoringDependencyInjector monitoringDependencyInjector= new MonitoringDependencyInjector(dependyInjector, monitoringDataCollector);
BillAdapterImpl billAdapterImpl = new BillAdapterImpl(monitoringDataCollector);
billAdapterImpl.initWithEngine(new MonitoringAdapterProcessingEngine(billAdapterImpl,persistentengine,monitoringDataCollector));
dependyInjector.register("billAdapter", billAdapterImpl);
dependyInjector.register("auditTrail", auditTrail);
persistentengine.setDependencyInjector(monitoringDependencyInjector);
persistentengine.startup();
try {
persistentengine.run("BillWorkflow", "");
} catch (CopperException e) {
throw new RuntimeException(e);
}
List<ProcessingEngineMXBean> engines = new ArrayList<ProcessingEngineMXBean>();