class org.xnio.PollingFileSystemWatcher implements org.xnio.FileSystemWatcher, java.lang.Runnable
minor version: 0
major version: 59
flags: flags: (0x0020) ACC_SUPER
this_class: org.xnio.PollingFileSystemWatcher
super_class: java.lang.Object
{
private static final java.util.concurrent.atomic.AtomicInteger threadIdCounter;
descriptor: Ljava/util/concurrent/atomic/AtomicInteger;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
public static final java.lang.String THREAD_NAME;
descriptor: Ljava/lang/String;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
ConstantValue: "xnio-polling-file-watcher"
private final java.util.Map<java.io.File, org.xnio.PollingFileSystemWatcher$PollHolder> files;
descriptor: Ljava/util/Map;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
Signature: Ljava/util/Map<Ljava/io/File;Lorg/xnio/PollingFileSystemWatcher$PollHolder;>;
private final java.lang.Thread watchThread;
descriptor: Ljava/lang/Thread;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final int pollInterval;
descriptor: I
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private volatile boolean stopped;
descriptor: Z
flags: (0x0042) ACC_PRIVATE, ACC_VOLATILE
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=3, locals=0, args_size=0
0: new java.util.concurrent.atomic.AtomicInteger
dup
iconst_0
invokespecial java.util.concurrent.atomic.AtomicInteger.<init>:(I)V
putstatic org.xnio.PollingFileSystemWatcher.threadIdCounter:Ljava/util/concurrent/atomic/AtomicInteger;
1: return
LocalVariableTable:
Start End Slot Name Signature
void <init>(java.lang.String, int, boolean);
descriptor: (Ljava/lang/String;IZ)V
flags: (0x0000)
Code:
stack=7, locals=4, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
new java.util.HashMap
dup
invokespecial java.util.HashMap.<init>:()V
invokestatic java.util.Collections.synchronizedMap:(Ljava/util/Map;)Ljava/util/Map;
putfield org.xnio.PollingFileSystemWatcher.files:Ljava/util/Map;
2: aload 0
iconst_0
putfield org.xnio.PollingFileSystemWatcher.stopped:Z
3: aload 0
new java.lang.Thread
dup
aload 0
new java.lang.StringBuilder
dup
ldc "xnio-polling-file-watcher["
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 1
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
ldc "]-"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
getstatic org.xnio.PollingFileSystemWatcher.threadIdCounter:Ljava/util/concurrent/atomic/AtomicInteger;
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial java.lang.Thread.<init>:(Ljava/lang/Runnable;Ljava/lang/String;)V
putfield org.xnio.PollingFileSystemWatcher.watchThread:Ljava/lang/Thread;
4: aload 0
getfield org.xnio.PollingFileSystemWatcher.watchThread:Ljava/lang/Thread;
iload 3
invokevirtual java.lang.Thread.setDaemon:(Z)V
5: aload 0
getfield org.xnio.PollingFileSystemWatcher.watchThread:Ljava/lang/Thread;
invokevirtual java.lang.Thread.start:()V
6: aload 0
iload 2
putfield org.xnio.PollingFileSystemWatcher.pollInterval:I
7: return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 8 0 this Lorg/xnio/PollingFileSystemWatcher;
0 8 1 name Ljava/lang/String;
0 8 2 pollInterval I
0 8 3 daemon Z
MethodParameters:
Name Flags
name final
pollInterval
daemon final
public void run();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: goto 5
1: StackMap locals:
StackMap stack:
aload 0
invokevirtual org.xnio.PollingFileSystemWatcher.doNotify:()V
2: aload 0
getfield org.xnio.PollingFileSystemWatcher.pollInterval:I
i2l
invokestatic java.lang.Thread.sleep:(J)V
3: goto 5
StackMap locals:
StackMap stack: java.lang.InterruptedException
4: pop
5: StackMap locals:
StackMap stack:
aload 0
getfield org.xnio.PollingFileSystemWatcher.stopped:Z
ifeq 1
6: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 this Lorg/xnio/PollingFileSystemWatcher;
Exception table:
from to target type
1 3 4 Class java.lang.InterruptedException
private void doNotify();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=3, locals=7, args_size=1
start local 0 0: aload 0
getfield org.xnio.PollingFileSystemWatcher.files:Ljava/util/Map;
invokeinterface java.util.Map.entrySet:()Ljava/util/Set;
invokeinterface java.util.Set.iterator:()Ljava/util/Iterator;
astore 2
goto 10
StackMap locals: org.xnio.PollingFileSystemWatcher top java.util.Iterator
StackMap stack:
1: aload 2
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast java.util.Map$Entry
astore 1
start local 1 2: aload 1
invokeinterface java.util.Map$Entry.getKey:()Ljava/lang/Object;
checkcast java.io.File
invokestatic org.xnio.PollingFileSystemWatcher.doScan:(Ljava/io/File;)Ljava/util/Map;
astore 3
start local 3 3: aload 0
aload 3
aload 1
invokeinterface java.util.Map$Entry.getValue:()Ljava/lang/Object;
checkcast org.xnio.PollingFileSystemWatcher$PollHolder
getfield org.xnio.PollingFileSystemWatcher$PollHolder.currentFileState:Ljava/util/Map;
invokevirtual org.xnio.PollingFileSystemWatcher.doDiff:(Ljava/util/Map;Ljava/util/Map;)Ljava/util/List;
astore 4
start local 4 4: aload 4
invokeinterface java.util.List.isEmpty:()Z
ifne 10
5: aload 1
invokeinterface java.util.Map$Entry.getValue:()Ljava/lang/Object;
checkcast org.xnio.PollingFileSystemWatcher$PollHolder
aload 3
putfield org.xnio.PollingFileSystemWatcher$PollHolder.currentFileState:Ljava/util/Map;
6: aload 1
invokeinterface java.util.Map$Entry.getValue:()Ljava/lang/Object;
checkcast org.xnio.PollingFileSystemWatcher$PollHolder
getfield org.xnio.PollingFileSystemWatcher$PollHolder.callbacks:Ljava/util/List;
invokeinterface java.util.List.iterator:()Ljava/util/Iterator;
astore 6
goto 9
StackMap locals: org.xnio.PollingFileSystemWatcher java.util.Map$Entry java.util.Iterator java.util.Map java.util.List top java.util.Iterator
StackMap stack:
7: aload 6
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast org.xnio.FileChangeCallback
astore 5
start local 5 8: aload 5
aload 4
invokestatic org.xnio.PollingFileSystemWatcher.invokeCallback:(Lorg/xnio/FileChangeCallback;Ljava/util/List;)V
end local 5 9: StackMap locals:
StackMap stack:
aload 6
invokeinterface java.util.Iterator.hasNext:()Z
ifne 7
end local 4 end local 3 end local 1 10: StackMap locals: org.xnio.PollingFileSystemWatcher top java.util.Iterator
StackMap stack:
aload 2
invokeinterface java.util.Iterator.hasNext:()Z
ifne 1
11: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 12 0 this Lorg/xnio/PollingFileSystemWatcher;
2 10 1 entry Ljava/util/Map$Entry<Ljava/io/File;Lorg/xnio/PollingFileSystemWatcher$PollHolder;>;
3 10 3 result Ljava/util/Map<Ljava/io/File;Ljava/lang/Long;>;
4 10 4 currentDiff Ljava/util/List<Lorg/xnio/FileChangeEvent;>;
8 9 5 callback Lorg/xnio/FileChangeCallback;
private java.util.List<org.xnio.FileChangeEvent> doDiff(java.util.Map<java.io.File, java.lang.Long>, java.util.Map<java.io.File, java.lang.Long>);
descriptor: (Ljava/util/Map;Ljava/util/Map;)Ljava/util/List;
flags: (0x0002) ACC_PRIVATE
Code:
stack=5, locals=8, args_size=3
start local 0 start local 1 start local 2 0: new java.util.ArrayList
dup
invokespecial java.util.ArrayList.<init>:()V
astore 3
start local 3 1: new java.util.HashMap
dup
aload 2
invokespecial java.util.HashMap.<init>:(Ljava/util/Map;)V
astore 4
start local 4 2: aload 1
invokeinterface java.util.Map.entrySet:()Ljava/util/Set;
invokeinterface java.util.Set.iterator:()Ljava/util/Iterator;
astore 6
goto 10
StackMap locals: org.xnio.PollingFileSystemWatcher java.util.Map java.util.Map java.util.List java.util.Map top java.util.Iterator
StackMap stack:
3: aload 6
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast java.util.Map$Entry
astore 5
start local 5 4: aload 4
aload 5
invokeinterface java.util.Map$Entry.getKey:()Ljava/lang/Object;
invokeinterface java.util.Map.remove:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast java.lang.Long
astore 7
start local 7 5: aload 7
ifnonnull 8
6: aload 3
new org.xnio.FileChangeEvent
dup
aload 5
invokeinterface java.util.Map$Entry.getKey:()Ljava/lang/Object;
checkcast java.io.File
getstatic org.xnio.FileChangeEvent$Type.ADDED:Lorg/xnio/FileChangeEvent$Type;
invokespecial org.xnio.FileChangeEvent.<init>:(Ljava/io/File;Lorg/xnio/FileChangeEvent$Type;)V
invokeinterface java.util.List.add:(Ljava/lang/Object;)Z
pop
7: goto 10
8: StackMap locals: org.xnio.PollingFileSystemWatcher java.util.Map java.util.Map java.util.List java.util.Map java.util.Map$Entry java.util.Iterator java.lang.Long
StackMap stack:
aload 7
aload 5
invokeinterface java.util.Map$Entry.getValue:()Ljava/lang/Object;
invokevirtual java.lang.Long.equals:(Ljava/lang/Object;)Z
ifne 10
aload 5
invokeinterface java.util.Map$Entry.getKey:()Ljava/lang/Object;
checkcast java.io.File
invokevirtual java.io.File.isDirectory:()Z
ifne 10
9: aload 3
new org.xnio.FileChangeEvent
dup
aload 5
invokeinterface java.util.Map$Entry.getKey:()Ljava/lang/Object;
checkcast java.io.File
getstatic org.xnio.FileChangeEvent$Type.MODIFIED:Lorg/xnio/FileChangeEvent$Type;
invokespecial org.xnio.FileChangeEvent.<init>:(Ljava/io/File;Lorg/xnio/FileChangeEvent$Type;)V
invokeinterface java.util.List.add:(Ljava/lang/Object;)Z
pop
end local 7 end local 5 10: StackMap locals: org.xnio.PollingFileSystemWatcher java.util.Map java.util.Map java.util.List java.util.Map top java.util.Iterator
StackMap stack:
aload 6
invokeinterface java.util.Iterator.hasNext:()Z
ifne 3
11: aload 4
invokeinterface java.util.Map.entrySet:()Ljava/util/Set;
invokeinterface java.util.Set.iterator:()Ljava/util/Iterator;
astore 6
goto 14
StackMap locals:
StackMap stack:
12: aload 6
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast java.util.Map$Entry
astore 5
start local 5 13: aload 3
new org.xnio.FileChangeEvent
dup
aload 5
invokeinterface java.util.Map$Entry.getKey:()Ljava/lang/Object;
checkcast java.io.File
getstatic org.xnio.FileChangeEvent$Type.REMOVED:Lorg/xnio/FileChangeEvent$Type;
invokespecial org.xnio.FileChangeEvent.<init>:(Ljava/io/File;Lorg/xnio/FileChangeEvent$Type;)V
invokeinterface java.util.List.add:(Ljava/lang/Object;)Z
pop
end local 5 14: StackMap locals:
StackMap stack:
aload 6
invokeinterface java.util.Iterator.hasNext:()Z
ifne 12
15: aload 3
areturn
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 16 0 this Lorg/xnio/PollingFileSystemWatcher;
0 16 1 newFileState Ljava/util/Map<Ljava/io/File;Ljava/lang/Long;>;
0 16 2 currentFileState Ljava/util/Map<Ljava/io/File;Ljava/lang/Long;>;
1 16 3 results Ljava/util/List<Lorg/xnio/FileChangeEvent;>;
2 16 4 currentCopy Ljava/util/Map<Ljava/io/File;Ljava/lang/Long;>;
4 10 5 newEntry Ljava/util/Map$Entry<Ljava/io/File;Ljava/lang/Long;>;
5 10 7 old Ljava/lang/Long;
13 14 5 old Ljava/util/Map$Entry<Ljava/io/File;Ljava/lang/Long;>;
Signature: (Ljava/util/Map<Ljava/io/File;Ljava/lang/Long;>;Ljava/util/Map<Ljava/io/File;Ljava/lang/Long;>;)Ljava/util/List<Lorg/xnio/FileChangeEvent;>;
MethodParameters:
Name Flags
newFileState
currentFileState
public synchronized void watchPath(java.io.File, org.xnio.FileChangeCallback);
descriptor: (Ljava/io/File;Lorg/xnio/FileChangeCallback;)V
flags: (0x0021) ACC_PUBLIC, ACC_SYNCHRONIZED
Code:
stack=6, locals=4, args_size=3
start local 0 start local 1 start local 2 0: aload 0
getfield org.xnio.PollingFileSystemWatcher.files:Ljava/util/Map;
aload 1
invokeinterface java.util.Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast org.xnio.PollingFileSystemWatcher$PollHolder
astore 3
start local 3 1: aload 3
ifnonnull 3
2: aload 0
getfield org.xnio.PollingFileSystemWatcher.files:Ljava/util/Map;
aload 1
new org.xnio.PollingFileSystemWatcher$PollHolder
dup
aload 0
aload 1
invokestatic org.xnio.PollingFileSystemWatcher.doScan:(Ljava/io/File;)Ljava/util/Map;
invokespecial org.xnio.PollingFileSystemWatcher$PollHolder.<init>:(Lorg/xnio/PollingFileSystemWatcher;Ljava/util/Map;)V
dup
astore 3
invokeinterface java.util.Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
pop
3: StackMap locals: org.xnio.PollingFileSystemWatcher$PollHolder
StackMap stack:
aload 3
getfield org.xnio.PollingFileSystemWatcher$PollHolder.callbacks:Ljava/util/List;
aload 2
invokeinterface java.util.List.add:(Ljava/lang/Object;)Z
pop
4: return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Lorg/xnio/PollingFileSystemWatcher;
0 5 1 file Ljava/io/File;
0 5 2 callback Lorg/xnio/FileChangeCallback;
1 5 3 holder Lorg/xnio/PollingFileSystemWatcher$PollHolder;
MethodParameters:
Name Flags
file
callback
public synchronized void unwatchPath(java.io.File, org.xnio.FileChangeCallback);
descriptor: (Ljava/io/File;Lorg/xnio/FileChangeCallback;)V
flags: (0x0021) ACC_PUBLIC, ACC_SYNCHRONIZED
Code:
stack=2, locals=4, args_size=3
start local 0 start local 1 start local 2 0: aload 0
getfield org.xnio.PollingFileSystemWatcher.files:Ljava/util/Map;
aload 1
invokeinterface java.util.Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast org.xnio.PollingFileSystemWatcher$PollHolder
astore 3
start local 3 1: aload 3
ifnull 5
2: aload 3
getfield org.xnio.PollingFileSystemWatcher$PollHolder.callbacks:Ljava/util/List;
aload 2
invokeinterface java.util.List.remove:(Ljava/lang/Object;)Z
pop
3: aload 3
getfield org.xnio.PollingFileSystemWatcher$PollHolder.callbacks:Ljava/util/List;
invokeinterface java.util.List.isEmpty:()Z
ifeq 5
4: aload 0
getfield org.xnio.PollingFileSystemWatcher.files:Ljava/util/Map;
aload 1
invokeinterface java.util.Map.remove:(Ljava/lang/Object;)Ljava/lang/Object;
pop
5: StackMap locals: org.xnio.PollingFileSystemWatcher$PollHolder
StackMap stack:
aload 0
getfield org.xnio.PollingFileSystemWatcher.files:Ljava/util/Map;
aload 1
invokeinterface java.util.Map.remove:(Ljava/lang/Object;)Ljava/lang/Object;
pop
6: return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 this Lorg/xnio/PollingFileSystemWatcher;
0 7 1 file Ljava/io/File;
0 7 2 callback Lorg/xnio/FileChangeCallback;
1 7 3 holder Lorg/xnio/PollingFileSystemWatcher$PollHolder;
MethodParameters:
Name Flags
file
callback final
public void close();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
iconst_1
putfield org.xnio.PollingFileSystemWatcher.stopped:Z
1: aload 0
getfield org.xnio.PollingFileSystemWatcher.watchThread:Ljava/lang/Thread;
invokevirtual java.lang.Thread.interrupt:()V
2: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lorg/xnio/PollingFileSystemWatcher;
Exceptions:
throws java.io.IOException
static java.util.Map<java.io.File, java.lang.Long> doScan(java.io.File);
descriptor: (Ljava/io/File;)Ljava/util/Map;
flags: (0x0008) ACC_STATIC
Code:
stack=4, locals=9, args_size=1
start local 0 0: new java.util.HashMap
dup
invokespecial java.util.HashMap.<init>:()V
astore 1
start local 1 1: new java.util.ArrayDeque
dup
invokespecial java.util.ArrayDeque.<init>:()V
astore 2
start local 2 2: aload 2
aload 0
invokeinterface java.util.Deque.add:(Ljava/lang/Object;)Z
pop
3: goto 16
4: StackMap locals: java.util.Map java.util.Deque
StackMap stack:
aload 2
invokeinterface java.util.Deque.pop:()Ljava/lang/Object;
checkcast java.io.File
astore 3
start local 3 5: aload 3
invokevirtual java.io.File.isDirectory:()Z
ifeq 15
6: aload 1
aload 3
aload 3
invokevirtual java.io.File.lastModified:()J
invokestatic java.lang.Long.valueOf:(J)Ljava/lang/Long;
invokeinterface java.util.Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
pop
7: aload 3
invokevirtual java.io.File.listFiles:()[Ljava/io/File;
astore 4
start local 4 8: aload 4
ifnull 16
9: aload 4
dup
astore 8
arraylength
istore 7
iconst_0
istore 6
goto 13
StackMap locals: java.io.File java.util.Map java.util.Deque java.io.File java.io.File[] top int int java.io.File[]
StackMap stack:
10: aload 8
iload 6
aaload
astore 5
start local 5 11: aload 2
new java.io.File
dup
aload 5
invokevirtual java.io.File.getAbsolutePath:()Ljava/lang/String;
invokespecial java.io.File.<init>:(Ljava/lang/String;)V
invokeinterface java.util.Deque.push:(Ljava/lang/Object;)V
end local 5 12: iinc 6 1
StackMap locals:
StackMap stack:
13: iload 6
iload 7
if_icmplt 10
end local 4 14: goto 16
15: StackMap locals: java.io.File java.util.Map java.util.Deque java.io.File
StackMap stack:
aload 1
aload 3
aload 3
invokevirtual java.io.File.lastModified:()J
invokestatic java.lang.Long.valueOf:(J)Ljava/lang/Long;
invokeinterface java.util.Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
pop
end local 3 16: StackMap locals:
StackMap stack:
aload 2
invokeinterface java.util.Deque.isEmpty:()Z
ifeq 4
17: aload 1
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 18 0 file Ljava/io/File;
1 18 1 results Ljava/util/Map<Ljava/io/File;Ljava/lang/Long;>;
2 18 2 toScan Ljava/util/Deque<Ljava/io/File;>;
5 16 3 next Ljava/io/File;
8 14 4 list [Ljava/io/File;
11 12 5 f Ljava/io/File;
Signature: (Ljava/io/File;)Ljava/util/Map<Ljava/io/File;Ljava/lang/Long;>;
MethodParameters:
Name Flags
file
static void invokeCallback(org.xnio.FileChangeCallback, java.util.List<org.xnio.FileChangeEvent>);
descriptor: (Lorg/xnio/FileChangeCallback;Ljava/util/List;)V
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=3, args_size=2
start local 0 start local 1 0: aload 0
aload 1
invokeinterface org.xnio.FileChangeCallback.handleChanges:(Ljava/util/Collection;)V
1: goto 4
StackMap locals:
StackMap stack: java.lang.Exception
2: astore 2
start local 2 3: getstatic org.xnio._private.Messages.msg:Lorg/xnio/_private/Messages;
aload 2
invokeinterface org.xnio._private.Messages.failedToInvokeFileWatchCallback:(Ljava/lang/Throwable;)V
end local 2 4: StackMap locals:
StackMap stack:
return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 callback Lorg/xnio/FileChangeCallback;
0 5 1 results Ljava/util/List<Lorg/xnio/FileChangeEvent;>;
3 4 2 e Ljava/lang/Exception;
Exception table:
from to target type
0 1 2 Class java.lang.Exception
Signature: (Lorg/xnio/FileChangeCallback;Ljava/util/List<Lorg/xnio/FileChangeEvent;>;)V
MethodParameters:
Name Flags
callback
results
}
SourceFile: "PollingFileSystemWatcher.java"
NestMembers:
org.xnio.PollingFileSystemWatcher$PollHolder
InnerClasses:
public abstract Entry = java.util.Map$Entry of java.util.Map
public final Type = org.xnio.FileChangeEvent$Type of org.xnio.FileChangeEvent
private PollHolder = org.xnio.PollingFileSystemWatcher$PollHolder of org.xnio.PollingFileSystemWatcher