Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.ejb.txtimer
Class GeneralPurposeDatabasePersistencePlugin

    java.lang.Object
      org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin

All Implemented Interfaces:
  DatabasePersistencePlugin

Direct Known Subclasses:
  OracleDatabasePersistencePlugin

public class GeneralPurposeDatabasePersistencePlugin
extends Object
implements DatabasePersistencePlugin

This DatabasePersistencePlugin uses getBytes/setBytes to persist the serializable objects associated with the timer.

Since:
  23-Sep-2004
Author:
  Thomas.Diesler@jboss.org

Field Summary
`protected javax.management.ObjectName` | `dataSourceName`
`protected DataSource` | `ds`
`protected javax.management.ObjectName` | `metaDataName`
`protected javax.management.MBeanServer` | `server`

Constructor Summary
`GeneralPurposeDatabasePersistencePlugin()`

Method Summary
`void` | `clearTimers()` Clear all persisted timers
`void` | `createTableIfNotExists()` Create the timer table if it does not exist already
`void` | `deleteTimer(String timerId, TimedObjectId timedObjectId)` Delete a timer.
`protected Object` | `deserialize(byte[] bytes)` Deserialize an object
`protected Object` | `deserialize(InputStream input)` Deserialize an object
`String` | `getColumnInfo()` Get the info column name
`String` | `getColumnInitialDate()` Get the initial date column name
`String` | `getColumnInstancePK()` Get the instance PK column name
`String` | `getColumnTargetID()` Get the target ID column name
`String` | `getColumnTimerID()` Get the timer ID column name
`String` | `getColumnTimerInterval()` Get the timer interval column name
`String` | `getTableName()` Get the timer table name
`void` | `init(javax.management.MBeanServer server, javax.management.ObjectName dataSourceName)` Initialize the plugin
`void` | `insertTimer(String timerId, TimedObjectId timedObjectId, Date initialExpiration, long intervalDuration, Serializable info)` Insert a timer object
`List` | `selectTimers()` Select a list of currently persisted timer handles
`protected byte[]` | `serialize(Object obj)` Serialize an object

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### dataSourceName

    protected javax.management.ObjectName dataSourceName

### server

    protected javax.management.MBeanServer server

### ds

    protected DataSource ds

### metaDataName

    protected javax.management.ObjectName metaDataName

Constructor Detail

### GeneralPurposeDatabasePersistencePlugin

    public GeneralPurposeDatabasePersistencePlugin()

Method Detail

### init

    public void init(javax.management.MBeanServer server,
                     javax.management.ObjectName dataSourceName)
              throws SQLException

  Initialize the plugin

  Specified by:
    `init` in interface `DatabasePersistencePlugin`
  Throws:
    `SQLException`

### createTableIfNotExists

    public void createTableIfNotExists()
                                throws SQLException

  Create the timer table if it does not exist already

  Specified by:
    `createTableIfNotExists` in interface `DatabasePersistencePlugin`
  Throws:
    `SQLException`

### insertTimer

    public void insertTimer(String timerId,
                            TimedObjectId timedObjectId,
                            Date initialExpiration,
                            long intervalDuration,
                            Serializable info)
                     throws SQLException

  Insert a timer object

  Specified by:
    `insertTimer` in interface `DatabasePersistencePlugin`
  Throws:
    `SQLException`

### selectTimers

    public List selectTimers()
                      throws SQLException

  Select a list of currently persisted timer handles

  Specified by:
    `selectTimers` in interface `DatabasePersistencePlugin`
  Returns:
    List
  Throws:
    `SQLException`

### deleteTimer

    public void deleteTimer(String timerId,
                            TimedObjectId timedObjectId)
                     throws SQLException

  Delete a timer.

  Specified by:
    `deleteTimer` in interface `DatabasePersistencePlugin`
  Throws:
    `SQLException`

### clearTimers

    public void clearTimers()
                     throws SQLException

  Clear all persisted timers

  Specified by:
    `clearTimers` in interface `DatabasePersistencePlugin`
  Throws:
    `SQLException`

### getTableName

    public String getTableName()

  Get the timer table name

  Specified by:
    `getTableName` in interface `DatabasePersistencePlugin`

### getColumnTimerID

    public String getColumnTimerID()

  Get the timer ID column name

  Specified by:
    `getColumnTimerID` in interface `DatabasePersistencePlugin`

### getColumnTargetID

    public String getColumnTargetID()

  Get the target ID column name

  Specified by:
    `getColumnTargetID` in interface `DatabasePersistencePlugin`

### getColumnInitialDate

    public String getColumnInitialDate()

  Get the initial date column name

  Specified by:
    `getColumnInitialDate` in interface `DatabasePersistencePlugin`

### getColumnTimerInterval

    public String getColumnTimerInterval()

  Get the timer interval column name

  Specified by:
    `getColumnTimerInterval` in interface `DatabasePersistencePlugin`

### getColumnInstancePK

    public String getColumnInstancePK()

  Get the instance PK column name

  Specified by:
    `getColumnInstancePK` in interface `DatabasePersistencePlugin`

### getColumnInfo

    public String getColumnInfo()

  Get the info column name

  Specified by:
    `getColumnInfo` in interface `DatabasePersistencePlugin`

### serialize

    protected byte[] serialize(Object obj)

  Serialize an object

### deserialize

    protected Object deserialize(byte[] bytes)

  Deserialize an object

### deserialize

    protected Object deserialize(InputStream input)

  Deserialize an object

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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