dbXML API

com.dbxml.db.core.trigger
Class TriggerManager

java.lang.Object
  extended bycom.dbxml.util.SimpleConfigurable
      extended bycom.dbxml.db.core.trigger.TriggerManager
All Implemented Interfaces:
Configurable

public class TriggerManager
extends SimpleConfigurable

TriggerManager manages Trigger instances


Constructor Summary
TriggerManager(Collection collection)
           
 
Method Summary
 Trigger create(Configuration cfg)
          create creates a new Trigger object and any associated system resources that the Trigger will need.
 boolean drop(java.lang.String name)
          drop physically removes the specified Trigger and any associated system resources that the Trigger uses.
 void fireAfterDelete(Transaction tx, Key key, java.lang.Object oldObj)
          fireAfterDelete fires afterDelete events to all of the registered Triggers, unless a DBException is thrown.
 void fireAfterGet(Transaction tx, Key key, java.lang.Object obj)
          fireAfterGet fires afterGet events to all of the registered Triggers, unless a DBException is thrown.
 void fireAfterInsert(Transaction tx, Key key, java.lang.Object newObj)
          fireAfterInsert fires afterInsert events to all of the registered Triggers, unless a DBException is thrown.
 void fireAfterUpdate(Transaction tx, Key key, java.lang.Object oldObj, java.lang.Object newObj)
          fireAfterUpdate fires afterUpdate events to all of the registered Triggers, unless a DBException is thrown.
 void fireBeforeDelete(Transaction tx, Key key, java.lang.Object oldObj)
          fireBeforeDelete fires beforeDelete events to all of the registered Triggers, unless a DBException is thrown.
 void fireBeforeGet(Transaction tx, Key key)
          fireBeforeGet fires beforeGet events to all of the registered Triggers, unless a DBException is thrown.
 java.lang.Object fireBeforeInsert(Transaction tx, Key key, java.lang.Object newObj)
          fireBeforeInsert fires beforeInsert events to all of the registered Triggers, unless a DBException is thrown.
 java.lang.Object fireBeforeUpdate(Transaction tx, Key key, java.lang.Object oldObj, java.lang.Object newObj)
          fireBeforeUpdate fires beforeUpdate events to all of the registered Triggers, unless a DBException is thrown.
 Trigger get(java.lang.String name)
          get retrieves an Trigger by name, and will also do the work of instantiation and pool-retrieval.
 java.lang.String getCanonicalName(java.lang.String name)
           
 java.lang.String[] list()
          list returns a list of the Triggers that this TriggerManager has registered.
 void setConfig(Configuration config)
          setConfig sets the configuration information for the Configurable object instance.
 
Methods inherited from class com.dbxml.util.SimpleConfigurable
getConfig
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TriggerManager

public TriggerManager(Collection collection)
Method Detail

setConfig

public void setConfig(Configuration config)
               throws dbXMLException
Description copied from interface: Configurable
setConfig sets the configuration information for the Configurable object instance.

Specified by:
setConfig in interface Configurable
Overrides:
setConfig in class SimpleConfigurable
Throws:
dbXMLException

list

public java.lang.String[] list()
list returns a list of the Triggers that this TriggerManager has registered.

Returns:
An array containing the Trigger names

drop

public boolean drop(java.lang.String name)
             throws DBException
drop physically removes the specified Trigger and any associated system resources that the Trigger uses.

Parameters:
name - The Trigger to drop
Returns:
Whether or not the Trigger was dropped
Throws:
DBException

create

public Trigger create(Configuration cfg)
               throws DBException
create creates a new Trigger object and any associated system resources that the Trigger will need.

Parameters:
cfg - The Trigger's configuration
Returns:
The Trigger that was created
Throws:
DBException

get

public Trigger get(java.lang.String name)
            throws DBException
get retrieves an Trigger by name, and will also do the work of instantiation and pool-retrieval.

Parameters:
name - The Trigger name
Returns:
The Trigger
Throws:
DBException

getCanonicalName

public java.lang.String getCanonicalName(java.lang.String name)

fireBeforeInsert

public java.lang.Object fireBeforeInsert(Transaction tx,
                                         Key key,
                                         java.lang.Object newObj)
                                  throws DBException
fireBeforeInsert fires beforeInsert events to all of the registered Triggers, unless a DBException is thrown.

Parameters:
tx - The controlling Transaction
key - The Object Key
newObj - the new Object
Returns:
The modified or original new Object
Throws:
DBException

fireAfterInsert

public void fireAfterInsert(Transaction tx,
                            Key key,
                            java.lang.Object newObj)
                     throws DBException
fireAfterInsert fires afterInsert events to all of the registered Triggers, unless a DBException is thrown.

Parameters:
tx - The controlling Transaction
key - The Object Key
newObj - The new Object
Throws:
DBException

fireBeforeUpdate

public java.lang.Object fireBeforeUpdate(Transaction tx,
                                         Key key,
                                         java.lang.Object oldObj,
                                         java.lang.Object newObj)
                                  throws DBException
fireBeforeUpdate fires beforeUpdate events to all of the registered Triggers, unless a DBException is thrown.

Parameters:
tx - The controlling Transaction
key - The Object Key
oldObj - The old Object
newObj - The new Object
Returns:
The modified or original new Object*
Throws:
DBException

fireAfterUpdate

public void fireAfterUpdate(Transaction tx,
                            Key key,
                            java.lang.Object oldObj,
                            java.lang.Object newObj)
                     throws DBException
fireAfterUpdate fires afterUpdate events to all of the registered Triggers, unless a DBException is thrown.

Parameters:
tx - The controlling Transaction
key - The Object Key
oldObj - The old Object
newObj - The new Object
Throws:
DBException

fireBeforeDelete

public void fireBeforeDelete(Transaction tx,
                             Key key,
                             java.lang.Object oldObj)
                      throws DBException
fireBeforeDelete fires beforeDelete events to all of the registered Triggers, unless a DBException is thrown.

Parameters:
tx - The controlling Transaction
key - The Object Key
oldObj - The old Object
Throws:
DBException

fireAfterDelete

public void fireAfterDelete(Transaction tx,
                            Key key,
                            java.lang.Object oldObj)
                     throws DBException
fireAfterDelete fires afterDelete events to all of the registered Triggers, unless a DBException is thrown.

Parameters:
tx - The controlling Transaction
key - The Object Key
oldObj - The old Object
Throws:
DBException

fireBeforeGet

public void fireBeforeGet(Transaction tx,
                          Key key)
                   throws DBException
fireBeforeGet fires beforeGet events to all of the registered Triggers, unless a DBException is thrown.

Parameters:
tx - The controlling Transaction
key - The Object Key
Throws:
DBException

fireAfterGet

public void fireAfterGet(Transaction tx,
                         Key key,
                         java.lang.Object obj)
                  throws DBException
fireAfterGet fires afterGet events to all of the registered Triggers, unless a DBException is thrown.

Parameters:
tx - The controlling Transaction
key - The Object Key
obj - The Object
Throws:
DBException

dbXML API

Copyright (c) 2004 The dbXML Group