Changed the root package from net.sf.briar to org.briarproject.

This commit is contained in:
akwizgran
2014-01-08 16:18:30 +00:00
parent dce70f487c
commit 832476412c
427 changed files with 2507 additions and 2507 deletions

View File

@@ -0,0 +1,19 @@
package org.briarproject.api.android;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
/**
* Enables background threads to make Android API calls that must be made from
* a thread with a message queue.
*/
public interface AndroidExecutor {
/**
* Runs the given task on a thread with a message queue and returns the
* result of the task.
*/
<V> V call(Callable<V> c) throws InterruptedException, ExecutionException;
void shutdown();
}

View File

@@ -0,0 +1,19 @@
package org.briarproject.api.android;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import com.google.inject.BindingAnnotation;
/**
* Annotation for injecting the executor for accessing the database from the UI.
*/
@BindingAnnotation
@Target({ FIELD, METHOD, PARAMETER })
@Retention(RUNTIME)
public @interface DatabaseUiExecutor {}

View File

@@ -0,0 +1,27 @@
package org.briarproject.api.android;
/**
* Manages mappings between object references and serialisable handles. This
* enables references to be passed between Android UI objects that belong to
* the same process but can only communicate via serialisation.
*/
public interface ReferenceManager {
/**
* Returns the object with the given handle, or null if no mapping exists
* for the handle.
*/
<T> T getReference(long handle, Class<T> c);
/**
* Creates a mapping between the given reference and a handle, and returns
* the handle.
*/
<T> long putReference(T reference, Class<T> c);
/**
* Removes and returns the object with the given handle, or returns null
* if no mapping exists for the handle.
*/
<T> T removeReference(long handle, Class<T> c);
}