public class SystemInfoFactory extends Object
SystemInfo objects based on the native operating system the VM is running on.| Modifier and Type | Field and Description |
|---|---|
static String |
TOKEN_PREFIX
All template engine replacement variables that this factory's template engine will know about
will be prefixed with this string.
|
| Modifier and Type | Method and Description |
|---|---|
static SystemInfo |
createJavaSystemInfo()
Under some circumstances, you may want to force this factory to provide a Java-only
SystemInfo
implementation, regardless of whether the factory has disabled the native
layer or not. |
static SystemInfo |
createSystemInfo()
Returns the appropriate
SystemInfo implementation based on the platform/operating system the JVM is
running on. |
static void |
disableNativeSystemInfo()
This will tell the factory to not
create any native objects and to not load the
native libraries - even if the native library is available. |
static void |
enableNativeSystemInfo()
This will allow the factory to load the native libraries and
create native objects. |
static TemplateEngine |
fetchTemplateEngine() |
static Throwable |
getNativeLibraryLoadThrowable()
Returns a Throwable describing why the native library failed to initialize, or null if the native library
initialized successfully
|
static String |
getNativeSystemInfoVersion()
|
static boolean |
isNativeSystemInfoAvailable()
If there is a native library available for the JVM's platform/operating system,
true is returned. |
static boolean |
isNativeSystemInfoDisabled()
Returns
true if this factory was told to disable the native
layer. |
static boolean |
isNativeSystemInfoInitialized()
This returns
true iff the native libraries have actually been initialized. |
static void |
shutdown()
This method is reserved for those objects (like shutdown hooks) that are aware of the VM going down - at which
time it would be appropriate to give the native libraries a chance to clean up after themselves.
|
public static final String TOKEN_PREFIX
public static String getNativeSystemInfoVersion()
available and
enabled, this will return the native system's version string. Otherwise, a
generic Java version message is returned.public static void disableNativeSystemInfo()
create any native objects and to not load the
native libraries - even if the native library is available.public static void enableNativeSystemInfo()
public static boolean isNativeSystemInfoDisabled()
true if this factory was told to disable the native
layer. This only indicates if it was disabled; this has nothing to do with whether or not the native libraries
actually exist and are available.true if the native layer is disabledpublic static boolean isNativeSystemInfoAvailable()
true is returned. If
the JVM's platform does not have native libraries available, false is returned (in which case, the
only SystemInfo implementation that is available is JavaSystemInfo).true if there are native library APIs available for the JVM platformJavaSystemInfopublic static Throwable getNativeLibraryLoadThrowable()
public static boolean isNativeSystemInfoInitialized()
true iff the native libraries have actually been initialized. This will return
false if this factory has been disabled from the start (i.e. prior to
the first call to createSystemInfo() or getNativeSystemInfoVersion()). It will also return
false after the native libraries have been shutdown().true if the native libraries have been loaded and initializedpublic static SystemInfo createSystemInfo()
SystemInfo implementation based on the platform/operating system the JVM is
running on.NativeSystemInfo implementation or a JavaSystemInfo if the native libraries are
not available for the platform or have been
disabled.public static SystemInfo createJavaSystemInfo()
SystemInfo
implementation, regardless of whether the factory has disabled the native
layer or not. In the cases when you absolutely, positively have to have a non-native, Java-only implementation,
you can use this method.SystemInfo implementationpublic static void shutdown()
public static TemplateEngine fetchTemplateEngine()
Copyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.