-
Notifications
You must be signed in to change notification settings - Fork 0
/
IWatchService.xml
293 lines (292 loc) · 20 KB
/
IWatchService.xml
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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
<Type Name="IWatchService" FullName="Java.Nio.FileNio.IWatchService">
<TypeSignature Language="C#" Value="public interface IWatchService : IDisposable, Java.Interop.IJavaPeerable, Java.IO.ICloseable" />
<TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract beforefieldinit IWatchService implements class Android.Runtime.IJavaObject, class Java.Interop.IJavaPeerable, class Java.IO.ICloseable, class System.IDisposable" />
<TypeSignature Language="DocId" Value="T:Java.Nio.FileNio.IWatchService" />
<TypeSignature Language="F#" Value="type IWatchService = interface
 interface ICloseable
 interface IJavaObject
 interface IDisposable
 interface IJavaPeerable" />
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Interfaces>
<Interface>
<InterfaceName>Android.Runtime.IJavaObject</InterfaceName>
</Interface>
<Interface>
<InterfaceName>Java.Interop.IJavaPeerable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>Java.IO.ICloseable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("java/nio/file/WatchService", "", "Java.Nio.FileNio.IWatchServiceInvoker", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("java/nio/file/WatchService", "", "Java.Nio.FileNio.IWatchServiceInvoker", ApiSince=26)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>A watch service that <em>watches</em> registered objects for changes and
events.</summary>
<remarks>
<para>A watch service that <em>watches</em> registered objects for changes and
events. For example a file manager may use a watch service to monitor a
directory for changes so that it can update its display of the list of files
when files are created or deleted.</para>
<para>A <c>Watchable</c> object is registered with a watch service by invoking
its <c>Watchable#register register</c> method, returning a <c>WatchKey</c>
to represent the registration. When an event for an object is detected the
key is <em>signalled</em>, and if not currently signalled, it is queued to
the watch service so that it can be retrieved by consumers that invoke the
<c>#poll() poll</c> or <c>#take() take</c> methods to retrieve keys
and process events. Once the events have been processed the consumer
invokes the key's <c>WatchKey#reset reset</c> method to reset the key which
allows the key to be signalled and re-queued with further events.</para>
<para>Registration with a watch service is cancelled by invoking the key's
<c>WatchKey#cancel cancel</c> method. A key that is queued at the time that
it is cancelled remains in the queue until it is retrieved. Depending on the
object, a key may be cancelled automatically. For example, suppose a
directory is watched and the watch service detects that it has been deleted
or its file system is no longer accessible. When a key is cancelled in this
manner it is signalled and queued, if not currently signalled. To ensure
that the consumer is notified the return value from the <c>reset</c>
method indicates if the key is valid.</para>
<para>A watch service is safe for use by multiple concurrent consumers. To
ensure that only one consumer processes the events for a particular object at
any time then care should be taken to ensure that the key's <c>reset</c>
method is only invoked after its events have been processed. The <c>#close close</c> method may be invoked at any time to close the service causing
any threads waiting to retrieve keys, to throw <c>ClosedWatchServiceException</c>.</para>
<para>File systems may report events faster than they can be retrieved or
processed and an implementation may impose an unspecified limit on the number
of events that it may accumulate. Where an implementation <em>knowingly</em>
discards events then it arranges for the key's <c>WatchKey#pollEvents
pollEvents</c> method to return an element with an event type of <c>StandardWatchEventKinds#OVERFLOW OVERFLOW</c>. This event can be used by the
consumer as a trigger to re-examine the state of the object.</para>
<para>When an event is reported to indicate that a file in a watched directory
has been modified then there is no guarantee that the program (or programs)
that have modified the file have completed. Care should be taken to coordinate
access with other programs that may be updating the file.
The <c>java.nio.channels.FileChannel FileChannel</c> class defines methods
to lock regions of a file against access by other programs.
<h2>Platform dependencies</h2></para>
<para>The implementation that observes events from the file system is intended
to map directly on to the native file event notification facility where
available, or to use a primitive mechanism, such as polling, when a native
facility is not available. Consequently, many of the details on how events
are detected, their timeliness, and whether their ordering is preserved are
highly implementation specific. For example, when a file in a watched
directory is modified then it may result in a single <c>StandardWatchEventKinds#ENTRY_MODIFY ENTRY_MODIFY</c> event in some
implementations but several events in other implementations. Short-lived
files (meaning files that are deleted very quickly after they are created)
may not be detected by primitive implementations that periodically poll the
file system to detect changes.</para>
<para>If a watched file is not located on a local storage device then it is
implementation specific if changes to the file can be detected. In particular,
it is not required that changes to files carried out on remote systems be
detected.</para>
<para>Added in 1.7.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/nio/file/WatchService" title="Reference documentation">Java documentation for <code>java.nio.file.WatchService</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
<Members>
<Member MemberName="Close">
<MemberSignature Language="C#" Value="public void Close ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Close() cil managed" />
<MemberSignature Language="DocId" Value="M:Java.Nio.FileNio.IWatchService.Close" />
<MemberSignature Language="F#" Value="abstract member Close : unit -> unit" Usage="iWatchService.Close " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:Java.IO.ICloseable.Close</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("close", "()V", "GetCloseHandler:Java.Nio.FileNio.IWatchServiceInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("close", "()V", "GetCloseHandler:Java.Nio.FileNio.IWatchServiceInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Runtime.Versioning.SupportedOSPlatform("android26.0")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.Versioning.SupportedOSPlatform("android26.0")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Closes this watch service.</summary>
<remarks>
<para>Closes this watch service.</para>
<para>If a thread is currently blocked in the <c>#take take</c> or <c>#poll(long,TimeUnit) poll</c> methods waiting for a key to be queued then
it immediately receives a <c>ClosedWatchServiceException</c>. Any
valid keys associated with this watch service are <c>WatchKey#isValid
invalidated</c>.</para>
<para>After a watch service is closed, any further attempt to invoke
operations upon it will throw <c>ClosedWatchServiceException</c>.
If this watch service is already closed then invoking this method
has no effect.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/nio/file/WatchService#close()" title="Reference documentation">Java documentation for <code>java.nio.file.WatchService.close()</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
</Member>
<Member MemberName="Poll">
<MemberSignature Language="C#" Value="public Java.Nio.FileNio.IWatchKey? Poll ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Java.Nio.FileNio.IWatchKey Poll() cil managed" />
<MemberSignature Language="DocId" Value="M:Java.Nio.FileNio.IWatchService.Poll" />
<MemberSignature Language="F#" Value="abstract member Poll : unit -> Java.Nio.FileNio.IWatchKey" Usage="iWatchService.Poll " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("poll", "()Ljava/nio/file/WatchKey;", "GetPollHandler:Java.Nio.FileNio.IWatchServiceInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("poll", "()Ljava/nio/file/WatchKey;", "GetPollHandler:Java.Nio.FileNio.IWatchServiceInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Runtime.Versioning.SupportedOSPlatform("android26.0")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.Versioning.SupportedOSPlatform("android26.0")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>Java.Nio.FileNio.IWatchKey</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Retrieves and removes the next watch key, or <c>null</c> if none are
present.</summary>
<returns>the next watch key, or <c>null</c></returns>
<remarks>
<para>Retrieves and removes the next watch key, or <c>null</c> if none are
present.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/nio/file/WatchService#poll()" title="Reference documentation">Java documentation for <code>java.nio.file.WatchService.poll()</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
</Member>
<Member MemberName="Poll">
<MemberSignature Language="C#" Value="public Java.Nio.FileNio.IWatchKey? Poll (long timeout, Java.Util.Concurrent.TimeUnit? unit);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Java.Nio.FileNio.IWatchKey Poll(int64 timeout, class Java.Util.Concurrent.TimeUnit unit) cil managed" />
<MemberSignature Language="DocId" Value="M:Java.Nio.FileNio.IWatchService.Poll(System.Int64,Java.Util.Concurrent.TimeUnit)" />
<MemberSignature Language="F#" Value="abstract member Poll : int64 * Java.Util.Concurrent.TimeUnit -> Java.Nio.FileNio.IWatchKey" Usage="iWatchService.Poll (timeout, unit)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("poll", "(JLjava/util/concurrent/TimeUnit;)Ljava/nio/file/WatchKey;", "GetPoll_JLjava_util_concurrent_TimeUnit_Handler:Java.Nio.FileNio.IWatchServiceInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("poll", "(JLjava/util/concurrent/TimeUnit;)Ljava/nio/file/WatchKey;", "GetPoll_JLjava_util_concurrent_TimeUnit_Handler:Java.Nio.FileNio.IWatchServiceInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Runtime.Versioning.SupportedOSPlatform("android26.0")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.Versioning.SupportedOSPlatform("android26.0")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>Java.Nio.FileNio.IWatchKey</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="timeout" Type="System.Int64" />
<Parameter Name="unit" Type="Java.Util.Concurrent.TimeUnit" />
</Parameters>
<Docs>
<param name="timeout">how to wait before giving up, in units of unit</param>
<param name="unit">a <c>TimeUnit</c> determining how to interpret the timeout
parameter</param>
<summary>Retrieves and removes the next watch key, waiting if necessary up to the
specified wait time if none are yet present.</summary>
<returns>the next watch key, or <c>null</c></returns>
<remarks>
<para>Retrieves and removes the next watch key, waiting if necessary up to the
specified wait time if none are yet present.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/nio/file/WatchService#poll(long,%20java.util.concurrent.TimeUnit)" title="Reference documentation">Java documentation for <code>java.nio.file.WatchService.poll(long, java.util.concurrent.TimeUnit)</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
</Member>
<Member MemberName="Take">
<MemberSignature Language="C#" Value="public Java.Nio.FileNio.IWatchKey? Take ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Java.Nio.FileNio.IWatchKey Take() cil managed" />
<MemberSignature Language="DocId" Value="M:Java.Nio.FileNio.IWatchService.Take" />
<MemberSignature Language="F#" Value="abstract member Take : unit -> Java.Nio.FileNio.IWatchKey" Usage="iWatchService.Take " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("take", "()Ljava/nio/file/WatchKey;", "GetTakeHandler:Java.Nio.FileNio.IWatchServiceInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("take", "()Ljava/nio/file/WatchKey;", "GetTakeHandler:Java.Nio.FileNio.IWatchServiceInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Runtime.Versioning.SupportedOSPlatform("android26.0")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.Versioning.SupportedOSPlatform("android26.0")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>Java.Nio.FileNio.IWatchKey</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Retrieves and removes next watch key, waiting if none are yet present.</summary>
<returns>the next watch key</returns>
<remarks>
<para>Retrieves and removes next watch key, waiting if none are yet present.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/nio/file/WatchService#take()" title="Reference documentation">Java documentation for <code>java.nio.file.WatchService.take()</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
</Member>
</Members>
</Type>