Skip to content

Commit

Permalink
Restrict events to listeners our interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
grum committed Dec 24, 2011
1 parent c7ab756 commit 9c07c79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/nl/grum/microcraft/Event.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package nl.grum.microcraft;

public interface Event<L> {
public interface Event<L extends Listener> {
void notify(final L listener);
}
6 changes: 3 additions & 3 deletions src/main/java/nl/grum/microcraft/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

public class Server {

private final ConcurrentLinkedQueue<Event> queue = new ConcurrentLinkedQueue<Event>();
private final ConcurrentLinkedQueue<Event<?>> queue = new ConcurrentLinkedQueue<Event<?>>();

public void queueEvent(Event e) {
public void queueEvent(Event<?> e) {
queue.add(e);
}

public Event pollEvent() {
public Event<?> pollEvent() {
return queue.poll();
}

Expand Down

0 comments on commit 9c07c79

Please sign in to comment.