import org.opendaylight.controller.sample.kitchen.api.KitchenServiceRuntimeMXBean;
import org.opendaylight.mdsal.binding.api.NotificationService;
import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
-import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.MakeToastInput;
+import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.MakeToast;
import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.MakeToastInputBuilder;
import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.MakeToastOutput;
import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.MakeToastOutputBuilder;
import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.ToasterListener;
import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.ToasterOutOfBread;
import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.ToasterRestocked;
-import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.ToasterService;
import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.WheatBread;
import org.opendaylight.yangtools.concepts.Registration;
import org.opendaylight.yangtools.yang.common.ErrorTag;
private static final MakeToastOutput EMPTY_MAKE_OUTPUT = new MakeToastOutputBuilder().build();
private final ExecutorService executor = Executors.newCachedThreadPool();
- private final ToasterService toaster;
+ private final MakeToast makeToast;
private final Registration reg;
private volatile boolean toasterOutOfBread;
public KitchenServiceImpl(@Reference final RpcConsumerRegistry rpcRegistry,
@Reference final NotificationService notifService) {
super("KitchenService", "toaster-consumer", null);
- toaster = rpcRegistry.getRpcService(ToasterService.class);
+ makeToast = rpcRegistry.getRpc(MakeToast.class);
reg = notifService.registerNotificationListener(this);
register();
}
}
// Access the ToasterService to make the toast.
-
- MakeToastInput toastInput = new MakeToastInputBuilder().setToasterDoneness(Uint32.valueOf(toastDoneness))
- .setToasterToastType(toastType).build();
-
- return toaster.makeToast(toastInput);
+ return makeToast.invoke(new MakeToastInputBuilder()
+ .setToasterDoneness(Uint32.valueOf(toastDoneness))
+ .setToasterToastType(toastType)
+ .build());
}
@Override