RemoteCallbackList.Builder
public
static
final
class
RemoteCallbackList.Builder
extends Object
Builder for RemoteCallbackList
.
Summary
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Public constructors
Public methods
setExecutor
public RemoteCallbackList.Builder<E> setExecutor (Executor executor)
Sets the executor to be used when invoking callbacks asynchronously.
This is only used when callbacks need to be invoked asynchronously, e.g. when the process
hosting a callback becomes unfrozen. Callbacks that can be invoked immediately run on the
same thread that calls RemoteCallbackList.broadcast(Consumer)
synchronously.
Parameters |
executor |
Executor : This value cannot be null .
Callback and listener events are dispatched through this
Executor , providing an easy way to control which thread is
used. To dispatch events through the main thread of your
application, you can use
Context.getMainExecutor() .
Otherwise, provide an Executor that dispatches to an appropriate thread. |
setInterfaceDiedCallback
public RemoteCallbackList.Builder<E> setInterfaceDiedCallback (InterfaceDiedCallback<E> callback)
Sets the callback to be invoked when an interface dies.
Parameters |
callback |
InterfaceDiedCallback : This value cannot be null . |
setMaxQueueSize
public RemoteCallbackList.Builder<E> setMaxQueueSize (int maxQueueSize)
Sets the max queue size.
Parameters |
maxQueueSize |
int : The max size limit on the queue that stores callbacks added when the
recipient's process is frozen. Once the limit is reached, the oldest callback is dropped
to keep the size under the limit. Should only be called for
RemoteCallbackList.FROZEN_CALLEE_POLICY_ENQUEUE_ALL . |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-13 UTC.
[null,null,["Last updated 2025-02-13 UTC."],[],[]]