* Exiting -> Exiting (resend Exit)
* Ended -> Ended (send Canceled)
*/
public void cancel(final NotificationType cancel, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
{
final State current ;
synchronized(this)
{
current = state ;
if ((current == State.STATE_ACTIVE) || (current == State.STATE_COMPLETING))
{
changeState(State.STATE_CANCELING) ;
}
}
if (current == State.STATE_ACTIVE)
{
executeCancel(false) ;
}
else if (current == State.STATE_COMPLETING)
{
executeCancel(true) ;
}
else if (current == State.STATE_COMPLETED)
{
sendCompleted() ;
}
else if ((current == State.STATE_FAILING_ACTIVE) || (current == State.STATE_FAILING_CANCELING) ||
(current == State.STATE_FAILING_COMPLETING))
{
sendFail(current.getValue()) ;
}
else if (current == State.STATE_NOT_COMPLETING)
{
sendCannotComplete() ;
}