public interface TimerMBean
Modifier and Type | Method and Description |
---|---|
Integer |
addNotification(String type, String message, Object userData, Date date)
创建一个新的具有指定
type 定时器通知,
message 和
userData 插入到一个给定的日期和一个空的时间和次数的通知列表。
|
Integer |
addNotification(String type, String message, Object userData, Date date, long period)
创建一个新的具有指定
type 定时器通知,
message 和
userData 并把它插入到列表通知与一个给定的日期和时间和空的次数。
|
Integer |
addNotification(String type, String message, Object userData, Date date, long period, long nbOccurences)
创建一个新的具有指定
type 定时器通知,
message 和
userData 并把它插入到列表通知与一个给定的日期,时间和次数。
|
Integer |
addNotification(String type, String message, Object userData, Date date, long period, long nbOccurences, boolean fixedRate)
创建一个新的具有指定
type 定时器通知,
message 和
userData 并把它插入到列表通知与一个给定的日期,时间和次数。
|
Vector<Integer> |
getAllNotificationIDs()
获取已注册到通知列表中的所有计时器通知标识符。
|
Date |
getDate(Integer id)
获取与计时器通知相关联的日期的副本。
|
Boolean |
getFixedRate(Integer id)
获取一个副本的指示标志是否定期通知是在固定延迟或固定利率执行。
|
int |
getNbNotifications()
获取已注册到通知列表的计时器通知的数目。
|
Long |
getNbOccurences(Integer id)
获取与计时器通知相关联的剩余数量的副本的副本。
|
Vector<Integer> |
getNotificationIDs(String type)
获取对应于指定类型的定时器通知的所有标识符。
|
String |
getNotificationMessage(Integer id)
获取对应于指定标识符的计时器通知详细信息。
|
String |
getNotificationType(Integer id)
获取对应于指定标识符的计时器通知类型。
|
Object |
getNotificationUserData(Integer id)
获取对应于指定标识符的计时器通知用户数据对象。
|
Long |
getPeriod(Integer id)
获取与计时器通知相关联的期间(以毫秒为单位)的副本。
|
boolean |
getSendPastNotifications()
获取指示计时器是否发送过去通知的标志。
|
boolean |
isActive()
测试定时器MBean是活跃的。
|
boolean |
isEmpty()
测试定时器通知列表是否为空。
|
void |
removeAllNotifications()
删除所有的定时器通知从通知单和重置定时器标识符用于更新通知柜台。
|
void |
removeNotification(Integer id)
从通知列表中移除与指定的标识符相对应的计时器通知。
|
void |
removeNotifications(String type)
从通知列表中移除对应于指定类型的所有计时器通知。
|
void |
setSendPastNotifications(boolean value)
设置指示计时器是否发送过去通知或不发送的标志。
|
void |
start()
启动定时器。
|
void |
stop()
停止定时器。
|
void start()
如果有一个或多个定时器通知通知列表中的时间之前,通知发出根据sendPastNotifications
国旗,然后,根据它的周期和事件更新剩余数。如果计时器通知日期仍然比当前日期早,则此通知只从通知列表中删除。
void stop()
Integer addNotification(String type, String message, Object userData, Date date, long period, long nbOccurences, boolean fixedRate) throws IllegalArgumentException
type
定时器通知,
message
和
userData
并把它插入到列表通知与一个给定的日期,时间和次数。
如果要插入的计时器通知有一个在当前日期之前的日期,该方法的行为就好像指定日期是当前日期。
一旦关闭通知,通知立即交付。
定期通知,第一次通知立即交付和后续的参数指定的时间间隔。
请注意,一旦定时器通知已被添加到通知列表中,其关联的日期、期间和出现的次数不能被更新。
在一个周期的通知的情况下,参数固定收益值用于指定执行方案,指定Timer
。
type
-定时器通知类型。
message
-定时器通知的详细信息。
userData
-定时器通知用户数据对象。
date
时发生的日期通知。
period
-定时器的通知时间(毫秒)。
nbOccurences
总数的定时器的通知将发射。
fixedRate
-如果
true
如果通知是周期性的,通知计划与执行方案固定利率。如果
false
如果通知是周期性的,通知计划与执行方案固定延迟。忽略通知是不是周期性。
IllegalArgumentException
-日期
null
或期间或出现的次数是负的。
addNotification(String, String, Object, Date, long, long)
Integer addNotification(String type, String message, Object userData, Date date, long period, long nbOccurences) throws IllegalArgumentException
type
定时器通知,
message
和
userData
并把它插入到列表通知与一个给定的日期,时间和次数。
如果要插入的计时器通知有一个在当前日期之前的日期,该方法的行为就好像指定日期是当前日期。
一旦关闭通知,通知立即交付。定期通知
,第一通知立即交付和后续的参数指定的时间间隔。
请注意,一旦定时器通知已被添加到通知列表中,其关联的日期、期间和出现的次数不能被更新。
在一个周期的通知的情况下,使用一个固定延迟执行方案,指定Timer
。为了使用一个固定利率执行方案,而不是使用addNotification(String, String, Object, Date, long, long, boolean)
。
type
-定时器通知类型。
message
-定时器通知的详细信息。
userData
-定时器通知用户数据对象。
date
时发生的日期通知。
period
-定时器的通知时间(毫秒)。
nbOccurences
总数的定时器的通知将发射。
IllegalArgumentException
-日期
null
或期间或出现的次数是负的。
addNotification(String, String, Object, Date, long, long, boolean)
Integer addNotification(String type, String message, Object userData, Date date, long period) throws IllegalArgumentException
type
定时器通知,
message
和
userData
并把它插入到列表通知与一个给定的日期和时间和空的次数。
定时器的通知将会不断重复使用的定时器周期使用固定延迟执行方案,指定Timer
。为了使用一个固定利率执行方案,而不是使用addNotification(String, String, Object, Date, long, long, boolean)
。
如果要插入的计时器通知有一个在当前日期之前的日期,该方法的行为就好像指定日期是当前日期。第一通知立即发送,随后的通知按周期参数指定的间隔进行间隔开。
type
-定时器通知类型。
message
-定时器通知的详细信息。
userData
-定时器通知用户数据对象。
date
时发生的日期通知。
period
-定时器的通知时间(毫秒)。
IllegalArgumentException
-日期
null
或期负。
Integer addNotification(String type, String message, Object userData, Date date) throws IllegalArgumentException
type
定时器通知,
message
和
userData
插入到一个给定的日期和一个空的时间和次数的通知列表。
定时器通知将在指定的日期处理一次。
如果要插入的计时器通知有一个在当前日期之前的日期,该方法将表现为如果指定的日期是当前日期,并立即通知通知。
type
-定时器通知类型。
message
-定时器通知的详细信息。
userData
-定时器通知用户数据对象。
date
时发生的日期通知。
IllegalArgumentException
-日期
null
。
void removeNotification(Integer id) throws InstanceNotFoundException
id
-定时器通知标识符。
InstanceNotFoundException
-定时器的通知。
void removeNotifications(String type) throws InstanceNotFoundException
type
-定时器通知类型。
InstanceNotFoundException
-指定的类型不符合在该定时器MBean通知列表任何计时器的通知。
void removeAllNotifications()
int getNbNotifications()
Vector<Integer> getAllNotificationIDs()
Integer
对象包含所有定时器通知标识符向量。如果没有定时器通知注册这个定时器MBean
Vector<Integer> getNotificationIDs(String type)
type
-定时器通知类型。
Integer
对象包含定时器通知指定的
type
所有标识符向量。如果没有定时通知注册这个定时器MBean指定的
type
String getNotificationType(Integer id)
id
-定时器通知标识符。
String getNotificationMessage(Integer id)
id
-定时器通知标识符。
Object getNotificationUserData(Integer id)
id
-定时器通知标识符。
Date getDate(Integer id)
id
-定时器通知标识符。
Long getPeriod(Integer id)
id
-定时器通知标识符。
Long getNbOccurences(Integer id)
id
-定时器通知标识符。
Boolean getFixedRate(Integer id)
id
-定时器通知标识符。
boolean getSendPastNotifications()
setSendPastNotifications(boolean)
void setSendPastNotifications(boolean value)
value
-过去通知发送开/关的标志值。
getSendPastNotifications()
boolean isActive()
true
如果定时器MBean是活跃的,
false
否则。
boolean isEmpty()
true
如果定时器通知列表是空的,
false
否则。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.