AsyncEventBus.java
1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package com.google.common.eventbus;
import com.google.common.annotations.Beta;
import com.google.common.base.Preconditions;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Executor;
import qn;
@Beta
public class AsyncEventBus
extends EventBus
{
private final Executor a;
private final ConcurrentLinkedQueue<EventBus.a> b = new ConcurrentLinkedQueue();
public AsyncEventBus(String paramString, Executor paramExecutor)
{
super(paramString);
this.a = ((Executor)Preconditions.checkNotNull(paramExecutor));
}
public AsyncEventBus(Executor paramExecutor)
{
super("default");
this.a = ((Executor)Preconditions.checkNotNull(paramExecutor));
}
public AsyncEventBus(Executor paramExecutor, SubscriberExceptionHandler paramSubscriberExceptionHandler)
{
super(paramSubscriberExceptionHandler);
this.a = ((Executor)Preconditions.checkNotNull(paramExecutor));
}
final void a(Object paramObject, qn paramqn)
{
this.b.offer(new EventBus.a(paramObject, paramqn));
}
final void b(final Object paramObject, final qn paramqn)
{
Preconditions.checkNotNull(paramObject);
Preconditions.checkNotNull(paramqn);
this.a.execute(new Runnable()
{
public final void run()
{
AsyncEventBus.a(AsyncEventBus.this, paramObject, paramqn);
}
});
}
protected void dispatchQueuedEvents()
{
for (;;)
{
EventBus.a locala = (EventBus.a)this.b.poll();
if (locala == null) {
break;
}
b(locala.a, locala.b);
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/google/common/eventbus/AsyncEventBus.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/