com.ibm.wsspi.sibx.mediation
Interface Mediation
- public interface Mediation
Any mediation implementation must conform the the JavaBean specification by implementing a default constructor, and getters/setters for all properties. Indexed properties must be implemented using arrays, with the appropriate getters and setters.
A mediation primitive has the following lifecycle:
- The mediation engine will call the default constructor.
- The mediation engine will set all properties on the mediation primitive.
- The mediation engine will create the
MediationServices
(including creating the input and output terminals) and set it using thesetMediationServices
method. - The mediation engine will call the
init
method upon when the mediation primitive can perform any necessary initialization. The engine will only call init() once. - At this point, the mediation is deemed to be ready, and the runtime will
begin to invoke flows resulting in the
mediate
method being called.
Note that mediation primitives are stateless objects, and the same instance is not guaranteed to be called on subsequent invocations of a flow. Also note that there is no explicit termination of the mediation, and as such, primitives should not maintain long-running resources such as database connections.
In the mediate
method, the mediation primitive may perform
inspection and modification of the message. It may fire output terminals in
any order, and at any time. The same output terminal may be fired multiple
times. It may also throw a
MediationConfigurationException
or a
MediationBusinessException
to represent an error in the mediation processing. The mediation flow engine
will invoke any failure terminal automatically on the throwing of an
exception.
Field Summary
Modifier and Type | Field and Description |
---|---|
|
$sccsid
|
|
COPYRIGHT
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
init()
Initialises the mediation.
|
|
mediate(InputTerminal inputTerminal,commonj.sdo.DataObject message)
Invoked when a message arrives at the specified input terminal of this
mediation primitive.
|
|
setMediationServices(MediationServices mediationServices)
Sets the mediation services.
|
Field Detail
COPYRIGHT
- static final java.lang.String COPYRIGHT
$sccsid
- static final java.lang.String $sccsid
Method Detail
setMediationServices
- void setMediationServices(MediationServices mediationServices)
mediationServices
- the mediation services object init
- void init()
- throws MediationConfigurationException
MediationConfigurationException
- if any configuration problems
occur in the initialization of this mediation primitive. mediate
- void mediate(InputTerminal inputTerminal,
- commonj.sdo.DataObject message)
- throws MediationConfigurationException
- MediationBusinessException
inputTerminal
- the input terminal being invoked message
- the message to mediate MediationConfigurationException
- if there is a problem with the
configuration of the mediation primitive MediationBusinessException
- if there is a problem with the
business logic processing of the mediation primitive