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

java.lang.Object
  extended by net.sf.mmm.util.component.base.AbstractComponent
      extended by net.sf.mmm.util.component.base.AbstractLoggableComponent
          extended by net.sf.mmm.util.lang.base.SystemUtilImpl
All Implemented Interfaces:
SystemUtil

@Singleton
@Named
public class SystemUtilImpl
extends AbstractLoggableComponent
implements SystemUtil

This is the implementation of the SystemUtil interface.

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

Field Summary
private static SystemUtil instance
           
private  SystemInformation systemInformation
           
 
Fields inherited from interface net.sf.mmm.util.lang.api.SystemUtil
PROPERTY_JAVA_VM_NAME, PROPERTY_OS_ARCHITECTURE, PROPERTY_OS_NAME, PROPERTY_OS_VERSION
 
Constructor Summary
SystemUtilImpl()
          The constructor.
 
Method Summary
static SystemUtil getInstance()
          This method gets the singleton instance of this SystemUtil.
 SystemInformation getSystemInformation()
          This method gets the SystemInformation for the operating system running this java virtual-machine.
 
Methods inherited from class net.sf.mmm.util.component.base.AbstractLoggableComponent
doInitialize, getLogger, setLogger
 
Methods inherited from class net.sf.mmm.util.component.base.AbstractComponent
doInitialized, getInitializationState, initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static SystemUtil instance
See Also:
getInstance()

systemInformation

private final SystemInformation systemInformation
See Also:
getSystemInformation()
Constructor Detail

SystemUtilImpl

public SystemUtilImpl()
The constructor.

Method Detail

getInstance

public static SystemUtil getInstance()
This method gets the singleton instance of this SystemUtil.
This design is the best compromise between easy access (via this indirection you have direct, static access to all offered functionality) and IoC-style design which allows extension and customization.
For IoC usage, simply ignore all static getInstance() methods and construct new instances via the container-framework of your choice (like plexus, pico, springframework, etc.). To wire up the dependent components everything is properly annotated using common-annotations (JSR-250). If your container does NOT support this, you should consider using a better one.

Returns:
the singleton instance.

getSystemInformation

public SystemInformation getSystemInformation()
This method gets the SystemInformation for the operating system running this java virtual-machine. It lets you determine specific things (e.g. if you are running on "MS Windows" or on a "mobile device").

Specified by:
getSystemInformation in interface SystemUtil
Returns:
the SystemInformation.


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