Interface IMobileDeviceManagerDelegate<T extends IMobileDevice>

  • Type Parameters:
    T - the mobile device implementation, that is specific for the mobile OS

    public interface IMobileDeviceManagerDelegate<T extends IMobileDevice>
    Describes a specific type of mobile device manager delegate. Supported mobile device manager delegates are defined by extensions. Mobile device manager delegate extension is defined in plugin.xml.

    Following is an example definition of an 1C:Enterprise Runtime extension:

     <extension point="com._1c.g5.v8.dt.platform.services.mobile.mobileDeviceManagerDelegates">
       <delegate
          delegate="com.example.SomeOsDeviceManagerDelegate"
          mobileOs="com._1c.g5.v8.dt.platform.services.mobile.mobileOs.SomeOs">
       </delegate>
     </extension>
     

    Defined mobile device manager delegates will be used for appropriate mobile OS existing devices lookup and launch. Also can be used to open underlying device manager.

    This interface is intended to be implemented and registered by clients. Instances are not intended to be explicitly used by client. Clients may use IMobileDeviceManager instead.

    See Also:
    IMobileDevice
    • Method Detail

      • isEnabled

        boolean isEnabled()
        Returns whether this device manager is now enable to work.

        Implementation is intended to check, whether all internal settings is set (mobile OS SDK path or manager path for example - depends on target mobile OS requirements).

        Returns:
        whether this device manager is now enable to work
      • openDeviceManager

        Optional<Process> openDeviceManager()
                                     throws MobileDeviceException
        Open the device manager.

        Implementation is intended to open to the user underlying mobile OS device manager to perform device managing actions, e.g. device adding.

        Returns:
        an optional started device manager process if possible
        Throws:
        MobileDeviceException - if an error occurred during device manager open
      • getDevices

        Collection<T> getDevices()
                          throws MobileDeviceException
        Get existing mobile devices.

        Implementation is intended to obtain all existing devices from the underlying mobile OS device manager and convert them to the specific IMobileDevice implementation, that can be later launched with the launchDevice(IMobileDevice, IProgressMonitor) method.

        Returns:
        existing mobile devices, never null, can be empty
        Throws:
        MobileDeviceException - if an error occurred during mobile devices access
      • launchDevice

        boolean launchDevice​(T device,
                             org.eclipse.core.runtime.IProgressMonitor monitor)
                      throws MobileDeviceException
        Launch the given mobile device. Launching is intended to be synchronous: implementation need to wait until mobile device start operation finishes. Returns whether device was successfully launched.

        Implementation also is intended to check the device state: if device is already started, then do nothing and return true.

        Note that long running launch operations can be cancelled by the manager client, and implementation is intended to check cancellation status of the provided progress monitor.

        Parameters:
        device - the mobile device to launch, will be one of existing devices, returned by the manager, cannot be null
        monitor - the progress monitor to report progress to and check cSancellation status, cannot be null
        Returns:
        whether the device was successfully launched
        Throws:
        MobileDeviceException - if an error occurred during mobile device access
      • dispose

        void dispose()
        Dispose this mobile device manager delegate. Delegate implementation need to cleanup any resources that it maintains.

        Method is called on DT IDE shutdown.