< prev index next >

src/java.base/share/classes/java/lang/System.java

Print this page




 984      *
 985      * @return the environment as a map of variable names to values
 986      * @throws SecurityException
 987      *         if a security manager exists and its
 988      *         {@link SecurityManager#checkPermission checkPermission}
 989      *         method doesn't allow access to the process environment
 990      * @see    #getenv(String)
 991      * @see    ProcessBuilder#environment()
 992      * @since  1.5
 993      */
 994     public static java.util.Map<String,String> getenv() {
 995         SecurityManager sm = getSecurityManager();
 996         if (sm != null) {
 997             sm.checkPermission(new RuntimePermission("getenv.*"));
 998         }
 999 
1000         return ProcessEnvironment.getenv();
1001     }
1002 
1003     /**





















1004      * {@code System.Logger} instances log messages that will be
1005      * routed to the underlying logging framework the {@link System.LoggerFinder
1006      * LoggerFinder} uses.
1007      * <p>
1008      * {@code System.Logger} instances are typically obtained from
1009      * the {@link java.lang.System System} class, by calling
1010      * {@link java.lang.System#getLogger(java.lang.String) System.getLogger(loggerName)}
1011      * or {@link java.lang.System#getLogger(java.lang.String, java.util.ResourceBundle)
1012      * System.getLogger(loggerName, bundle)}.
1013      *
1014      * @see java.lang.System#getLogger(java.lang.String)
1015      * @see java.lang.System#getLogger(java.lang.String, java.util.ResourceBundle)
1016      * @see java.lang.System.LoggerFinder
1017      *
1018      * @since 9
1019      *
1020      */
1021     public interface Logger {
1022 
1023         /**




 984      *
 985      * @return the environment as a map of variable names to values
 986      * @throws SecurityException
 987      *         if a security manager exists and its
 988      *         {@link SecurityManager#checkPermission checkPermission}
 989      *         method doesn't allow access to the process environment
 990      * @see    #getenv(String)
 991      * @see    ProcessBuilder#environment()
 992      * @since  1.5
 993      */
 994     public static java.util.Map<String,String> getenv() {
 995         SecurityManager sm = getSecurityManager();
 996         if (sm != null) {
 997             sm.checkPermission(new RuntimePermission("getenv.*"));
 998         }
 999 
1000         return ProcessEnvironment.getenv();
1001     }
1002 
1003     /**
1004      * Refreshes the current system environment variables.
1005      *
1006      * In the unlikely event that the system environment variables have been
1007      * modified, by some out-of-band mechanism, this method will re-read the
1008      * current system environment variables. Upon successful invocation of this
1009      * method: 1) subsequent invocations of {@linkplain #getenv(String)
1010      * getenv(String)} may return a different value, and 2) subsequent
1011      * method invocations on the {@code Map} return by {@linkplain #getenv()}
1012      * getenv()} may return different results.
1013      *
1014      * @apiNote
1015      * The invocation of this method is only required if there is knowledge that
1016      * an out-of-band mechanism has modified the system environment variables.
1017      *
1018      * @since 9
1019      */
1020     public static void refreshEnv() {
1021         ProcessEnvironment.refreshEnv();
1022     }
1023 
1024     /**
1025      * {@code System.Logger} instances log messages that will be
1026      * routed to the underlying logging framework the {@link System.LoggerFinder
1027      * LoggerFinder} uses.
1028      * <p>
1029      * {@code System.Logger} instances are typically obtained from
1030      * the {@link java.lang.System System} class, by calling
1031      * {@link java.lang.System#getLogger(java.lang.String) System.getLogger(loggerName)}
1032      * or {@link java.lang.System#getLogger(java.lang.String, java.util.ResourceBundle)
1033      * System.getLogger(loggerName, bundle)}.
1034      *
1035      * @see java.lang.System#getLogger(java.lang.String)
1036      * @see java.lang.System#getLogger(java.lang.String, java.util.ResourceBundle)
1037      * @see java.lang.System.LoggerFinder
1038      *
1039      * @since 9
1040      *
1041      */
1042     public interface Logger {
1043 
1044         /**


< prev index next >