@Override public void run() { Registry.setCurrentTenant(Registry.getTenantByID(tenant)); try { final ConsignmentModel model = getModelService().get(PK.fromLong(consignment)); getWarehouse2ProcessAdapter() .receiveConsignmentStatus(model, WarehouseConsignmentStatus.COMPLETE); } finally { Registry.unsetCurrentTenant(); } }
@Override public void run() { Registry.setCurrentTenant(tenant); if (isReader) { System.out.println("Starting in reader mode"); runAsReader(); } else { System.out.println("Starting in writer mode"); runAsWriter(); } }