Specifications
Returns true if it can be assumed that the file has arrived according
to the heuristic describe above; otherwise returns false. The stability
period is specified in seconds (as a floating point number).
hasArrived( fileName :
String, stabilitySeconds
: Number ) : Boolean
[static]
The length of the required stability period depends on the nature and
size of the file, on the process writing the file, and on the performance
hasArrived(
stabilitySeconds :
Number ) : Boolean
and workload of the computer system(s) involved. In most cases a
stability period of 1 second is both sufficient and acceptable (in terms
toNativeSeparators(
fileName : String ) :
String
of delay). When the file is produced by a slow process or transferred
across a slow network, a much longer stability period may be required.
Returns fileName with the '/' separators converted to separators that
are appropriate for the underlying operating system.
fromNativeSeparators(
fileName : String ) :
String
Returns fileName using '/' as file separator.
Note:
A hasArrived() function often returns only after a delay of at least the
stability period. However if it can be determined right away that the
file has not yet arrived, the function returns immediately. Thus it is
never acceptable to invoke a hasArrived() function in a tight loop.
The following table describes the two most important use cases for
dealing with an external application through the hasArrived()
functions. In fact, the guidance presented in the table does not depend
on the employed arrival/ready detection mechanism.
ImplementationDescriptionModel
jobArrived entry point
contains a waiting loop
If the external process is
synchronous,
Synchronous
that repeatedly callsresource-intensive and
hasArrived() followed byhosted on the same
Environment.sleep() tocomputer as Switch, the
introduce additional
delay
jobArrived entry point
should block until the
process is finished (so
that Switch can correctly
manage the number of
external processes
running in parallel)
timerFired entry point
simply calls hasArrived()
If the external process is
asynchronous (i.e. you
Asynchronous
once, since it iswant to feed it the next
automatically executedjob even if the previous
repeatedly with a
predefined interval
job hasn't been
processed), if it depends
on user interaction, or if
it potentially takes a long
time without using a lot
of resources on the local
computer, the jobArrived
entry point should return
414
Enfocus Switch 10










