|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.base.Adaptee
org.norther.tammi.core.thread.DefaultSchedulable
public class DefaultSchedulable
A default implementation of Schedulable.
| Field Summary |
|---|
| Fields inherited from class org.norther.tammi.core.base.Adaptee |
|---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
| Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate |
|---|
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE |
| Constructor Summary | |
|---|---|
DefaultSchedulable()
Constructs a new schedulable. |
|
DefaultSchedulable(boolean multiple)
Constructs a new schedulable for multiple threads. |
|
DefaultSchedulable(Runnable adaptee)
Constructs a new schedulable adapter. |
|
DefaultSchedulable(Runnable adaptee,
boolean multiple)
Constructs a new schedulable adapter for multiple threads. |
|
| Method Summary | |
|---|---|
long |
getDelay()
Gets the starting delay. |
long |
getPeriod()
Gets the execution period. |
ObjectName |
getSchedulerName()
Gets the the scheduler of the schedulable. |
void |
handleNotification(Notification notif,
Object handback)
Handles notifications from the scheduler. |
boolean |
isStarted()
Checks whether the startable has been started. |
void |
postmanaged()
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time. |
void |
run()
|
void |
setDelay(long delay)
Sets the starting delay between start method invocation and actual execution. |
void |
setPeriod(long period)
Sets the execution period. |
void |
setSchedulerName(ObjectName scheduler)
Sets the scheduler of the schedulable. |
void |
setTime(long time)
Sets the starting time of the first execution. |
void |
start()
Starts the MBean. |
void |
stop()
Stops the MBean. |
void |
unmanaged()
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time. |
| Methods inherited from class org.norther.tammi.core.base.Adaptee |
|---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultSchedulable()
public DefaultSchedulable(boolean multiple)
multiple - true to allow more than one threads.public DefaultSchedulable(Runnable adaptee)
adaptee - the adaptee.
public DefaultSchedulable(Runnable adaptee,
boolean multiple)
adaptee - the adaptee.multiple - true to allow more than one threads.| Method Detail |
|---|
public void postmanaged()
Manageable
postmanaged in interface Manageablepostmanaged in class Adaptee
public void unmanaged()
throws Exception
Manageable
unmanaged in interface Manageableunmanaged in class AdapteeException - if the adaptee refused to be unmanaged.public ObjectName getSchedulerName()
Schedulable
getSchedulerName in interface Schedulablepublic void setSchedulerName(ObjectName scheduler)
SchedulableNote that it will be taken into use after next start.
setSchedulerName in interface Schedulablescheduler - the object name of the scheduler or a query.public long getPeriod()
Schedulable
getPeriod in interface Schedulablepublic void setPeriod(long period)
SchedulableNote that it will be taken into use after next start.
setPeriod in interface Schedulableperiod - the execution period in msecs.public long getDelay()
Schedulable
getDelay in interface Schedulablepublic void setDelay(long delay)
Schedulable
setDelay in interface Schedulabledelay - the starting delay in msecs.public void setTime(long time)
Schedulable
setTime in interface Schedulabletime - the starting time in msecs.public boolean isStarted()
Startable
isStarted in interface Startable
public void start()
throws Exception
Startable
start in interface StartableException - if start fails.public void stop()
Startable
stop in interface Startablepublic void run()
run in interface Runnable
public void handleNotification(Notification notif,
Object handback)
handleNotification in interface NotificationListenernotif - the notification.handback - not used.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||