void checkDataSourceAndThreadSwitch() { // Get defaults if (dataSource == null) { dataSource = PVManager.getDefaultDataSource(); } if (notificationExecutor == null) { notificationExecutor = PVManager.getDefaultNotificationExecutor(); } // Check that a data source has been specified if (dataSource == null) { throw new IllegalStateException("You need to specify a source either " + "using PVManager.setDefaultDataSource or by using " + "read(...).from(dataSource)."); } // Check that thread switch has been specified if (notificationExecutor == null) { throw new IllegalStateException("You need to specify a thread either " + "using PVManager.setDefaultThreadSwitch or by using " + "read(...).andNotify(threadSwitch)."); } } }