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

## org.jboss.ejb.txtimer
Class TimerImpl

    java.lang.Object
      org.jboss.ejb.txtimer.TimerImpl

All Implemented Interfaces:
  Synchronization, javax.ejb.Timer

public class TimerImpl
extends Object
implements javax.ejb.Timer, Synchronization

An implementation of an EJB Timer.

Internally it uses a java.util.Timer and maintains its state in a Tx manner.

Since:
  07-Apr-2004
Author:
  Thomas.Diesler@jboss.org

Method Summary
`void` | `afterCompletion(int status)` This method is invoked after the transaction has committed or rolled back.
`void` | `beforeCompletion()` This method is invoked before the start of the commit or rollback process.
`void` | `cancel()` Cause the txtimer and all its associated expiration notifications to be cancelled.
`boolean` | `equals(Object obj)` Return true if objectId, createDate, periode are equal
`Date` | `getFirstTime()`
`javax.ejb.TimerHandle` | `getHandle()` Get a serializable handle to the txtimer.
`Serializable` | `getInfo()` Get the information associated with the txtimer at the time of creation.
`Serializable` | `getInfoInternal()`
`long` | `getNextExpire()`
`Date` | `getNextTimeout()` Get the point in time at which the next txtimer expiration is scheduled to occur.
`long` | `getPeriode()`
`TimedObjectId` | `getTimedObjectId()`
`long` | `getTimeRemaining()` Get the number of milliseconds that will elapse before the next scheduled txtimer expiration.
`String` | `getTimerId()`
`int` | `hashCode()` Hash code based on the Timers invariant properties
`boolean` | `isActive()`
`boolean` | `isCanceled()`
`boolean` | `isExpired()`
`void` | `killTimer()` Kill the timer, and remove it from the timer service
`String` | `toString()` Returns a string representation of the object.

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

Method Detail

### getTimerId

    public String getTimerId()

### getTimedObjectId

    public TimedObjectId getTimedObjectId()

### getFirstTime

    public Date getFirstTime()

### getPeriode

    public long getPeriode()

### getNextExpire

    public long getNextExpire()

### getInfoInternal

    public Serializable getInfoInternal()

### isActive

    public boolean isActive()

### isCanceled

    public boolean isCanceled()

### isExpired

    public boolean isExpired()

### cancel

    public void cancel()
                throws IllegalStateException,
                       javax.ejb.NoSuchObjectLocalException,
                       javax.ejb.EJBException

  Cause the txtimer and all its associated expiration notifications to be cancelled.

  Specified by:
    `cancel` in interface `javax.ejb.Timer`
  Throws:
    `IllegalStateException` - If this method is invoked while the instance is in a state that does not allow access to this method.
    `javax.ejb.NoSuchObjectLocalException` - If invoked on a txtimer that has expired or has been cancelled.
    `javax.ejb.EJBException` - If this method could not complete due to a system-level failure.

### killTimer

    public void killTimer()

  Kill the timer, and remove it from the timer service

### getTimeRemaining

    public long getTimeRemaining()
                          throws IllegalStateException,
                                 javax.ejb.NoSuchObjectLocalException,
                                 javax.ejb.EJBException

  Get the number of milliseconds that will elapse before the next scheduled txtimer expiration.

  Specified by:
    `getTimeRemaining` in interface `javax.ejb.Timer`
  Returns:
    Number of milliseconds that will elapse before the next scheduled txtimer expiration.
  Throws:
    `IllegalStateException` - If this method is invoked while the instance is in a state that does not allow access to this method.
    `javax.ejb.NoSuchObjectLocalException` - If invoked on a txtimer that has expired or has been cancelled.
    `javax.ejb.EJBException` - If this method could not complete due to a system-level failure.

### getNextTimeout

    public Date getNextTimeout()
                        throws IllegalStateException,
                               javax.ejb.NoSuchObjectLocalException,
                               javax.ejb.EJBException

  Get the point in time at which the next txtimer expiration is scheduled to occur.

  Specified by:
    `getNextTimeout` in interface `javax.ejb.Timer`
  Returns:
    Get the point in time at which the next txtimer expiration is scheduled to occur.
  Throws:
    `IllegalStateException` - If this method is invoked while the instance is in a state that does not allow access to this method.
    `javax.ejb.NoSuchObjectLocalException` - If invoked on a txtimer that has expired or has been cancelled.
    `javax.ejb.EJBException` - If this method could not complete due to a system-level failure.

### getInfo

    public Serializable getInfo()
                         throws IllegalStateException,
                                javax.ejb.NoSuchObjectLocalException,
                                javax.ejb.EJBException

  Get the information associated with the txtimer at the time of creation.

  Specified by:
    `getInfo` in interface `javax.ejb.Timer`
  Returns:
    The Serializable object that was passed in at txtimer creation, or null if the info argument passed in at txtimer creation was null.
  Throws:
    `IllegalStateException` - If this method is invoked while the instance is in a state that does not allow access to this method.
    `javax.ejb.NoSuchObjectLocalException` - If invoked on a txtimer that has expired or has been cancelled.
    `javax.ejb.EJBException` - If this method could not complete due to a system-level failure.

### getHandle

    public javax.ejb.TimerHandle getHandle()
                                    throws IllegalStateException,
                                           javax.ejb.NoSuchObjectLocalException,
                                           javax.ejb.EJBException

  Get a serializable handle to the txtimer. This handle can be used at a later time to re-obtain the txtimer reference.

  Specified by:
    `getHandle` in interface `javax.ejb.Timer`
  Returns:
    Handle of the Timer
  Throws:
    `IllegalStateException` - If this method is invoked while the instance is in a state that does not allow access to this method.
    `javax.ejb.NoSuchObjectLocalException` - If invoked on a txtimer that has expired or has been cancelled.
    `javax.ejb.EJBException` - If this method could not complete due to a system-level failure.

### equals

    public boolean equals(Object obj)

  Return true if objectId, createDate, periode are equal

### hashCode

    public int hashCode()

  Hash code based on the Timers invariant properties

### toString

    public String toString()

  Returns a string representation of the object.

### beforeCompletion

    public void beforeCompletion()

  This method is invoked before the start of the commit or rollback process. The method invocation is done in the context of the transaction that is about to be committed or rolled back.

  Specified by:
    `beforeCompletion` in interface `Synchronization`

### afterCompletion

    public void afterCompletion(int status)

  This method is invoked after the transaction has committed or rolled back.

  Specified by:
    `afterCompletion` in interface `Synchronization`
  Parameters:
    `status` - The status of the completed transaction.

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

Copyright © 2002 JBoss Group, LLC. All Rights Reserved.