Separated event infrastructure from DB.

This commit is contained in:
akwizgran
2014-10-03 09:44:54 +01:00
parent 6a4ea49786
commit 8b8df435a5
29 changed files with 368 additions and 244 deletions

View File

@@ -13,7 +13,6 @@ import org.briarproject.api.Settings;
import org.briarproject.api.TransportConfig;
import org.briarproject.api.TransportId;
import org.briarproject.api.TransportProperties;
import org.briarproject.api.event.EventListener;
import org.briarproject.api.messaging.Ack;
import org.briarproject.api.messaging.Group;
import org.briarproject.api.messaging.GroupId;
@@ -43,12 +42,6 @@ public interface DatabaseComponent {
/** Waits for any open transactions to finish and closes the database. */
void close() throws DbException, IOException;
/** Adds a listener to be notified when database events occur. */
void addListener(EventListener l);
/** Removes a listener. */
void removeListener(EventListener l);
/**
* Stores a contact associated with the given local and remote pseudonyms,
* and returns an ID for the contact.

View File

@@ -0,0 +1,13 @@
package org.briarproject.api.event;
public interface EventBus {
/** Adds a listener to be notified when events occur. */
void addListener(EventListener l);
/** Removes a listener. */
void removeListener(EventListener l);
/** Notifies all listeners of an event. */
void broadcast(Event e);
}