br.blog.chester.timefix
Class Timefix

java.lang.Object
  extended by br.blog.chester.timefix.Timefix
Direct Known Subclasses:
timefix

public class Timefix
extends java.lang.Object

Allows Java environments to adjust their default TimeZone settings to accomodate changes such as Daylight Savivings Time updates.

This ajust can be made on the aplication itself (by calling the fixTimeZone() method), or by inserting the class on the application startup script (it will adjust the timezone and call the "real" startup class).

The latter method is very useful for deployers that don't have access to the application source code.

The hard work of reading the timezone info from the default UNIX location/format is done by Stuart D. Gathman's Java implementation of the "tz" package. It is distributed along with this code for convenience only, but it's official home is at http://www.bmsi.com/java/#TZ .

Author:
chester
See Also:
ZoneInfo

Constructor Summary
Timefix()
           
 
Method Summary
static void fixTimeZone()
          Adjusts the JVM's default timezone to our custom timezone.
static void main(java.lang.String[] args)
          Adjusts the timezone and calls the main method from a class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timefix

public Timefix()
Method Detail

fixTimeZone

public static void fixTimeZone()
                        throws java.io.IOException
Adjusts the JVM's default timezone to our custom timezone.

Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Throwable
Adjusts the timezone and calls the main method from a class.

The first received parameter is the name of the class. In practice, this method (combined with the timefix class on the default package) allows an administrator to replace:

java MyMainClass param1 param2 param3

with

java timefix MyMainClass param1 param2 param3

to solve timezone problems (such as DST changes) without access to the source code

Parameters:
args - name of the original main class, followed by its arguments
Throws:
java.lang.Throwable