Package io.crossbar.autobahn.wamp.utils
Class Platform
java.lang.Object
io.crossbar.autobahn.wamp.utils.Platform
public class Platform
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description Platform() -
Method Summary
Modifier and Type Method Description static java.util.concurrent.ExecutorautoSelectExecutor()Auto selects the Executor based on the underlying platform.static ITransportautoSelectTransport(java.lang.String webSocketURL)Automatically returns a WebSocket based transport for WAMP based on the underlying platform.static intgetAndroidAPIVersion()Checks if the underlying platform is Android and if the API level is greater than equal to the requested value.
-
Constructor Details
-
Platform
public Platform()
-
-
Method Details
-
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.RuntimeExceptionAutomatically 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
-