Class Platform


  • public class Platform
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Platform()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.concurrent.Executor autoSelectExecutor()
      Auto selects the Executor based on the underlying platform.
      static ITransport autoSelectTransport​(java.lang.String webSocketURL)
      Automatically returns a WebSocket based transport for WAMP based on the underlying platform.
      static int getAndroidAPIVersion()
      Checks if the underlying platform is Android and if the API level is greater than equal to the requested value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Platform

        public Platform()
    • Method Detail

      • getAndroidAPIVersion

        public static int getAndroidAPIVersion()
        Checks if the underlying platform is Android and if the API level is greater than equal to the requested value. Returns 0 if the platform is not Android.
      • autoSelectTransport

        public static ITransport autoSelectTransport​(java.lang.String webSocketURL)
                                              throws java.lang.RuntimeException
        Automatically returns a WebSocket based transport for WAMP based on the underlying platform.
        Parameters:
        webSocketURL - websocket url to use for initializing of the transport
        Returns:
        an instance of ITransport suitable for the underlying platform.
        Throws:
        java.lang.RuntimeException - most probably if the path of transport we are trying to initialize changed OR its constructor changed.
      • autoSelectExecutor

        public static java.util.concurrent.Executor autoSelectExecutor()
        Auto selects the Executor based on the underlying platform. On Android we want autobahn to call the user facing code's callbacks on the main thread so that apps are able to update the UI.
        Returns:
        Executor instance suitable for current platform