- Type Parameters:
T- type of the buffered objects.
- All Known Implementing Classes:
public interface ZDispenser<T>
ZBufferto dispense buffered objects.
ZBuffer that runs on its own thread uses an implementation of this interface for dispensing the
- See Also:
void dispense(T object, boolean urgent)Dispenses the objects pulled from the associated
Implement this method to handle objects that are pulled from the associated buffer. The
objectparameter is the dispensed object. It can be
nullif the buffer's pull waiting time is limited and there are no objects in the buffer. The
urgentparameter tells that the object was pushed to the bottom of the buffer because of its urgency, and therefore it should be handled accordingly. For instance if the dispensed objects are written to a communication socket, the socket should be flushed after writing urgent objects.
object- the object pulled from the associated buffer, or null if the buffer is empty.
urgent- marks an urgent object.
void handleException(Exception ex)Handles an exception occurred while processing the associated
Implement this method to handle exceptions in the associated buffer.
ex- the exception.