mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Merge branch '279-create-client-state' into 'master'
Create local state for clients at startup. #279 Most of the clients we've written so far use private groups shared with individual contacts and/or a local group that's not shared with anyone. To make it easier to ensure that the necessary groups exist when we need them, this patch allows clients to register startup hooks for creating their local state. Fixes #279. See merge request !131
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.briarproject;
|
||||
|
||||
import org.briarproject.api.clients.Client;
|
||||
import org.briarproject.api.lifecycle.IoExecutor;
|
||||
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||
import org.briarproject.api.lifecycle.Service;
|
||||
@@ -20,8 +21,14 @@ public class TestLifecycleModule {
|
||||
@Provides
|
||||
LifecycleManager provideLifecycleManager() {
|
||||
return new LifecycleManager() {
|
||||
|
||||
@Override
|
||||
public void register(Service s) {
|
||||
public void registerService(Service s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerClient(Client c) {
|
||||
|
||||
}
|
||||
|
||||
@@ -60,6 +67,7 @@ public class TestLifecycleModule {
|
||||
@Provides
|
||||
ShutdownManager provideShutdownManager() {
|
||||
return new ShutdownManager() {
|
||||
|
||||
@Override
|
||||
public int addShutdownHook(Runnable hook) {
|
||||
return 0;
|
||||
@@ -75,8 +83,7 @@ public class TestLifecycleModule {
|
||||
@Provides
|
||||
@IoExecutor
|
||||
@Singleton
|
||||
Executor provideExecutor() {
|
||||
Executor provideIoExecutor() {
|
||||
return Executors.newCachedThreadPool();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user