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(); } }