net.sf.mmm.util.lang.base
Class SystemInformationImpl

java.lang.Object
  extended by net.sf.mmm.util.lang.base.SystemInformationImpl
All Implemented Interfaces:
SystemInformation

public class SystemInformationImpl
extends Object
implements SystemInformation

This is the implementation of the SystemInformation interface.

Since:
2.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
private  boolean limitedDevice
           
private  String systemArchitecture
           
private  String systemName
           
private  String systemType
           
private  String systemVersion
           
 
Fields inherited from interface net.sf.mmm.util.lang.api.SystemInformation
SYSTEM_TYPE_BSD, SYSTEM_TYPE_LINUX, SYSTEM_TYPE_MAC_IOS, SYSTEM_TYPE_MAINFRAIME, SYSTEM_TYPE_OTHER, SYSTEM_TYPE_UNIX, SYSTEM_TYPE_WINDOWS
 
Constructor Summary
SystemInformationImpl()
          The constructor.
SystemInformationImpl(String systemName, String systemVersion, String systemArchitecture)
          The constructor.
SystemInformationImpl(String systemName, String systemVersion, String systemArchitecture, String systemType, boolean mobileDevice)
          The constructor.
 
Method Summary
private static boolean detectLimitedDevice(String osName, String osArchitecture, boolean currentSystem)
           
private static String detectSystemType(String osName, boolean currentSystem)
           
 String getSystemArchitecture()
          This method gets the architecture of the operating system running this java virtual machine.
 String getSystemName()
          This method gets the name of the operating system running this java virtual machine.
 String getSystemType()
          This method gets the type of the operating system running this java virtual machine.
 String getSystemVersion()
          This method gets the version of the operating system running this java virtual machine in lower-case.
 boolean isLimitedDevice()
          This method determines if the operating system running this java virtual machine is for mobile or embedded devices or maybe tablets but not for full-fledged PC or server machines.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

systemName

private final String systemName
See Also:
getSystemName()

systemVersion

private final String systemVersion
See Also:
getSystemVersion()

systemArchitecture

private final String systemArchitecture
See Also:
getSystemArchitecture()

systemType

private final String systemType
See Also:
getSystemType()

limitedDevice

private final boolean limitedDevice
See Also:
isLimitedDevice()
Constructor Detail

SystemInformationImpl

public SystemInformationImpl()
The constructor.


SystemInformationImpl

public SystemInformationImpl(String systemName,
                             String systemVersion,
                             String systemArchitecture)
The constructor.

Parameters:
systemName - - see getSystemName().
systemVersion - - see getSystemVersion().
systemArchitecture - - see getSystemArchitecture().

SystemInformationImpl

public SystemInformationImpl(String systemName,
                             String systemVersion,
                             String systemArchitecture,
                             String systemType,
                             boolean mobileDevice)
The constructor.

Parameters:
systemName - - see getSystemName().
systemVersion - - see getSystemVersion().
systemArchitecture - - see getSystemArchitecture().
systemType - - see getSystemType().
mobileDevice - - see isLimitedDevice().
Method Detail

detectSystemType

private static String detectSystemType(String osName,
                                       boolean currentSystem)
Parameters:
osName - - see getSystemName().
currentSystem - - true if the value should be determined for the system and JVM currently running (in this case additional system-properties might be evaluated), false otherwise.
Returns:
the value for isLimitedDevice().
See Also:
getSystemType()

detectLimitedDevice

private static boolean detectLimitedDevice(String osName,
                                           String osArchitecture,
                                           boolean currentSystem)
Parameters:
osName - - see getSystemName().
osArchitecture - - see getSystemArchitecture().
currentSystem - - true if the value should be determined for the system and JVM currently running (in this case additional system-properties might be evaluated), false otherwise.
Returns:
the value for isLimitedDevice().
See Also:
isLimitedDevice()

getSystemName

public String getSystemName()
This method gets the name of the operating system running this java virtual machine. Here is an incomplete list of possible results:

Specified by:
getSystemName in interface SystemInformation
Returns:
the OS name.
See Also:
SystemUtil.PROPERTY_OS_NAME

getSystemArchitecture

public String getSystemArchitecture()
This method gets the architecture of the operating system running this java virtual machine. Typical results are:

Specified by:
getSystemArchitecture in interface SystemInformation
Returns:
the OS name.
See Also:
SystemUtil.PROPERTY_OS_NAME

getSystemVersion

public String getSystemVersion()
This method gets the version of the operating system running this java virtual machine in lower-case.

Specified by:
getSystemVersion in interface SystemInformation
Returns:
the OS name.
See Also:
SystemUtil.PROPERTY_OS_VERSION

getSystemType

public String getSystemType()
This method gets the type of the operating system running this java virtual machine. The type is not something directly provided by the JRE. It is defined by this API and is derived from the system-name to make things easier for you.

Specified by:
getSystemType in interface SystemInformation
Returns:
the type of the operating system as one of the SYSTEM_TYPE_* constants defined in this interface.
See Also:
SystemInformation.SYSTEM_TYPE_WINDOWS, SystemInformation.SYSTEM_TYPE_MAC_IOS, SystemInformation.SYSTEM_TYPE_LINUX, SystemInformation.SYSTEM_TYPE_BSD, SystemInformation.SYSTEM_TYPE_UNIX, SystemInformation.SYSTEM_TYPE_OTHER

isLimitedDevice

public boolean isLimitedDevice()
This method determines if the operating system running this java virtual machine is for mobile or embedded devices or maybe tablets but not for full-fledged PC or server machines. In such case you can assume that you are running on a mobile or embedded device. Please note that this is NOT a guarantee.

Specified by:
isLimitedDevice in interface SystemInformation
Returns:
true if operating system is for limited device, false otherwise.


Copyright © 2001-2010 mmm-Team. All Rights Reserved.