com.softwareag.mdm.schema.trigger
Class InstanceTrigger

java.lang.Object
  extended bycom.softwareag.mdm.schema.trigger.InstanceTrigger

public abstract class InstanceTrigger
extends Object

Specifies methods that are automatically executed when some operations are performed on an instance.

Schema definition

The trigger must be declared under the element xs:annotation/xs:appinfo:

 <mdm:trigger class="com.foo.MyInstanceTrigger" />
where com.foo.MyInstanceTrigger is the fully qualified name of the class implementing this interface. It is also possible to set additional JavaBean properties:
 <mdm:trigger class="com.foo.MyInstanceTrigger">
 	 <param1>...</param1>
 	 <param2>...</param2>
 </mdm:trigger>
where param1 and param2 are JavaBean properties of the class specified.

For more information, read JavaBeans specification.

Life-cycle

  1. When the schema is loaded:
    1. the class specified is instantiated through its default constructor and the JavaBean properties' setters are called (in the example above, setParam1(...) and setParam2(...));
    2. the method setup(TriggerSetupContext) is called on the new instance.
  2. In operational phase: the methods handle... are called each time the associated operation is executed.

If several operations are defined for the same instance, no specific ordering in their execution must be assumed.


Constructor Summary
InstanceTrigger()
           
 
Method Summary
 void handleAfterCreate(AfterCreateInstanceContext aContext)
          This method is called after the creation of an instance.
 void handleAfterDelete(AfterDeleteInstanceContext aContext)
          This method is called after the deletion of an instance.
 void handleBeforeCreate(BeforeCreateInstanceContext aContext)
          This method is called before the creation of an instance.
 void handleBeforeDelete(BeforeDeleteInstanceContext aContext)
          This method is called before the deletion of an instance.
abstract  void setup(TriggerSetupContext aContext)
          This method is called when the schema is loaded, for checking and preparing this instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstanceTrigger

public InstanceTrigger()
Method Detail

setup

public abstract void setup(TriggerSetupContext aContext)
This method is called when the schema is loaded, for checking and preparing this instance.


handleBeforeCreate

public void handleBeforeCreate(BeforeCreateInstanceContext aContext)
This method is called before the creation of an instance.

Default implementation does nothing.


handleAfterCreate

public void handleAfterCreate(AfterCreateInstanceContext aContext)
This method is called after the creation of an instance.

Default implementation does nothing.


handleBeforeDelete

public void handleBeforeDelete(BeforeDeleteInstanceContext aContext)
This method is called before the deletion of an instance.

Default implementation does nothing.


handleAfterDelete

public void handleAfterDelete(AfterDeleteInstanceContext aContext)
This method is called after the deletion of an instance.

Default implementation does nothing.



(report a bug)
webMethods MDM 4.2.8 [0558]
Copyright Software AG 2000-2007. All rights reserved.