站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 server API Documentation 英文版文档

DatabasePersistencePolicy (JBoss Server API) - JBoss 4.0.1 sp1 server API Documentation 英文版文档


org.jboss.ejb.txtimer
Class DatabasePersistencePolicy

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended byorg.jboss.system.ServiceMBeanSupport
          extended byorg.jboss.ejb.txtimer.DatabasePersistencePolicy
All Implemented Interfaces:
DatabasePersistencePolicyMBean, EventListener, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, javax.management.NotificationListener, PersistencePolicy, org.jboss.system.Service, org.jboss.system.ServiceMBean

public class DatabasePersistencePolicy
extends org.jboss.system.ServiceMBeanSupport
implements javax.management.NotificationListener, DatabasePersistencePolicyMBean

This service implements a PersistencePolicy that persistes the timer to a database.

Since:
09-Sep-2004
Version:
$Revision: 1.4.2.6 $
Author:
Thomas.Diesler@jboss.org, Scott.Stark@jboss.org

Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.ejb.txtimer.DatabasePersistencePolicyMBean
OBJECT_NAME
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
DatabasePersistencePolicy()
           
 
Method Summary
 void clearTimers()
          Delete all persisted timers
 void deleteTimer(String timerId, TimedObjectId timedObjectId)
          Removes the timer from persistent storage.
 String getDatabasePersistencePlugin()
           
 javax.management.ObjectName getDataSource()
           
 void handleNotification(javax.management.Notification notification, Object handback)
          Expects a notification from the server when it is done with startup
 void insertTimer(String timerId, TimedObjectId timedObjectId, Date firstEvent, long intervalDuration, Serializable info)
          Creates the timer in persistent storage.
 List listTimerHandles()
          Return a List of TimerHandle objects.
 void resetAndRestoreTimers()
          Re-read the current persistent timers list, clear the db of timers, and restore the timers.
 void restoreTimers()
          Restore the persistent timers seen during service startup
 void setDatabasePersistencePlugin(String dbpPluginClass)
           
 void setDataSource(javax.management.ObjectName dataSource)
           
 void startService()
          Initializes this service.
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop, stopService
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Constructor Detail

DatabasePersistencePolicy

public DatabasePersistencePolicy()
Method Detail

startService

public void startService()
                  throws Exception
Initializes this service.

Throws:
Exception

handleNotification

public void handleNotification(javax.management.Notification notification,
                               Object handback)
Expects a notification from the server when it is done with startup

Specified by:
handleNotification in interface javax.management.NotificationListener
Parameters:
notification - the notification object
handback - the handback object given to the broadcaster upon listener registration

insertTimer

public void insertTimer(String timerId,
                        TimedObjectId timedObjectId,
                        Date firstEvent,
                        long intervalDuration,
                        Serializable info)
Creates the timer in persistent storage.

Specified by:
insertTimer in interface PersistencePolicy
Parameters:
timerId - The timer id
timedObjectId - The timed object id
firstEvent - The point in time at which the first txtimer expiration must occur.
intervalDuration - The number of milliseconds that must elapse between txtimer expiration notifications.
info - A serializable handback object.

deleteTimer

public void deleteTimer(String timerId,
                        TimedObjectId timedObjectId)
Removes the timer from persistent storage.

Specified by:
deleteTimer in interface PersistencePolicy
Parameters:
timerId - The timer id
timedObjectId - The id of the timed object

listTimerHandles

public List listTimerHandles()
Return a List of TimerHandle objects.

Specified by:
listTimerHandles in interface PersistencePolicy

restoreTimers

public void restoreTimers()
Restore the persistent timers seen during service startup

Specified by:
restoreTimers in interface PersistencePolicy

clearTimers

public void clearTimers()
Delete all persisted timers

Specified by:
clearTimers in interface PersistencePolicy

resetAndRestoreTimers

public void resetAndRestoreTimers()
                           throws SQLException
Re-read the current persistent timers list, clear the db of timers, and restore the timers.

Specified by:
resetAndRestoreTimers in interface DatabasePersistencePolicyMBean
Throws:
SQLException

getDataSource

public javax.management.ObjectName getDataSource()
Specified by:
getDataSource in interface DatabasePersistencePolicyMBean

setDataSource

public void setDataSource(javax.management.ObjectName dataSource)
Specified by:
setDataSource in interface DatabasePersistencePolicyMBean

getDatabasePersistencePlugin

public String getDatabasePersistencePlugin()
Specified by:
getDatabasePersistencePlugin in interface DatabasePersistencePolicyMBean

setDatabasePersistencePlugin

public void setDatabasePersistencePlugin(String dbpPluginClass)
Specified by:
setDatabasePersistencePlugin in interface DatabasePersistencePolicyMBean


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.