1 package net.sf.josceleton.core.api.async; 2 3 /** 4 * Marks a type to interact asynchroniously via a listener defining some callback methods. 5 * 6 * No presumptions about the order of notification can be made, as it will depend on the internally used datastructure. 7 * 8 * @since 0.1 9 */ 10 public interface Async<L extends Listener> { 11 12 /** 13 * Add a listener to this <code>Async</code> type. 14 * 15 * If <code>listener</code> was already added, nothing will happen (except of a warning showing up in the logs). 16 * 17 * @param listener which will be notified via <code>onXyz()</code> callbacks. 18 * @since 0.1 19 */ 20 void addListener(L listener); 21 22 /** 23 * Add a listener to this <code>Async</code> type. 24 * 25 * If <code>listener</code> was already added, nothing will happen (except of a warning showing up in the logs). 26 * 27 * @param listener which will be notified via <code>onXyz()</code> callbacks. 28 * @since 0.1 29 */ 30 void removeListener(L listener); 31 32 }