FileDocCategorySizeDatePackage
LogRotationTimer.javaAPI DocGlassfish v2 API3291Fri May 04 22:35:44 BST 2007com.sun.enterprise.server.logging

LogRotationTimer

public class LogRotationTimer extends Object

Fields Summary
private Timer
rotationTimer
private LogRotationTimerTask
rotationTimerTask
private static LogRotationTimer
instance
Constructors Summary
private LogRotationTimer()


       
        rotationTimer = new Timer( );
    
Methods Summary
public static com.sun.enterprise.server.logging.LogRotationTimergetInstance()

        return instance;
    
public voidrestartTimer()

        // We will restart the timer only if the timerTask is set which
        // means user has set a value for LogRotation based on Time
        if( rotationTimerTask != null ) {
            rotationTimerTask.cancel( );
            rotationTimerTask = new LogRotationTimerTask( 
                // This is wierd, We need to have a fresh TimerTask object
                // to reschedule the work. 
                rotationTimerTask.getRotationTimerValueInMinutes( ) );
            rotationTimer.schedule( rotationTimerTask, 
                rotationTimerTask.getRotationTimerValue( ) );
        } 
    
public voidstartTimer(LogRotationTimerTask timerTask)

        rotationTimerTask = timerTask;
        rotationTimer.schedule( rotationTimerTask, 
            timerTask.getRotationTimerValue( ) );
    
public voidstopTimer()

        rotationTimer.cancel( );