harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r414036 - /incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/System.java
Date Wed, 14 Jun 2006 03:22:12 GMT
Author: ndbeyer
Date: Tue Jun 13 20:22:12 2006
New Revision: 414036

URL: http://svn.apache.org/viewvc?rev=414036&view=rev
Log:
Add final Java 5 method stubs.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/System.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/System.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/System.java?rev=414036&r1=414035&r2=414036&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/System.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/System.java
Tue Jun 13 20:22:12 2006
@@ -20,11 +20,13 @@
 import java.io.FileDescriptor;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.PrintStream;
-import java.security.AccessController;
+import java.nio.channels.Channel;
+import java.nio.channels.spi.SelectorProvider;
 import java.security.Policy;
-import java.security.PrivilegedAction;
+import java.util.Map;
 import java.util.Properties;
 import java.util.PropertyPermission;
 
@@ -452,6 +454,16 @@
 	 * @return the time in milliseconds.
 	 */
 	public static native long currentTimeMillis();
+    
+    /**
+     * <p>
+     * Returns the most precise time measurement in nanoseconds that's
+     * available.
+     * </p>
+     * 
+     * @return The current time in nanoseconds.
+     */
+    public static native long nanoTime();
 
 	private static final int InitLocale = 0;
 
@@ -567,6 +579,34 @@
 		}
 		throw new Error();
 	}
+    
+    /**
+     * <p>
+     * Returns all environment variables.
+     * </p>
+     * 
+     * @return A Map of all environment variables.
+     */
+    public static Map<String, String> getenv() {
+        SecurityManager secMgr = System.getSecurityManager();
+        if (secMgr != null) {
+            secMgr.checkPermission(new RuntimePermission("getenv.*"));
+        }
+        throw new Error();
+    }
+    
+    /**
+     * <p>
+     * Returns the inherited channel from the system-wide provider.
+     * </p>
+     * @return A {@link Channel} or <code>null</code>.
+     * @throws IOException
+     * @see SelectorProvider
+     * @see SelectorProvider#inheritedChannel()
+     */
+    public static Channel inheritedChannel() throws IOException {
+        return SelectorProvider.provider().inheritedChannel();
+    }
 
 	/**
 	 * Answers the system properties. Note that this is not a copy, so that



Mime
View raw message