org.eclipse.osgi.service.environment
Interface EnvironmentInfo


public interface EnvironmentInfo

A Framework service which gives access to the command line used to start this running framework as well as information about the environment such as the current operating system, machine architecture, locale and windowing system.

This interface is not intended to be implemented by clients.

Since:
3.0

Method Summary
 java.lang.String[] getCommandLineArgs()
          Returns all command line arguments specified when the running framework was started.
 java.lang.String[] getFrameworkArgs()
          Returns the arguments consumed by the framework implementation itself.
 java.lang.String getNL()
          Returns the string name of the current locale for use in finding files whose path starts with $nl$.
 java.lang.String[] getNonFrameworkArgs()
          Returns the arguments not consumed by the framework implementation itself.
 java.lang.String getOS()
          Returns the string name of the current operating system for use in finding files whose path starts with $os$.
 java.lang.String getOSArch()
          Returns the string name of the current system architecture.
 java.lang.String getProperty(java.lang.String key)
          Returns the value for the specified property.
 java.lang.String getWS()
          Returns the string name of the current window system for use in finding files whose path starts with $ws$.
 boolean inDebugMode()
          Returns true if the framework is in debug mode and false otherwise.
 boolean inDevelopmentMode()
          Returns true if the framework is in development mode and false otherwise.
 java.lang.String setProperty(java.lang.String key, java.lang.String value)
          Sets the value for the specified property.
 

Method Detail

getCommandLineArgs

java.lang.String[] getCommandLineArgs()
Returns all command line arguments specified when the running framework was started.

Returns:
the array of command line arguments.

getFrameworkArgs

java.lang.String[] getFrameworkArgs()
Returns the arguments consumed by the framework implementation itself. Which arguments are consumed is implementation specific.

Returns:
the array of command line arguments consumed by the framework.

getNonFrameworkArgs

java.lang.String[] getNonFrameworkArgs()
Returns the arguments not consumed by the framework implementation itself. Which arguments are consumed is implementation specific.

Returns:
the array of command line arguments not consumed by the framework.

getOSArch

java.lang.String getOSArch()
Returns the string name of the current system architecture. The value is a user-defined string if the architecture is specified on the command line, otherwise it is the value returned by java.lang.System.getProperty("os.arch").

Returns:
the string name of the current system architecture

getNL

java.lang.String getNL()
Returns the string name of the current locale for use in finding files whose path starts with $nl$.

Returns:
the string name of the current locale

getOS

java.lang.String getOS()
Returns the string name of the current operating system for use in finding files whose path starts with $os$. Return Constants.OS_UNKNOWN if the operating system cannot be determined.

The value may indicate one of the operating systems known to the platform (as specified in org.eclipse.core.runtime.Platform#knownOSValues) or a user-defined string if the operating system name is specified on the command line.

Returns:
the string name of the current operating system

getWS

java.lang.String getWS()
Returns the string name of the current window system for use in finding files whose path starts with $ws$. Return null if the window system cannot be determined.

Returns:
the string name of the current window system or null

inDebugMode

boolean inDebugMode()
Returns true if the framework is in debug mode and false otherwise.

Returns:
whether or not the framework is in debug mode

inDevelopmentMode

boolean inDevelopmentMode()
Returns true if the framework is in development mode and false otherwise.

Returns:
whether or not the framework is in development mode

getProperty

java.lang.String getProperty(java.lang.String key)
Returns the value for the specified property. Environment Properties are backed by the Java system properties. When the option osgi.framework.useSystemProperties is used then the environment properties are specific for each instance of the framework.

This method should be used instead of the System.getProperty(String) method to avoid the global nature of system properties.

Parameters:
key - the property key
Returns:
the value of the property, or null
Since:
3.4

setProperty

java.lang.String setProperty(java.lang.String key,
                             java.lang.String value)
Sets the value for the specified property. Environment Properties are backed by the Java system properties. When the option osgi.framework.useSystemProperties is used then the environment properties are specific for each instance of the framework.

This method should be used instead of the System.setProperty(String, String) method to avoid the global nature of system properties.

Parameters:
key - the property key
value - the value of the property
Returns:
the old value of the property, or null
Since:
3.4