/* JFox, the OpenSource J2EE Application Server
 *
 * Distributable under GNU LGPL license by gun.org
 * more details please visit http://www.huihoo.org/jfox
 */

package org.jfox.jms.message;

import java.util.Date;
import javax.jms.JMSException;

/**
 * <p/>
 * This class implements timestamp for Messages.
 * </p>
 *
 * @author <a href="mailto:founder_chen@yahoo.com.cn">Peter.Cheng</a>
 * @version Revision: 1.1 Date: 2002-11-03 22:24:28
 */

public class JMSTimestamp extends Date {

    /**
     * Default Constructor without param
     */
    public JMSTimestamp() {
        super();
    }

    /**
     * Build JMSTimestamp with special time.
     *
     * @param timestamp
     */
    public JMSTimestamp(long timestamp) {
        super(timestamp);
    }

    /**
     * Return time as milliseconds since epoc.
     *
     * @return the current time
     */
    public long getCurrentTime() throws JMSException {
        return getTime();
    }

    /**
     * Set the current time.
     *
     * @param timestamp
     */
    public void setCurrentTime(long timestamp) {
        setTime(timestamp);
    }

    public String toString() {
        return "JMSTimestamp current " + String.valueOf(super.getTime());
    }

}
