You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ZustandsAdapter.java 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package subscriber;
  7. import java.util.concurrent.Flow.Subscriber;
  8. import java.util.concurrent.Flow.Subscription;
  9. /**
  10. *
  11. * @author le
  12. */
  13. public class ZustandsAdapter implements Subscriber<Boolean>
  14. {
  15. private SubscriberView view;
  16. private Datenmodell model;
  17. private Subscription subscription;
  18. public ZustandsAdapter(SubscriberView view, Datenmodell model)
  19. {
  20. this.view = view;
  21. this.model = model;
  22. }
  23. public void einschreiben()
  24. {
  25. model.addZustandSubscription(this);
  26. }
  27. @Override
  28. public void onSubscribe(Subscription subscription)
  29. {
  30. this.subscription = subscription;
  31. subscription.request(1);
  32. }
  33. @Override
  34. public void onNext(Boolean item)
  35. {
  36. subscription.request(1);
  37. }
  38. @Override
  39. public void onError(Throwable throwable)
  40. {
  41. }
  42. @Override
  43. public void onComplete()
  44. {
  45. }
  46. }