com.esri.runtime
Class ArcGISRuntime

java.lang.Object
  extended by com.esri.runtime.ArcGISRuntime

public class ArcGISRuntime
extends Object

This class contains various static methods that can be used to search for runtime binaries associated with the local server and client binaries associated with the general operation of the api. It also has methods for finding the api install location. This can also be set to a different location by the user.


Nested Class Summary
static class ArcGISRuntime.RenderEngine
           
 
Constructor Summary
ArcGISRuntime()
           
 
Method Summary
static String getAppDataDirectory()
          Returns the directory path set using setAppDataDirectory(String).
static String getClientBinaryLocationsSearched()
          Gets the client binary locations searched.
static String getClientLibPath(String libName)
          Gets the path to the given library expected to be in the Client directory rather than the LocalServer directory.
static String getInstallDirectory()
          Gets the current install directory for the runtime.
static float getJavaVersion()
           
protected static byte[] getLicenseBytes()
           
protected static ArrayList<byte[]> getLicenseExtensions()
           
static LicenseStatus getLicenseStatus()
          Gets the license status.
static ArcGISRuntime.RenderEngine getRenderEngine()
          Gets the render engine.
static String getRuntimeBinariesDir()
          Gets the full path to the directory containing the local runtime binaries.
static String getRuntimeBinaryLocationsSearched()
          Gets the runtime binary locations searched.
static String getRuntimeBinaryPath(String binaryToFind)
          Gets the path to the given binary expected to be in the LocalServer directory rather than the Client directory.
static String getTempDirectory()
          Returns the directory path set using setTempDirectory(String).
static void initialize()
           
static boolean isInstallOK()
          Indicates whether or not the current installation location is usable.
static boolean isLicensed()
           
static boolean isLinux()
          Checks if is linux.
static void loadGpsDependencies()
           
static void setAppDataDirectory(String appDataDir)
          Sets the directory path used by the LocalServer for local app data; this is the LocalServer's AppLocalDataDir.
static void setInstallDirectory(String installDirectory)
          Set the path to the directory containing the runtime installation you wish to use.
static void setLicense(String license)
          Sets the license.
static void setLicense(String license, String... extensions)
          Call this method to license the runtime for deployment.
static void setRenderEngine(ArcGISRuntime.RenderEngine renderEngine)
          Sets the render engine.
static void setTempDirectory(String tempDir)
          Sets the directory path used by the LocalServer to create a temporary folder; this is the LocalServer's DataDir.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArcGISRuntime

public ArcGISRuntime()
Method Detail

getRenderEngine

public static ArcGISRuntime.RenderEngine getRenderEngine()
Gets the render engine.

Returns:
the render engine

setRenderEngine

public static void setRenderEngine(ArcGISRuntime.RenderEngine renderEngine)
Sets the render engine. Only OpenGL rendering is supported on Linux. The rendering engine can only be set before the JMap is created.

Parameters:
renderEngine - the new render engine

getJavaVersion

public static float getJavaVersion()

getRuntimeBinaryPath

public static String getRuntimeBinaryPath(String binaryToFind)
Gets the path to the given binary expected to be in the LocalServer directory rather than the Client directory. Note that the binaryToFind parameter must be the actual file name.

Parameters:
binaryToFind - the binary to find
Returns:
the absolute path to the given binary or null if it isn't found

getRuntimeBinariesDir

public static String getRuntimeBinariesDir()
Gets the full path to the directory containing the local runtime binaries. This will be LocalRuntime32\bin in 32bit windows, LocalRuntime64\bin on 64bit windows and LocalRuntimeLx/bin on Linux.

Returns:
the full path to the local runtime binaries directory or null if it isn't found

getClientLibPath

public static String getClientLibPath(String libName)
Gets the path to the given library expected to be in the Client directory rather than the LocalServer directory. Note that the libName parameter should be the name without extension or prefix (lib on Linux). For example libMylib.so or MyLib.dll would be requested as MyLib.

Parameters:
libName - the library name
Returns:
the full path to the given library or null if it isn't found

initialize

public static void initialize()

loadGpsDependencies

public static void loadGpsDependencies()

getRuntimeBinaryLocationsSearched

public static String getRuntimeBinaryLocationsSearched()
Gets the runtime binary locations searched. This is most useful when determining why one of the get path methods returned a null as it will show all the directories where the requested item was expected to be found.

Returns:
the runtime binary locations searched

getClientBinaryLocationsSearched

public static String getClientBinaryLocationsSearched()
Gets the client binary locations searched. This is most useful when determining why one of the get path methods returned a null as it will show all the directories where the requested item was expected to be found.

Returns:
the client binary locations searched

getInstallDirectory

public static String getInstallDirectory()
Gets the current install directory for the runtime. If this has not been explicitly set, the default locations will be tried. The first default location tried is relative to the directory the application is running from and the second is from the runtime install location.

Returns:
Current path to the runtime installation.

setInstallDirectory

public static void setInstallDirectory(String installDirectory)
Set the path to the directory containing the runtime installation you wish to use.

Parameters:
installDirectory - Path to runtime install directory.

isInstallOK

public static boolean isInstallOK()
Indicates whether or not the current installation location is usable.

Returns:
True if the current install location if usable, false otherwise.

isLicensed

public static boolean isLicensed()

setLicense

public static void setLicense(String license)
Sets the license.

Parameters:
license - the new license

setLicense

public static void setLicense(String license,
                              String... extensions)
Call this method to license the runtime for deployment. Call this before the creating any runtime sdk classes.

Parameters:
license - the new license
extensions - licenses for any extension required.

getLicenseStatus

public static LicenseStatus getLicenseStatus()
Gets the license status.

Returns:
the license status

getTempDirectory

public static String getTempDirectory()
Returns the directory path set using setTempDirectory(String).

Returns:
the directory path; null, if value was not set.
Since:
10.1.1
See Also:
setTempDirectory(String)

setTempDirectory

public static void setTempDirectory(String tempDir)
Sets the directory path used by the LocalServer to create a temporary folder; this is the LocalServer's DataDir. This folder is used to hold logs and crash dump content created by the LocalServer and instances of LocalService.

If not set, the user's Temp directory is used

Note: On Windows, if the user does not have permission to create the folder then a Windows message box will be displayed, similar to the following: "ProblemOccurred 'launching has encountered a problem. Access is denied."
Note: On Linux, the local server runs in a Wine environment. In values displayed by local server, for example in console, "Z:/" represents to the root "/", and "C:/" represents the folder used by Wine.

Parameters:
tempDir - directory path; if relative, it is relative to the path where the application was executed from.
Since:
10.1.1

getAppDataDirectory

public static String getAppDataDirectory()
Returns the directory path set using setAppDataDirectory(String).

Returns:
user specified path for local app data; null, if the value was not set.
Since:
10.1.1

setAppDataDirectory

public static void setAppDataDirectory(String appDataDir)
Sets the directory path used by the LocalServer for local app data; this is the LocalServer's AppLocalDataDir. For example, to unpack packages, maintain PKINFO cache details, etc.

If not set, the user's Local AppData directory is used. Can only be set when the LocalServer is not running; otherwise it will not be set.

Note: On Windows, if the user does not have permission to create the folder then a message similar to the following will be output: "Message : Startup failed: Exception boost::filesystem::create_directory: Access is denied"
Note: On Linux, the local server runs in a Wine environment. In values displayed by local server, for example in console, "Z:/" represents to the root "/", and "C:/" represents the folder used by Wine.

Parameters:
appDataDir - directory path, if relative, it is relative to the path where the application was executed from.
Since:
10.1.1

getLicenseBytes

protected static byte[] getLicenseBytes()

getLicenseExtensions

protected static ArrayList<byte[]> getLicenseExtensions()

isLinux

public static boolean isLinux()
Checks if is linux.

Returns:
true, if is linux


Copyright © 2012. All Rights Reserved.