Class NativeSubprocessTransportFactory

java.lang.Object
com.codename1.bluetooth.helper.NativeSubprocessTransportFactory
All Implemented Interfaces:
HelperTransportFactory

public abstract class NativeSubprocessTransportFactory extends Object implements HelperTransportFactory

Builds NativeSubprocessTransports for a native port. Resolving the helper binary on the native ports is deliberately simpler than the JavaSE classpath-extraction path: there is no runtime jar to extract from, so the helper is located by

  1. the cn1.bluetooth.helperPath system property (an explicit path), or
  2. the bare executable name, spawned through the OS PATH search (posix_spawnp on Linux, CreateProcess PATH lookup on Windows), so a helper bundled next to the app or installed on the PATH is found without extra plumbing.

The subclass supplies the actual transport (which carries the port's native proc* bridge) via createTransport(List).

  • Field Details

    • HELPER_PATH_PROPERTY

      public static final String HELPER_PATH_PROPERTY
      The system property that overrides the helper location. Kept in sync with the JavaSE resolver's property name.
      See Also:
  • Constructor Details

    • NativeSubprocessTransportFactory

      public NativeSubprocessTransportFactory()
  • Method Details

    • create

      public HelperTransport create()
      Description copied from interface: HelperTransportFactory
      A new, un-started transport for one helper launch.
      Specified by:
      create in interface HelperTransportFactory
    • createTransport

      protected abstract NativeSubprocessTransport createTransport(List<String> command)
      Creates the port-specific transport bound to the given launch command (helper path + args). Implemented per port over its native proc* bridge.
    • executableName

      protected abstract String executableName(String basename)
      The executable name on this OS -- Windows appends .exe.