|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.ejb Interface Timer
public interface Timer
Timer 接口包含有关通过 EJB Timer Service 创建的计时器的信息。
The Timer interface contains information about a timer that was created through the EJB Timer Service.
Method Summary | |
---|---|
void |
cancel()
Cause the timer and all its associated expiration notifications to be cancelled. |
TimerHandle |
getHandle()
Get a serializable handle to the timer. |
Serializable |
getInfo()
Get the information associated with the timer at the time of creation. |
Date |
getNextTimeout()
Get the point in time at which the next timer expiration is scheduled to occur. |
long |
getTimeRemaining()
Get the number of milliseconds that will elapse before the next scheduled timer expiration. |
Method Detail |
---|
public void
cancel() throws IllegalStateException, NoSuchObjectLocalException, EJBException
导致删除计时器及其所有相关过期通知。
Throws | IllegalStateException: 如果在实例不允许访问此方法的情况下调用了此方法。 |
Throws | NoSuchObjectLocalException: 如果对已经过期或删除的计时器调用此方法。 |
Throws | EJBException: 如果此方法由于系统级失败而无法完成。 |
cancel
void cancel() throws IllegalStateException, NoSuchObjectLocalException, EJBException
- Cause the timer and all its associated expiration notifications to
be cancelled.
- Throws:
IllegalStateException
- If this method is invoked while the instance is in a state that does not allow access to this method.NoSuchObjectLocalException
- If invoked on a timer that has expired or has been cancelled.EJBException
- If this method could not complete due to a system-level failure.
public long
getTimeRemaining() throws IllegalStateException, NoSuchObjectLocalException, EJBException
获得下一个已安排的计时器过期之前要经历的毫秒数。
return | 下一个已安排的计时器过期之前要经历的毫秒数。 |
Throws | IllegalStateException: 如果在实例不允许访问此方法的情况下调用了此方法。 |
Throws | NoSuchObjectLocalException: 如果对已经过期或删除的计时器调用此方法。 |
Throws | EJBException: 如果此方法由于系统级失败而无法完成。 |
getTimeRemaining
long getTimeRemaining() throws IllegalStateException, NoSuchObjectLocalException, EJBException
- Get the number of milliseconds that will elapse before the next
scheduled timer expiration.
- Returns:
- the number of milliseconds that will elapse before the next scheduled timer expiration.
- Throws:
IllegalStateException
- If this method is invoked while the instance is in a state that does not allow access to this method.NoSuchObjectLocalException
- If invoked on a timer that has expired or has been cancelled.EJBException
- If this method could not complete due to a system-level failure.
public java.util.Date
getNextTimeout() throws IllegalStateException, NoSuchObjectLocalException, EJBException
获得下一个计时器过期计划发生的时间点。
return | 下一个计时器过期计划发生的时间点。 |
Throws | IllegalStateException: 如果在实例不允许访问此方法的情况下调用了此方法。 |
Throws | NoSuchObjectLocalException: 如果对已经过期或删除的计时器调用此方法。 |
Throws | EJBException: 如果此方法由于系统级失败而无法完成。 |
getNextTimeout
Date getNextTimeout() throws IllegalStateException, NoSuchObjectLocalException, EJBException
- Get the point in time at which the next timer expiration is scheduled
to occur.
- Returns:
- the point in time at which the next timer 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.NoSuchObjectLocalException
- If invoked on a timer that has expired or has been cancelled.EJBException
- If this method could not complete due to a system-level failure.
public java.io.Serializable
getInfo() throws IllegalStateException, NoSuchObjectLocalException, EJBException
获得计时器创建时,与计时器相关的信息。
return | 在计时器创建时传入的 Serializable 对象;如果在计时器创建时传入的 info 参数为 null,则返回 null。 |
Throws | IllegalStateException: 如果在实例不允许访问此方法的情况下调用了此方法。 |
Throws | NoSuchObjectLocalException: 如果对已经过期或删除的计时器调用此方法。 |
Throws | EJBException: 如果此方法由于系统级失败而无法完成。 |
getInfo
Serializable getInfo() throws IllegalStateException, NoSuchObjectLocalException, EJBException
- Get the information associated with the timer at the time of creation.
- Returns:
- The Serializable object that was passed in at timer creation, or null if the info argument passed in at timer 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.NoSuchObjectLocalException
- If invoked on a timer that has expired or has been cancelled.EJBException
- If this method could not complete due to a system-level failure.
public TimerHandle
getHandle() throws IllegalStateException, NoSuchObjectLocalException, EJBException
获得计时器的可序列化句柄。此句柄可用于以后重新获得计时器引用。
return | 计时器的可序列化句柄。 |
Throws | IllegalStateException: 如果在实例不允许访问此方法的情况下调用了此方法。 |
Throws | NoSuchObjectLocalException: 如果对已经过期或删除的计时器调用此方法。 |
Throws | EJBException: 如果此方法由于系统级失败而无法完成。 |
getHandle
TimerHandle getHandle() throws IllegalStateException, NoSuchObjectLocalException, EJBException
- Get a serializable handle to the timer. This handle can
be used at a later time to re-obtain the timer reference.
- Returns:
- a serializable handle to the timer.
- Throws:
IllegalStateException
- If this method is invoked while the instance is in a state that does not allow access to this method.NoSuchObjectLocalException
- If invoked on a timer that has expired or has been cancelled.EJBException
- If this method could not complete due to a system-level failure.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!