public DataSource getDataSource() { return withServiceTracker(dataSourceTracker, new APICallback<DataSource, DataSource>(DATASOURCE_SERVICE_NAME) { @Override public DataSource executeWithService(final DataSource service) { return dataSourceTracker.getService(); } }); } }
@Override public void start(final BundleContext context) throws Exception { super.start(context); final String bundleName = context.getBundle().getSymbolicName(); logService.log(LogService.LOG_INFO, "TestActivator starting bundle = " + bundleName); final IDBI dbi = new DBI(dataSource.getDataSource()); testDao = new TestDao(dbi); testDao.createTable(); testDao.insertStarted(); registerPaymentApi(context, testDao); }
@Override public void start(final BundleContext context) throws Exception { // Tracked resource killbillAPI = new OSGIKillbillAPI(context); logService = new OSGIKillbillLogService(context); dataSource = new OSGIKillbillDataSource(context); dispatcher = new OSGIKillbillEventDispatcher(context); // Registrar for bundle registrar = new OSGIKillbillRegistrar(); // Killbill events final OSGIKillbillEventHandler handler = getOSGIKillbillEventHandler(); if (handler != null) { dispatcher.registerEventHandler(handler); } }
dataSource.close(); dataSource = null;
@Override public void start(final BundleContext context) throws Exception { super.start(context); final String bundleName = context.getBundle().getSymbolicName(); logService.log(LogService.LOG_INFO, "TestActivator starting bundle = " + bundleName); final IDBI dbi = new DBI(dataSource.getDataSource()); testDao = new TestDao(dbi); testDao.createTable(); testDao.insertStarted(); registerPaymentApi(context, testDao); }
@Override public void start(final BundleContext context) throws Exception { // Tracked resource killbillAPI = new OSGIKillbillAPI(context); logService = new OSGIKillbillLogService(context); dataSource = new OSGIKillbillDataSource(context); dispatcher = new OSGIKillbillEventDispatcher(context); // Registrar for bundle registrar = new OSGIKillbillRegistrar(); // Killbill events final OSGIKillbillEventHandler handler = getOSGIKillbillEventHandler(); if (handler != null) { dispatcher.registerEventHandler(handler); } }
dataSource.close(); dataSource = null;
public DataSource getDataSource() { return withServiceTracker(dataSourceTracker, new APICallback<DataSource, DataSource>(DATASOURCE_SERVICE_NAME) { @Override public DataSource executeWithService(final DataSource service) { return dataSourceTracker.getService(); } }); } }