|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UserBusinessActivity
This interface allows the application programmer to access the
Business Activity on the current thread. This API allows
the user to pass compensation data to the runtime that will be
used later by the CompensationHandler
on completion of
the Business Activity. The application programmer can also modify
or check the completion direction of the current Business Activity.
Method Summary | |
---|---|
boolean |
isCompensateOnly()
|
void |
setCompensateOnly()
Calling setCompensateOnly will force the Business Activity to compensate all active CompensationHandler s that have
been added. |
void |
setCompensationDataAtCommit(commonj.sdo.DataObject compensationData)
Invoked to configure the CompensationHandler behaviour on completion
of the underlying Business Activity. |
void |
setCompensationDataImmediate(commonj.sdo.DataObject compensationData)
Invoked to configure the CompensationHandler behaviour on completion
of the underlying Business Activity. |
Method Detail |
---|
void setCompensateOnly() throws java.lang.IllegalStateException
CompensationHandler
s that have
been added. This will occur upon the completion of the current Business
Activity. Once setCompensateOnly()
has been called, the
Business Activity can will never complete successfully.
java.lang.IllegalStateException
- if there is no Business Activity
available on threadboolean isCompensateOnly() throws java.lang.IllegalStateException
setCompensateOnly()
or
the underlying UOW/BPEL has been marked to fail only (e.g.
setRollbackOnly()
has been called on a JTA transaction),
false otherwise.
java.lang.IllegalStateException
- if there is no Business Activity
available on threadvoid setCompensationDataAtCommit(commonj.sdo.DataObject compensationData) throws java.lang.IllegalStateException, java.io.NotSerializableException
CompensationHandler
behaviour on completion
of the underlying Business Activity. When this method is called for
the first time any CompensationHandler
configured by the calling
component will be associated with the underlying Business Activity.
The compensation data passed in as a parameter will be logged.
A CompensationHandler
can be in one of two states; active or inactive.
Only active CompensationHandler
s are driven as part of the completion
process of a Business Activity.
If there is a global transaction present when this method is called
then the CompensationHandler
will be inactive until the global
transaction commits, when it will be made active. If the global
transaction rolls back, the CompensationHandler
will be discarded and
never driven to compensate or close.
If a global transaction not is present, the CompensationHandler
will
be marked as active immediately and will be driven compensate or
close upon completion of the Business Activity.
Subsequent calls to this method from within in the same application
component and Business Activity cause any previous compensation data
to be updated with the compensation data passed in on this invocation.
A new CompensationHandler
will not be added every time this method
is invoked. Any CompensationHandler
added using this method will
never be overwritten by the setCompensationDataImmediate method. If
both methods are called within the same application component and
Business Activity, two CompensationHandler
s will be added.
If null is passed as a parameter, the CompensationHandler
will be
removed from the Business Activity and not driven to close or compensate during
completion of the Business Activity.
compensationData
- the data logged at runtime to be used at the time of
Business Activity completion by the CompensationHandler
. This is
in the form of an SDO DataObject
.
java.lang.IllegalStateException
- if there is no Business Activity
available on thread.
java.io.NotSerializableException
- if the compensationData cannot be
serialized.void setCompensationDataImmediate(commonj.sdo.DataObject compensationData) throws java.lang.IllegalStateException, java.io.NotSerializableException
CompensationHandler
behaviour on completion
of the underlying Business Activity. When this method is called for
the first time any CompensationHandler
configured by the calling
component will be associated with the underlying Business Activity.
The compensation data passed in as a parameter will be logged.
A CompensationHandler
can be in one of two states; active or inactive.
Only active CompensationHandler
s are driven as part of the completion
process of a Business Activity.
Any CompensationHandler
added to a Business Activity through this
method will be marked active immediately. This guarantees that the
CompensationHandler
added will be driven to compensate or close upon
completion of the Business Activity.
Subsequent calls to this method from within in the same application
component and Business Activity cause any previous compensation data
to be updated with the compensation data passed in on this invocation.
A new CompensationHandler
will not be added every time this method
is invoked. Any CompensationHandler
added using this method will
never be overwritten by the setCompensationDataAtCommit method. If
both methods are called within the same application component and
Business Activity, two CompensationHandler
s will be added.
If null is passed as a parameter, the CompensationHandler
will be
removed from the Business Activity and not driven to close or compensate during
completion of the Business Activity.
compensationData
- the data logged at runtime to be used at the time of
Business Activity completion by the CompensationHandler
. This is
in the form of an SDO DataObject
.
java.lang.IllegalStateException
- if there is no Business Activity
available on thread.
java.io.NotSerializableException
- if the compensationData cannot be
serialized.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |