Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## fr.gouv.culture.util.apache.avalon.cornerstone.services.scheduler
Class PeriodicTimeTrigger

    java.lang.Object
      fr.gouv.culture.util.apache.avalon.cornerstone.services.scheduler.PeriodicTimeTrigger

All Implemented Interfaces:
  TimeTrigger, Trigger

public class PeriodicTimeTrigger
extends java.lang.Object
implements TimeTrigger

Goes off every `period` milliseconds after waiting for `offset` milliseconds from the moment the trigger was `reset`.

Author:
  Peter Donald, Ram Chidambaram

Field Summary
`protected long` | `m_offset`
`protected long` | `m_period`

Constructor Summary
`PeriodicTimeTrigger(int offset, int period)` Creates a periodic trigger.

Method Summary
`long` | `getOffset()`
`long` | `getPeriod()`
`long` | `getTimeAfter(long moment)` Returns the next time after the given `moment` when this trigger goes off.
`void` | `reset()` Reset the original TimeTrigger.
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### m_offset

    protected final long m_offset

### m_period

    protected final long m_period

Constructor Detail

### PeriodicTimeTrigger

    public PeriodicTimeTrigger(int offset,
                               int period)

  Creates a periodic trigger. It goes off the first time after `offset` milliseconds from the time it was `reset` and then every `period` milliseconds. The trigger is `reset` as part of its construction.

Parameters:
  `offset` - initial delay in milliseconds, -1 means fire immediately
  `period` - after initial delay in milliseconds, -1 means fire only once after initial delay

Method Detail

### getTimeAfter

    public long getTimeAfter(long moment)

  Returns the next time after the given `moment` when this trigger goes off.

  Specified by:
    `getTimeAfter` in interface `TimeTrigger`
  Parameters:
    `moment` - base point in milliseconds
  Returns:
    the time in milliseconds when this trigger goes off

### getOffset

    public long getOffset()

### getPeriod

    public long getPeriod()

### reset

    public void reset()

  Reset the original TimeTrigger. This will recalculate the activation time for this trigger.

  Specified by:
    `reset` in interface `Trigger`

### toString

    public java.lang.String toString()

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2003 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.