KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > osgi > service > environment > EnvironmentInfo


1 /*******************************************************************************
2  * Copyright (c) 2003, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.osgi.service.environment;
12
13 /**
14  * A Framework service which gives access to the command line used to start
15  * this running framework as well as information about the environment
16  * such as the current operating system, machine architecture, locale and
17  * windowing system.
18  * <p>
19  * This interface is not intended to be implemented by clients.
20  * </p>
21  *
22  * @since 3.0
23  * XXX Need to add a method that gets the real application args.
24  * We might also want to explain how the command line is organized: fwk / non fwk. Non-fwk is rt args and app args.
25  */

26 public interface EnvironmentInfo {
27
28     /**
29      * Returns all command line arguments specified when the running framework was started.
30      *
31      * @return the array of command line arguments.
32      */

33     public String JavaDoc[] getCommandLineArgs();
34
35     /**
36      * Returns the arguments consumed by the framework implementation itself. Which
37      * arguments are consumed is implementation specific.
38      *
39      * @return the array of command line arguments consumed by the framework.
40      */

41     public String JavaDoc[] getFrameworkArgs();
42
43     /**
44      * Returns the arguments not consumed by the framework implementation itself. Which
45      * arguments are consumed is implementation specific.
46      *
47      * @return the array of command line arguments not consumed by the framework.
48      */

49     public String JavaDoc[] getNonFrameworkArgs();
50
51     /**
52      * Returns the string name of the current system architecture.
53      * The value is a user-defined string if the architecture is
54      * specified on the command line, otherwise it is the value
55      * returned by <code>java.lang.System.getProperty("os.arch")</code>.
56      *
57      * @return the string name of the current system architecture
58      */

59     public String JavaDoc getOSArch();
60
61     /**
62      * Returns the string name of the current locale for use in finding files
63      * whose path starts with <code>$nl$</code>.
64      *
65      * @return the string name of the current locale
66      */

67     public String JavaDoc getNL();
68
69     /**
70      * Returns the string name of the current operating system for use in finding
71      * files whose path starts with <code>$os$</code>. Return {@link Constants#OS_UNKNOWN}
72      * if the operating system cannot be determined.
73      * <p>
74      * The value may indicate one of the operating systems known to the platform
75      * (as specified in <code>org.eclipse.core.runtime.Platform#knownOSValues</code>)
76      * or a user-defined string if the operating system name is specified on the command line.
77      * </p>
78      *
79      * @return the string name of the current operating system
80      */

81     public String JavaDoc getOS();
82
83     /**
84      * Returns the string name of the current window system for use in finding files
85      * whose path starts with <code>$ws$</code>. Return <code>null</code>
86      * if the window system cannot be determined.
87      *
88      * @return the string name of the current window system or <code>null</code>
89      */

90     public String JavaDoc getWS();
91
92     /**
93      * Returns <code>true</code> if the framework is in debug mode and
94      * <code>false</code> otherwise.
95      *
96      * @return whether or not the framework is in debug mode
97      */

98     public boolean inDebugMode();
99
100     /**
101      * Returns <code>true</code> if the framework is in development mode
102      * and <code>false</code> otherwise.
103      *
104      * @return whether or not the framework is in development mode
105      */

106     public boolean inDevelopmentMode();
107 }
108
Popular Tags