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
     DateTime getDateTime()
               
     Map<String,String> getEnv()
               
     String getFileSeparator()
               
     String getHost()
               
     String getIp()
               
     String getJavaVendor()
               
     String getJavaVersion()
               
     Locale getLocale()
               
     String getOsArch()
               
     String getOsName()
               
     String getOsVersion()
               
     Properties getSystemProperties()
               
     TimeZone getTimeZone()
               
     String getTmpDir()
               
     String getUserDir()
               
     String getUserHome()
               
     String getUserName()
               
     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 String getHost()
                   throws UnknownHostException
    Throws:
    UnknownHostException

    getIp

    public String getIp()
                 throws UnknownHostException
    Throws:
    UnknownHostException

    getTimeZone

    public TimeZone getTimeZone()

    getLocale

    public Locale getLocale()

    getTmpDir

    public String getTmpDir()

    getFileSeparator

    public String getFileSeparator()

    getEnv

    public Map<String,String> getEnv()

    getSystemProperties

    public Properties getSystemProperties()

    getOsName

    public String getOsName()

    getOsArch

    public String getOsArch()

    getOsVersion

    public String getOsVersion()

    getJavaVersion

    public String getJavaVersion()

    getJavaVendor

    public String getJavaVendor()

    getUserName

    public String getUserName()

    getUserHome

    public String getUserHome()

    getUserDir

    public String getUserDir()

    getDateTime

    public DateTime getDateTime()

    nanoTime

    public long nanoTime()


    Copyright © 2003–2014 MuleSoft, Inc.. All rights reserved.