public class SystemUpgrader extends Object
HostControlSystem
instances from FileSystem
and
ExecutionSystem
instances.
Converting one system to another does not affect the original system. The new
system is an always-open view of the original system. Calling close()
has no effect and closing the source system closes all views.
Where possible, the new view minimizes resource duplication, reusing connections or other state that is safely shared.
Not all file systems and execution systems can be upgraded to
HostControlSystem
s. If a conversion is not possible, methods in this
class throw UnsupportedOperationException
. Upgrading the default
systems of either type is always supported. See provider-specific
documentation for details about the compatibility of other system
implementations.
HostControlSystemUpgradeable
Modifier and Type | Method and Description |
---|---|
static boolean |
isUpgradeable(ExecutionSystem es)
Returns
true if the given execution system can be upgraded to a
host control system. |
static boolean |
isUpgradeable(FileSystem fs)
Returns
true if the given file system can be upgrade to a host
control system. |
static HostControlSystem |
upgrade(ExecutionSystem es)
Returns an open
HostControlSystem that accesses the same
resources as the given execution system. |
static HostControlSystem |
upgrade(FileSystem fs)
Returns an open
HostControlSystem that accesses the same
resources as the given file system. |
public static HostControlSystem upgrade(ExecutionSystem es) throws IOException
HostControlSystem
that accesses the same
resources as the given execution system. The execution system is not
modified.
The new system can read and modify the same files that are accessible to commands executed by the execution system. Changes made by one system are visible to the other, given certain system-dependent conditions are true. In particular, no guarantees are made for concurrent modification or modifications from different threads.
es
- the execution systemHostControlSystem
IOException
- if an I/O error occurs while creating the systemUnsupportedOperationException
- if the execution system does not
support upgradespublic static HostControlSystem upgrade(FileSystem fs) throws IOException
HostControlSystem
that accesses the same
resources as the given file system. The file system is not modified.
Commands executed by the new system can read and modify the same files that are accessible by the file system. Changes made by one system are visible to the other, given certain system-dependent conditions are true. In particular, no guarantees are made for concurrent modification or modifications from different threads.
fs
- the file systemHostControlSystem
IOException
- if an I/O error occurs while creating the systemUnsupportedOperationException
- if the file system does not support
upgradespublic static boolean isUpgradeable(FileSystem fs)
true
if the given file system can be upgrade to a host
control system.public static boolean isUpgradeable(ExecutionSystem es)
true
if the given execution system can be upgraded to a
host control system.