com.ibm.websphere.sdo.mediator.ejb

Interface MediatorAdapter


  1. public interface MediatorAdapter
Implemented by a user class to customize the processing of graph changes. The adapter can be used in situations when there are create methods other than create(PrimaryKey) or when business methods must be called instead of cmp setter methods or when special optimistic caching logic is needed.

Three passes are made over DataGraph Log passing changed DataObjects to the applyChange method.

In pass 1 new DataObjects are passed. Adapter should create the EJB instance and set the cmp fields. CMRs that reference EJBs that have not been created yet must be deferred to pass 2.

In pass 2 new and updated DataObjects are passed. CMRs deferred from pass 1 can be set at this time.

In pass 3 deleted DataObjects are passed.

Adapter return true if it has processed the change and return false to have the mediator process the change.


Field Summary

Modifier and Type Field and Description
  1. static
  2. int
CREATE
Pass 1 to handle creation of new EJBs.
  1. static
  2. int
REMOVE
Pass 3 to handle EJB removal.
  1. static
  2. int
UPDATE
Pass 2 to handle update of cmp fields and ejb relationships.

Method Summary

Modifier and Type Method and Description
  1. boolean
applyChange(commonj.sdo.DataObject object,int phase)
A changed DataObject is passed to the adapter.
  1. void
end()
Called after pass 3 to clean up any resources.
  1. void
init(commonj.sdo.ChangeSummary log)
Called before pass 1 to allow adapter class to initialize itself.

Field Detail

CREATE

  1. static final int CREATE
Pass 1 to handle creation of new EJBs.
See Also:

UPDATE

  1. static final int UPDATE
Pass 2 to handle update of cmp fields and ejb relationships.
See Also:

REMOVE

  1. static final int REMOVE
Pass 3 to handle EJB removal.
See Also:

Method Detail

applyChange

  1. boolean applyChange(commonj.sdo.DataObject object,
  2. int phase)
  3. throws QueryException
A changed DataObject is passed to the adapter.
Parameters:
object - The changed DataObject from the graph log.
phase - Processing phase.
Returns:
True if adapter has handled the changed object, false if the mediator should process the change.
Throws:
QueryException - The adapter throwing an excption will cause the mediator to abort processing.

end

  1. void end()
Called after pass 3 to clean up any resources.

init

  1. void init(commonj.sdo.ChangeSummary log)
Called before pass 1 to allow adapter class to initialize itself.
Parameters:
log - The graph log.