AbstractExecutionThreadService.java
7.55 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
package com.google.common.util.concurrent;
import com.google.common.annotations.Beta;
import com.google.common.base.Supplier;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.logging.Logger;
@Beta
public abstract class AbstractExecutionThreadService
implements Service
{
private static final Logger a = Logger.getLogger(AbstractExecutionThreadService.class.getName());
private final Service b = new AbstractService()
{
protected final void doStart()
{
MoreExecutors.a(AbstractExecutionThreadService.this.executor(), new Supplier() {}).execute(new Runnable()
{
/* Error */
public final void run()
{
// Byte code:
// 0: aload_0
// 1: getfield 17 com/google/common/util/concurrent/AbstractExecutionThreadService$1$2:a Lcom/google/common/util/concurrent/AbstractExecutionThreadService$1;
// 4: getfield 28 com/google/common/util/concurrent/AbstractExecutionThreadService$1:a Lcom/google/common/util/concurrent/AbstractExecutionThreadService;
// 7: invokevirtual 33 com/google/common/util/concurrent/AbstractExecutionThreadService:startUp ()V
// 10: aload_0
// 11: getfield 17 com/google/common/util/concurrent/AbstractExecutionThreadService$1$2:a Lcom/google/common/util/concurrent/AbstractExecutionThreadService$1;
// 14: invokevirtual 36 com/google/common/util/concurrent/AbstractExecutionThreadService$1:notifyStarted ()V
// 17: aload_0
// 18: getfield 17 com/google/common/util/concurrent/AbstractExecutionThreadService$1$2:a Lcom/google/common/util/concurrent/AbstractExecutionThreadService$1;
// 21: invokevirtual 40 com/google/common/util/concurrent/AbstractExecutionThreadService$1:isRunning ()Z
// 24: istore_1
// 25: iload_1
// 26: ifeq +13 -> 39
// 29: aload_0
// 30: getfield 17 com/google/common/util/concurrent/AbstractExecutionThreadService$1$2:a Lcom/google/common/util/concurrent/AbstractExecutionThreadService$1;
// 33: getfield 28 com/google/common/util/concurrent/AbstractExecutionThreadService$1:a Lcom/google/common/util/concurrent/AbstractExecutionThreadService;
// 36: invokevirtual 42 com/google/common/util/concurrent/AbstractExecutionThreadService:run ()V
// 39: aload_0
// 40: getfield 17 com/google/common/util/concurrent/AbstractExecutionThreadService$1$2:a Lcom/google/common/util/concurrent/AbstractExecutionThreadService$1;
// 43: getfield 28 com/google/common/util/concurrent/AbstractExecutionThreadService$1:a Lcom/google/common/util/concurrent/AbstractExecutionThreadService;
// 46: invokevirtual 45 com/google/common/util/concurrent/AbstractExecutionThreadService:shutDown ()V
// 49: aload_0
// 50: getfield 17 com/google/common/util/concurrent/AbstractExecutionThreadService$1$2:a Lcom/google/common/util/concurrent/AbstractExecutionThreadService$1;
// 53: invokevirtual 48 com/google/common/util/concurrent/AbstractExecutionThreadService$1:notifyStopped ()V
// 56: return
// 57: astore_2
// 58: aload_0
// 59: getfield 17 com/google/common/util/concurrent/AbstractExecutionThreadService$1$2:a Lcom/google/common/util/concurrent/AbstractExecutionThreadService$1;
// 62: getfield 28 com/google/common/util/concurrent/AbstractExecutionThreadService$1:a Lcom/google/common/util/concurrent/AbstractExecutionThreadService;
// 65: invokevirtual 45 com/google/common/util/concurrent/AbstractExecutionThreadService:shutDown ()V
// 68: aload_2
// 69: athrow
// 70: astore_2
// 71: aload_0
// 72: getfield 17 com/google/common/util/concurrent/AbstractExecutionThreadService$1$2:a Lcom/google/common/util/concurrent/AbstractExecutionThreadService$1;
// 75: aload_2
// 76: invokevirtual 52 com/google/common/util/concurrent/AbstractExecutionThreadService$1:notifyFailed (Ljava/lang/Throwable;)V
// 79: aload_2
// 80: invokestatic 58 com/google/common/base/Throwables:propagate (Ljava/lang/Throwable;)Ljava/lang/RuntimeException;
// 83: athrow
// 84: astore_3
// 85: invokestatic 61 com/google/common/util/concurrent/AbstractExecutionThreadService:a ()Ljava/util/logging/Logger;
// 88: getstatic 67 java/util/logging/Level:WARNING Ljava/util/logging/Level;
// 91: ldc 69
// 93: aload_3
// 94: invokevirtual 75 java/util/logging/Logger:log (Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
// 97: goto -29 -> 68
// Local variable table:
// start length slot name signature
// 0 100 0 this 2
// 24 2 1 bool boolean
// 57 12 2 localThrowable1 Throwable
// 70 10 2 localThrowable2 Throwable
// 84 10 3 localException Exception
// Exception table:
// from to target type
// 29 39 57 java/lang/Throwable
// 0 25 70 java/lang/Throwable
// 39 56 70 java/lang/Throwable
// 58 68 70 java/lang/Throwable
// 68 70 70 java/lang/Throwable
// 85 97 70 java/lang/Throwable
// 58 68 84 java/lang/Exception
}
});
}
protected final void doStop()
{
AbstractExecutionThreadService.this.triggerShutdown();
}
};
public final void addListener(Service.Listener paramListener, Executor paramExecutor)
{
this.b.addListener(paramListener, paramExecutor);
}
public final void awaitRunning()
{
this.b.awaitRunning();
}
public final void awaitRunning(long paramLong, TimeUnit paramTimeUnit)
throws TimeoutException
{
this.b.awaitRunning(paramLong, paramTimeUnit);
}
public final void awaitTerminated()
{
this.b.awaitTerminated();
}
public final void awaitTerminated(long paramLong, TimeUnit paramTimeUnit)
throws TimeoutException
{
this.b.awaitTerminated(paramLong, paramTimeUnit);
}
protected Executor executor()
{
new Executor()
{
public final void execute(Runnable paramAnonymousRunnable)
{
MoreExecutors.a(AbstractExecutionThreadService.this.serviceName(), paramAnonymousRunnable).start();
}
};
}
public final Throwable failureCause()
{
return this.b.failureCause();
}
public final boolean isRunning()
{
return this.b.isRunning();
}
protected abstract void run()
throws Exception;
protected String serviceName()
{
return getClass().getSimpleName();
}
protected void shutDown()
throws Exception
{}
public final Service startAsync()
{
this.b.startAsync();
return this;
}
protected void startUp()
throws Exception
{}
public final Service.State state()
{
return this.b.state();
}
public final Service stopAsync()
{
this.b.stopAsync();
return this;
}
public String toString()
{
String str1 = String.valueOf(String.valueOf(serviceName()));
String str2 = String.valueOf(String.valueOf(state()));
return str1.length() + 3 + str2.length() + str1 + " [" + str2 + "]";
}
protected void triggerShutdown() {}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/google/common/util/concurrent/AbstractExecutionThreadService.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/