Class NativePlatformFactory


  • public abstract class NativePlatformFactory
    extends java.lang.Object
    Abstract factory class to instantiate a NativePlatform
    • Constructor Detail

      • NativePlatformFactory

        public NativePlatformFactory()
    • Method Detail

      • matches

        protected abstract boolean matches()
        Checks whether this NativePlatformFactory can work with the platform on which we are running
        Returns:
        true if we can run on this platform.
      • createNativePlatform

        protected abstract NativePlatform createNativePlatform()
        Creates a NativePlatform. This is only called if matches() was previously called and returned true.
        Returns:
        a new NativePlatform.
      • getMajorVersion

        protected abstract int getMajorVersion()
        Queries the major version number supported by this NativePlatformFactory.
        Returns:
        the major version supported
      • getMinorVersion

        protected abstract int getMinorVersion()
        Queries the minor version number supported by this NativePlatformFactory.
        Returns:
        the minor version supported
      • getNativePlatform

        public static NativePlatform getNativePlatform()
        Obtains a NativePlatform that matches the platform on which we are running. The system property monocle.platform defines a series of cascading fallbacks for what NativePlatform types to attempt to create. monocle .platform can be overridden to select a specific platform. For example, running with -Dmonocle.platform=Dispman, Linux selects the NativePlatform that works with the dispmanx libraries on the Raspberry Pi, but falls back to a generic software-rendered Linux framebuffer implementation if we are not running on a device with dispmanx libraries.
        Returns:
        a new NativePlatform