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.