mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 04:39:54 +01:00
Semi-encapsulated the core/api dependency graphs and created a proper structure to load eager singletons
This commit is contained in:
@@ -2,18 +2,13 @@ package org.briarproject.messaging;
|
||||
|
||||
import org.briarproject.api.clients.ClientHelper;
|
||||
import org.briarproject.api.contact.ContactManager;
|
||||
import org.briarproject.api.data.BdfReaderFactory;
|
||||
import org.briarproject.api.data.BdfWriterFactory;
|
||||
import org.briarproject.api.data.MetadataEncoder;
|
||||
import org.briarproject.api.messaging.MessagingManager;
|
||||
import org.briarproject.api.messaging.PrivateMessageFactory;
|
||||
import org.briarproject.api.sync.MessageFactory;
|
||||
import org.briarproject.api.sync.ValidationManager;
|
||||
import org.briarproject.api.system.Clock;
|
||||
import org.briarproject.contact.ContactModule;
|
||||
import org.briarproject.data.DataModule;
|
||||
import org.briarproject.sync.SyncModule;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.Module;
|
||||
@@ -24,13 +19,17 @@ import static org.briarproject.messaging.MessagingManagerImpl.CLIENT_ID;
|
||||
@Module
|
||||
public class MessagingModule {
|
||||
|
||||
public static class EagerSingletons {
|
||||
@Inject MessagingManager messagingManager;
|
||||
@Inject PrivateMessageValidator privateMessageValidator;
|
||||
}
|
||||
|
||||
@Provides
|
||||
PrivateMessageFactory providePrivateMessageFactory(
|
||||
ClientHelper clientHelper) {
|
||||
return new PrivateMessageFactoryImpl(clientHelper);
|
||||
}
|
||||
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
PrivateMessageValidator getValidator(ValidationManager validationManager,
|
||||
|
||||
Reference in New Issue
Block a user