ResourceCache$class.java
9.74 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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.forms.cache.ResourceCache$
* com.adobe.forms.cache.ResourceCache$$anonfun
* com.adobe.forms.cache.ResourceCache$$anonfun$clearAll
* com.adobe.forms.cache.ResourceCache$$anonfun$get
* com.adobe.forms.cache.ResourceCache$$anonfun$getOrElseUpdate
* com.adobe.forms.cache.ResourceCache$$anonfun$put
* org.slf4j.Logger
* org.slf4j.LoggerFactory
* scala.Function0
* scala.Function1
* scala.None
* scala.None$
* scala.Option
* scala.runtime.AbstractFunction0
* scala.runtime.AbstractFunction0$mcV
* scala.runtime.AbstractFunction0$mcV$sp
* scala.runtime.AbstractFunction0$mcZ
* scala.runtime.AbstractFunction0$mcZ$sp
* scala.runtime.BoxesRunTime
*/
package com.adobe.forms.cache;
import com.adobe.forms.cache.CacheStore;
import com.adobe.forms.cache.Cacheable;
import com.adobe.forms.cache.LCFormsCacheConfig;
import com.adobe.forms.cache.ResourceCache;
import com.adobe.forms.cache.impl.CacheConfigParam$;
import com.adobe.forms.logging.PerfLogger$;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import scala.Function0;
import scala.Function1;
import scala.None;
import scala.Option;
import scala.runtime.AbstractFunction0;
import scala.runtime.BoxesRunTime;
public abstract class ResourceCache$class {
public static long cacheSize(ResourceCache $this) {
return $this.lcFormsCacheConfig().getCacheSize();
}
public static double maxObjectSize(ResourceCache $this) {
return CacheConfigParam$.MODULE$.getSizeMb($this.lcFormsCacheConfig().getMaxObjectSize()) * 1024 * 1024;
}
public static boolean put(ResourceCache $this, Cacheable res$1) {
return BoxesRunTime.unboxToBoolean(PerfLogger$.MODULE$.measure((Function0<Object>)new scala.Serializable($this){
public static final long serialVersionUID;
public static {
long l = ResourceCache..anonfun.put.serialVersionUID = 0;
}
public final String apply() {
return "ResourceCache.put";
}
}, new scala.Serializable($this, res$1){
public static final long serialVersionUID;
private final ResourceCache $outer;
private final Cacheable res$1;
public static {
long l = ResourceCache..anonfun.put.serialVersionUID = 0;
}
public final boolean apply() {
return this.apply$mcZ$sp();
}
public boolean apply$mcZ$sp() {
boolean bl;
if (this.$outer.isEnabled()) {
if ((double)this.res$1.size() > this.$outer.maxObjectSize()) {
this.$outer.logger().warn(new scala.collection.mutable.StringBuilder().append((Object)"Ignoring cache write as Object size is greater than Max Object size in cache setting. Key [").append(this.res$1.key().getOrElse((Function0)new scala.Serializable(this){
public static final long serialVersionUID;
public static {
long l = com.adobe.forms.cache.ResourceCache$$anonfun$put$1$$anonfun$apply$mcZ$sp$1.serialVersionUID = 0;
}
public final String apply() {
return "";
}
})).append((Object)"] and Size [").append((Object)BoxesRunTime.boxToLong((long)this.res$1.size())).append((Object)"]").toString());
bl = false;
} else if (this.res$1.isCacheable()) {
String string;
scala.Some some;
String x;
Option<String> option = this.res$1.key();
if (option instanceof scala.Some && this.gd1$1(x = (string = (String)(some = (scala.Some)option).x()))) {
this.$outer._store().put(x, this.res$1);
bl = true;
} else {
this.$outer.logger().debug("Ignoring cache write as Object key is not specified.");
bl = false;
}
} else {
this.$outer.logger().warn("Ignoring cache write as Object is not cache-able. Please check previous logs for further information.");
bl = false;
}
} else {
bl = false;
}
return bl;
}
private final boolean gd1$1(String string) {
return !string.isEmpty();
}
}));
}
public static Option get(ResourceCache $this, Option resKey$1) {
return (Option)PerfLogger$.MODULE$.measure((Function0<Object>)new scala.Serializable($this){
public static final long serialVersionUID;
public static {
long l = ResourceCache..anonfun.get.serialVersionUID = 0;
}
public final String apply() {
return "ResourceCache.get";
}
}, new scala.Serializable($this, resKey$1){
public static final long serialVersionUID;
private final ResourceCache $outer;
private final Option resKey$1;
public static {
long l = ResourceCache..anonfun.get.serialVersionUID = 0;
}
public final Option<Cacheable> apply() {
String string;
scala.Some some;
Object object;
String x;
Option<Object> option;
Option option2;
scala.Some some2;
None. v0 = this.$outer.isEnabled() ? ((option2 = this.resKey$1) instanceof scala.Some && this.gd2$1(x = (string = (String)(some = (scala.Some)option2).x())) ? ((option = this.$outer._store().get(x)) instanceof scala.Some && (object = (some2 = (scala.Some)option).x()) instanceof Cacheable ? new scala.Some((Object)((Cacheable)object)) : None..MODULE$) : None..MODULE$) : None..MODULE$;
return v0;
}
private final boolean gd2$1(String string) {
return !string.isEmpty();
}
});
}
public static Option get(ResourceCache $this, Cacheable res) {
return $this.get(res.key());
}
private static Object unity(ResourceCache $this, Object a) {
return a;
}
public static Cacheable getOrElseUpdate(ResourceCache $this, Cacheable res$2, Function1 cacheGenerator$1, Option key$1) {
return (Cacheable)PerfLogger$.MODULE$.measure((Function0<Object>)new scala.Serializable($this){
public static final long serialVersionUID;
public static {
long l = ResourceCache..anonfun.getOrElseUpdate.serialVersionUID = 0;
}
public final String apply() {
return "ResourceCache.getOrElseUpdate";
}
}, new scala.Serializable($this, res$2, cacheGenerator$1, key$1){
public static final long serialVersionUID;
private final ResourceCache $outer;
private final Cacheable res$2;
private final Function1 cacheGenerator$1;
private final Option key$1;
public static {
long l = ResourceCache..anonfun.getOrElseUpdate.serialVersionUID = 0;
}
public final U apply() {
Cacheable cacheable;
Cacheable x;
Cacheable cacheable2;
Cacheable cacheable3;
scala.Some some;
Option option = this.key$1;
Option<Cacheable> lastCached = option instanceof scala.Some ? this.$outer.get(this.key$1) : this.$outer.get(this.res$2);
Option<Cacheable> option2 = lastCached;
if (option2 instanceof scala.Some && (cacheable = (Cacheable)(some = (scala.Some)option2).x()) instanceof Cacheable && this.gd3$1(x = (cacheable2 = cacheable))) {
cacheable3 = x;
} else {
Cacheable it = (Cacheable)this.cacheGenerator$1.apply((Object)this.res$2);
this.$outer.put(it);
cacheable3 = it;
}
return (U)cacheable3;
}
private final boolean gd3$1(Cacheable cacheable) {
return !cacheable.isExpired((Option<Cacheable>)new scala.Some((Object)this.res$2));
}
});
}
public static Option getOrElseUpdate$default$3(ResourceCache $this) {
return None..MODULE$;
}
public static Set keySet(ResourceCache $this) {
return $this._store().keySet();
}
public static void clearAll(ResourceCache $this) {
PerfLogger$.MODULE$.measure((Function0<Object>)new scala.Serializable($this){
public static final long serialVersionUID;
public static {
long l = ResourceCache..anonfun.clearAll.serialVersionUID = 0;
}
public final String apply() {
return "ResourceCache.clearAll";
}
}, new scala.Serializable($this){
public static final long serialVersionUID;
private final ResourceCache $outer;
public static {
long l = ResourceCache..anonfun.clearAll.serialVersionUID = 0;
}
public final void apply() {
this.apply$mcV$sp();
}
public void apply$mcV$sp() {
this.$outer._store().clearAll();
}
});
}
public static void $init$(ResourceCache $this) {
$this.logger_$eq(LoggerFactory.getLogger($this.getClass()));
}
}