com.arjuna.wst.stub
Class LocalParticipantCompletionParticipantStub

java.lang.Object
  extended by com.arjuna.wst.stub.LocalParticipantCompletionParticipantStub
All Implemented Interfaces:
BusinessAgreementWithParticipantCompletionParticipant, PersistableParticipant
Direct Known Subclasses:
LocalCoordinatorCompletionParticipantStub

public class LocalParticipantCompletionParticipantStub
extends java.lang.Object
implements BusinessAgreementWithParticipantCompletionParticipant, PersistableParticipant

wrapper class allowing an application participant to be registered directly with the local coordinator service. obvioulsy this wrapper cuts out the network hop delivering messgaes from coordinator to participant and vice versa. it also differs from the remote stub in two further respects. firstly, it saves and restores the participant details embedded directly in the coordinator (transaction) log record rather than in a separate participant record. this still requires use of an application registered helper module to recreate the participant from its saved state. secondly, it does not currently propagate the participant manager details to the underlying participant.


Field Summary
protected  java.lang.String id
           
protected  BusinessAgreementWithParticipantCompletionParticipant participant
           
 
Constructor Summary
LocalParticipantCompletionParticipantStub()
           
LocalParticipantCompletionParticipantStub(BusinessAgreementWithParticipantCompletionParticipant participant, java.lang.String id)
           
 
Method Summary
 void cancel()
          The transaction has cancelled, and the participant should undo any work.
 void close()
          The transaction has completed successfully.
 void compensate()
          The transaction has cancelled.
 void error()
          If the participant enquired as to the status of the transaction it was registered with and an error occurs (e.g., the transaction service is unavailable) then this operation will be invoked.
 boolean restoreState(com.arjuna.ats.arjuna.state.InputObjectState ios)
          Restore the state of the particpant from the specified input object stream.
 boolean saveState(com.arjuna.ats.arjuna.state.OutputObjectState oos)
          Save the state of the particpant to the specified input object stream.
 java.lang.String status()
           
 void unknown()
          If the participant enquires as to the status of the transaction it was registered with and that transaction is no longer available (has rolled back) then this operation will be invoked by the coordination service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

participant

protected BusinessAgreementWithParticipantCompletionParticipant participant

id

protected java.lang.String id
Constructor Detail

LocalParticipantCompletionParticipantStub

public LocalParticipantCompletionParticipantStub(BusinessAgreementWithParticipantCompletionParticipant participant,
                                                 java.lang.String id)

LocalParticipantCompletionParticipantStub

public LocalParticipantCompletionParticipantStub()
Method Detail

close

public void close()
           throws WrongStateException,
                  SystemException
The transaction has completed successfully. The participant previously informed the coordinator that it was ready to complete.

Specified by:
close in interface BusinessAgreementWithParticipantCompletionParticipant
Throws:
WrongStateException
SystemException

cancel

public void cancel()
            throws FaultedException,
                   WrongStateException,
                   SystemException
The transaction has cancelled, and the participant should undo any work. The participant cannot have informed the coordinator that it has completed.

Specified by:
cancel in interface BusinessAgreementWithParticipantCompletionParticipant
Throws:
FaultedException
WrongStateException
SystemException

compensate

public void compensate()
                throws FaultedException,
                       WrongStateException,
                       SystemException
The transaction has cancelled. The participant previously informed the coordinator that it had finished work but could compensate later if required, so it is now requested to do so.

Specified by:
compensate in interface BusinessAgreementWithParticipantCompletionParticipant
Throws:
FaultedException - if the participant was unable to perform the required compensation action because of an unrecoverable error. The coordinator is notified of this fault and as a result will stop resending compensation requests.
SystemException - if the participant was unable to perform the required compensation action because of a transient fault. The coordinator is not notified of this fault so it will retry the compensate request after a suitable timeout.
WrongStateException

status

public java.lang.String status()
                        throws SystemException
Specified by:
status in interface BusinessAgreementWithParticipantCompletionParticipant
Returns:
the status value.
Throws:
SystemException

unknown

public void unknown()
             throws SystemException
If the participant enquires as to the status of the transaction it was registered with and that transaction is no longer available (has rolled back) then this operation will be invoked by the coordination service.

Specified by:
unknown in interface BusinessAgreementWithParticipantCompletionParticipant
Throws:
SystemException

error

public void error()
           throws SystemException
If the participant enquired as to the status of the transaction it was registered with and an error occurs (e.g., the transaction service is unavailable) then this operation will be invoked.

Specified by:
error in interface BusinessAgreementWithParticipantCompletionParticipant
Throws:
SystemException

saveState

public boolean saveState(com.arjuna.ats.arjuna.state.OutputObjectState oos)
Save the state of the particpant to the specified input object stream.

Specified by:
saveState in interface PersistableParticipant
Parameters:
oos - The output output stream.
Returns:
true if persisted, false otherwise.

restoreState

public boolean restoreState(com.arjuna.ats.arjuna.state.InputObjectState ios)
Restore the state of the particpant from the specified input object stream.

Specified by:
restoreState in interface PersistableParticipant
Parameters:
ios - The Input object stream.
Returns:
true if restored, false otherwise.