// sanity check: an event may only come after a complete record.
if (this.deserializer.hasUnfinishedData()) {
throw new IllegalStateException("Channel received an event before completing the current partial record.");
}
AbstractEvent evt = boe.getEvent();
if (evt.getClass() == ChannelCloseEvent.class) {
this.brokerAggreedToCloseChannel = true;
return InputChannelResult.END_OF_STREAM;
}
else if (evt.getClass() == EndOfSuperstepEvent.class) {
return InputChannelResult.END_OF_SUPERSTEP;
}
else if (evt instanceof AbstractTaskEvent) {
this.currentEvent = (AbstractTaskEvent) evt;
return InputChannelResult.TASK_EVENT;