org.mule.el.context
Class ServerContext

java.lang.Object
  extended by org.mule.el.context.ServerContext

public class ServerContext
extends Object

Exposes information about both the physical server and Java Runtime Environment (JRE) that Mule is running on:

  • env Map of Operating System environment variables
  • fileSeparator Character that separates components of a file path. This is "/" on UNIX and "\" on Windows.
  • host Fully qualified domain name for the server
  • ip The IP address of the server
  • locale The default locale (java.util.Locale) of the JRE. Can be used language (locale.language), country (locale.country) and
  • javaVersion JRE version
  • javaVendor JRE vendor name
  • osName Operating System name
  • osArch Operating System architecture
  • osVersion Operating System version
  • systemProperties Map of Java system properties
  • timeZone Default TimeZone (java.util.TimeZone) of the JRE.
  • tmpDir Temporary directory for use by the JRE
  • userName User name
  • userHome User home directory
  • userDir User working directory
  • nanoSeconds Current system time in nanoseconds
  • dateTime Current system time via a DateTime utility object (see below) dateTime
  • milliSeconds, seconds, minutes, hours Integer values for milliSeconds, seconds and minutes.
  • dayOfWeek, dayOfMonth, dayOfYear Integer value for day of week, month and year.
  • weekOfMonth, weekOfYear Integer value for week of month and year
  • month Integer value for month of year
  • zone String. The TimeZone display name.
  • withTimeZone('timeZoneString') Changes TimeZone to that specified using TimeZone string identifier. Returns DateTime for method chaining. (Does not alter system timeZone or affect other uses of server.dateTime)
  • withLocale('localeString') Changes DateTime Locale to that specified using Locale string identifier. Returns DateTime for method chaining. Returns DateTime for method chaining. (Does not alter system locale or affect other uses of server.dateTime)
  • isBefore(DateTimeContext date) Boolean. Returns true if the date parameter is before the current DateTime.
  • isAfter(DateTimeContext date) Boolean. Returns true if the date parameter is after the current DateTime.
  • addSeconds(int seconds) Add n seconds to the current DateTime. Returns DateTime for method chaining.
  • addMinutes(int minutes) Add n minutes to the current DateTime. Returns DateTime for method chaining.
  • addHours(int hours) Add n hours to the current DateTime. Returns DateTime for method chaining.
  • addDay(int days) Add n days to the current DateTime. Returns DateTime for method chaining.
  • addWeeks(int weeks) Add n weeks to the current DateTime. Returns DateTime for method chaining.
  • addMonths(int months) Add n months to the current DateTime. Returns DateTime for method chaining.
  • addYears(int years) Add n years to the current DateTime. Returns DateTime for method chaining.


    Constructor Summary
    ServerContext()
               
     
    Method Summary
    static DateTime getDateTime()
               
    static Map<String,String> getEnv()
               
    static String getFileSeparator()
               
    static String getHost()
               
    static String getIp()
               
    static String getJavaVendor()
               
    static String getJavaVersion()
               
    static Locale getLocale()
               
    static String getOsArch()
               
    static String getOsName()
               
    static String getOsVersion()
               
    static Properties getSystemProperties()
               
    static TimeZone getTimeZone()
               
    static String getTmpDir()
               
    static String getUserDir()
               
    static String getUserHome()
               
    static String getUserName()
               
    static long nanoTime()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    ServerContext

    public ServerContext()
    Method Detail

    getHost

    public static String getHost()
                          throws UnknownHostException
    Throws:
    UnknownHostException

    getIp

    public static String getIp()
                        throws UnknownHostException
    Throws:
    UnknownHostException

    getTimeZone

    public static TimeZone getTimeZone()

    getLocale

    public static Locale getLocale()

    getTmpDir

    public static String getTmpDir()

    getFileSeparator

    public static String getFileSeparator()

    getEnv

    public static Map<String,String> getEnv()

    getSystemProperties

    public static Properties getSystemProperties()

    getOsName

    public static String getOsName()

    getOsArch

    public static String getOsArch()

    getOsVersion

    public static String getOsVersion()

    getJavaVersion

    public static String getJavaVersion()

    getJavaVendor

    public static String getJavaVendor()

    getUserName

    public static String getUserName()

    getUserHome

    public static String getUserHome()

    getUserDir

    public static String getUserDir()

    getDateTime

    public static DateTime getDateTime()

    nanoTime

    public static long nanoTime()


    Copyright © 2003-2013 MuleSoft, Inc.. All Rights Reserved.