|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 |
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 Manageable
postmanaged
in class Adaptee
public void unmanaged() throws Exception
Manageable
unmanaged
in interface Manageable
unmanaged
in class Adaptee
Exception
- if the adaptee refused to be unmanaged.public ObjectName getSchedulerName()
Schedulable
getSchedulerName
in interface Schedulable
public void setSchedulerName(ObjectName scheduler)
Schedulable
Note that it will be taken into use after next start.
setSchedulerName
in interface Schedulable
scheduler
- the object name of the scheduler or a query.public long getPeriod()
Schedulable
getPeriod
in interface Schedulable
public void setPeriod(long period)
Schedulable
Note that it will be taken into use after next start.
setPeriod
in interface Schedulable
period
- the execution period in msecs.public long getDelay()
Schedulable
getDelay
in interface Schedulable
public void setDelay(long delay)
Schedulable
setDelay
in interface Schedulable
delay
- the starting delay in msecs.public void setTime(long time)
Schedulable
setTime
in interface Schedulable
time
- the starting time in msecs.public boolean isStarted()
Startable
isStarted
in interface Startable
public void start() throws Exception
Startable
start
in interface Startable
Exception
- if start fails.public void stop()
Startable
stop
in interface Startable
public void run()
run
in interface Runnable
public void handleNotification(Notification notif, Object handback)
handleNotification
in interface NotificationListener
notif
- the notification.handback
- not used.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |