public abstract class Monitor extends Object implements GCUBEConsumer<Topic,Object>
GCUBEConsumer for consumers of Events.
Monitor implements GCUBEConsumer.onEvent(GCUBEEvent...) to dispatch LifetimeEvents
to event-specific callbacks and any other Event to a catch-all callback (cf. onAnyEvent(Event).
Subclasses may also extend onEvent(GCUBEEvent...) to extend the callback pattern to other types of Event.
| Constructor and Description |
|---|
Monitor() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
onAnyEvent(Event<?,?> e)
Callback for any handle event.
|
protected void |
onCompletion(Event.Done e)
Callback for a
Event.Done event. |
<T1 extends Topic,P1> |
onEvent(GCUBEEvent<T1,P1>... events)
Notifies the consumer of one of more events about topics for which the consumer
has previously subscribed with a
GCUBEProducer |
protected void |
onFailure(Event.Failed e)
Callback for a
Event.Failed event. |
protected void |
onRunning(Event.Running e)
Callback for a
Event.Running event. |
protected void |
onSuspension(Event.Suspended e)
Callback for a
Event.Suspended event. |
public <T1 extends Topic,P1> void onEvent(GCUBEEvent<T1,P1>... events)
GCUBEProduceronEvent in interface GCUBEConsumer<Topic,Object>T1 - the topic type.P1 - the payload type.events - the events.protected void onRunning(Event.Running e)
Event.Running event.e - the event.protected void onCompletion(Event.Done e)
Event.Done event.e - the event.protected void onFailure(Event.Failed e)
Event.Failed event.e - the event.protected void onSuspension(Event.Suspended e)
Event.Suspended event.e - the event.protected void onAnyEvent(Event<?,?> e)
e - the event.Copyright © 2015. All Rights Reserved.