private void stopAdapter(PersistenceAdapter kahaDBPersistenceAdapter, String destination) { try { kahaDBPersistenceAdapter.stop(); } catch (Exception e) { RuntimeException detail = new RuntimeException("Failed to stop per destination persistence adapter for destination: " + destination + ", options:" + adapters, e); LOG.error(detail.toString(), e); throw detail; } }
@Override public void stop() throws Exception { this.usageManager.getMemoryUsage().removeUsageListener(this); if (!started.compareAndSet(true, false)) { return; } this.scheduler.cancel(periodicCheckpointTask); this.scheduler.stop(); // Take one final checkpoint and stop checkpoint processing. checkpoint(true, true); checkpointTask.shutdown(); ThreadPoolUtils.shutdown(checkpointExecutor); checkpointExecutor = null; queues.clear(); topics.clear(); IOException firstException = null; try { journal.close(); } catch (Exception e) { firstException = IOExceptionSupport.create("Failed to close journals: " + e, e); } longTermPersistence.stop(); if (firstException != null) { throw firstException; } }
private void stopAdapter(PersistenceAdapter kahaDBPersistenceAdapter, String destination) { try { kahaDBPersistenceAdapter.stop(); } catch (Exception e) { RuntimeException detail = new RuntimeException("Failed to stop per destination persistence adapter for destination: " + destination + ", options:" + adapters, e); LOG.error(detail.toString(), e); throw detail; } }
private void stopAdapter(PersistenceAdapter kahaDBPersistenceAdapter, String destination) { try { kahaDBPersistenceAdapter.stop(); } catch (Exception e) { RuntimeException detail = new RuntimeException("Failed to stop per destination persistence adapter for destination: " + destination + ", options:" + adapters, e); LOG.error(detail.toString(), e); throw detail; } }
private void stopAdapter(PersistenceAdapter kahaDBPersistenceAdapter, String destination) { try { kahaDBPersistenceAdapter.stop(); } catch (Exception e) { RuntimeException detail = new RuntimeException("Failed to stop per destination persistence adapter for destination: " + destination + ", options:" + adapters, e); LOG.error(detail.toString(), e); throw detail; } }
public void execute() throws Exception { if (config == null) { throw new Exception("required --config option missing"); } if (file == null) { throw new Exception("required --file option missing"); } System.out.println("Loading: " + config); BrokerFactory.setStartDefault(false); // to avoid the broker auto-starting.. BrokerService broker = BrokerFactory.createBroker(config); BrokerFactory.resetStartDefault(); PersistenceAdapter store = broker.getPersistenceAdapter(); System.out.println("Starting: " + store); store.start(); try { BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream(file)); try { export(store, fos); } finally { fos.close(); } } finally { store.stop(); } }
public void execute() throws Exception { if (config == null) { throw new Exception("required --config option missing"); } if (file == null) { throw new Exception("required --file option missing"); } System.out.println("Loading: " + config); BrokerFactory.setStartDefault(false); // to avoid the broker auto-starting.. BrokerService broker = BrokerFactory.createBroker(config); BrokerFactory.resetStartDefault(); PersistenceAdapter store = broker.getPersistenceAdapter(); System.out.println("Starting: " + store); store.start(); try { BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream(file)); try { export(store, fos); } finally { fos.close(); } } finally { store.stop(); } }
public void execute() throws Exception { if (config == null) { throw new Exception("required --config option missing"); } if (file == null) { throw new Exception("required --file option missing"); } System.out.println("Loading: " + config); BrokerFactory.setStartDefault(false); // to avoid the broker auto-starting.. BrokerService broker = BrokerFactory.createBroker(config); BrokerFactory.resetStartDefault(); PersistenceAdapter store = broker.getPersistenceAdapter(); System.out.println("Starting: " + store); store.start(); try { BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream(file)); try { export(store, fos); } finally { fos.close(); } } finally { store.stop(); } }
public void stop() throws Exception { this.usageManager.getMemoryUsage().removeUsageListener(this); if (!started.compareAndSet(true, false)) { return; } this.scheduler.cancel(periodicCheckpointTask); this.scheduler.stop(); // Take one final checkpoint and stop checkpoint processing. checkpoint(true, true); checkpointTask.shutdown(); checkpointExecutor.shutdown(); queues.clear(); topics.clear(); IOException firstException = null; try { journal.close(); } catch (Exception e) { firstException = IOExceptionSupport.create("Failed to close journals: " + e, e); } longTermPersistence.stop(); if (firstException != null) { throw firstException; } }
@Override public void stop() throws Exception { this.usageManager.getMemoryUsage().removeUsageListener(this); if (!started.compareAndSet(true, false)) { return; } this.scheduler.cancel(periodicCheckpointTask); this.scheduler.stop(); // Take one final checkpoint and stop checkpoint processing. checkpoint(true, true); checkpointTask.shutdown(); ThreadPoolUtils.shutdown(checkpointExecutor); checkpointExecutor = null; queues.clear(); topics.clear(); IOException firstException = null; try { journal.close(); } catch (Exception e) { firstException = IOExceptionSupport.create("Failed to close journals: " + e, e); } longTermPersistence.stop(); if (firstException != null) { throw firstException; } }
@Override public void stop() throws Exception { this.usageManager.getMemoryUsage().removeUsageListener(this); if (!started.compareAndSet(true, false)) { return; } this.scheduler.cancel(periodicCheckpointTask); this.scheduler.stop(); // Take one final checkpoint and stop checkpoint processing. checkpoint(true, true); checkpointTask.shutdown(); ThreadPoolUtils.shutdown(checkpointExecutor); checkpointExecutor = null; queues.clear(); topics.clear(); IOException firstException = null; try { journal.close(); } catch (Exception e) { firstException = IOExceptionSupport.create("Failed to close journals: " + e, e); } longTermPersistence.stop(); if (firstException != null) { throw firstException; } }
@Override public void stop() throws Exception { this.usageManager.getMemoryUsage().removeUsageListener(this); if (!started.compareAndSet(true, false)) { return; } this.scheduler.cancel(periodicCheckpointTask); this.scheduler.stop(); // Take one final checkpoint and stop checkpoint processing. checkpoint(true, true); checkpointTask.shutdown(); ThreadPoolUtils.shutdown(checkpointExecutor); checkpointExecutor = null; queues.clear(); topics.clear(); IOException firstException = null; try { journal.close(); } catch (Exception e) { firstException = IOExceptionSupport.create("Failed to close journals: " + e, e); } longTermPersistence.stop(); if (firstException != null) { throw firstException; } }