com.orchestranetworks.schema.trigger
Class InstanceTrigger

java.lang.Object
  extended bycom.orchestranetworks.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:

 <osd: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:
 <osd:trigger class="com.foo.MyInstanceTrigger">
 	 <param1>...</param1>
 	 <param2>...</param2>
 </osd: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)
                        throws OperationException
This method is called before the creation of an instance.

Default implementation does nothing.

Throws:
OperationException - when an exception occurred or for preventing the execution of the subsequent creation (guard role). Warning: in case of a mass update the whole transaction is aborted.

handleAfterCreate

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

Default implementation does nothing.

Throws:
OperationException - when an exception occurred. Warning: in case of a mass update the whole transaction is aborted.

handleBeforeDelete

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

Default implementation does nothing.

Throws:
OperationException - when an exception occurred or for preventing the execution of the subsequent deletion (guard role). Warning: in case of a mass update the whole transaction is aborted.

handleAfterDelete

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

Default implementation does nothing.

Throws:
OperationException - when an exception occurred. Warning: in case of a mass update the whole transaction is aborted.


(report a bug)
EBX.Platform 4.5.2 [0601:0004]
Copyright Orchestra Networks 2000-2008. All rights reserved.