Package com.orchestranetworks.d3.slave

# Class D3ReceiveBroadcastTrigger

java.lang.Object
com.orchestranetworks.d3.slave.D3ReceiveBroadcastTrigger

public abstract class D3ReceiveBroadcastTrigger extends Object
Specifies methods that are automatically invoked when receiving broadcast from the D3 primary node.

### Trigger definition

This belongs to the D3 replica delivery dataspace. Therefore to define it, using EBX® manager:

- go to the administration item '[D3] Replica Configuration', then 'Delivery dataspaces' table,
- select the concerned delivery dataspace record,
- write the full class name in broadcast trigger field.

This class must not be in an EBX® module and must be accessible from the class-loader of `ebx.jar`. On submit, if the class is not found or does not extend `D3ReceiveBroadcastTrigger`, a validation error is displayed.

### Life cycle

1. The trigger is instantiated after received the broadcast content from the primary node.
2. The method `handleBeforeBroadcast(D3ReceiveBroadcastBeforeContext)` is invoked in order to perform custom operations.
3. If no exception occurs, the broadcast content is applied in the delivery dataspace, then an acknowledgment is sent to the primary node.
4. If an exception occurs on trigger invocation, the archive importation is aborted and a failure acknowledgment is sent to the primary node.
5. When the transaction ends, the method `handleAfterBroadcast(D3ReceiveBroadcastAfterContext)` is invoked to perform custom operations.

### Limitation

The implementation of trigger methods does not take part in the transaction.

Since:
  5.5.1

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `D3ReceiveBroadcastTrigger()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `handleAfterBroadcast(D3ReceiveBroadcastAfterContext aContext)`
  This method is called after the transaction whatever the status.
  `void`
  `handleBeforeBroadcast(D3ReceiveBroadcastBeforeContext aContext)`
  This method is called before applying the broadcast content in the replica node.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### D3ReceiveBroadcastTrigger

    public D3ReceiveBroadcastTrigger()

- ## Method Details

  - ### handleBeforeBroadcast

    public void handleBeforeBroadcast(D3ReceiveBroadcastBeforeContext aContext) throws OperationException
    This method is called before applying the broadcast content in the replica node.

    The default implementation does nothing.

    Throws:
      `OperationException` - to be thrown when an unexpected exception occurs. As a consequence, a failure acknowledgment is sent to the primary node and the exception is logged.
    Since:
      5.5.1

  - ### handleAfterBroadcast

    public void handleAfterBroadcast(D3ReceiveBroadcastAfterContext aContext) throws OperationException
    This method is called after the transaction whatever the status.

    The default implementation does nothing.

    Throws:
      `OperationException` - to be thrown when an unexpected exception occurs. As a consequence, the exception is logged.
    Since:
      5.5.1