2 #include "tao/LF_Invocation_Event.h"
4 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
6 TAO_LF_Invocation_Event::TAO_LF_Invocation_Event ()
11 TAO_LF_Invocation_Event::~TAO_LF_Invocation_Event ()
16 TAO_LF_Invocation_Event::state_changed_i (LFS_STATE new_state
)
18 if (this->state_
== new_state
)
21 // Validate the state change
22 if (this->state_
== TAO_LF_Event::LFS_IDLE
)
24 // From the LFS_IDLE state we can only become active.
25 if (new_state
== TAO_LF_Event::LFS_ACTIVE
26 || new_state
== TAO_LF_Event::LFS_CONNECTION_CLOSED
)
27 this->state_
= new_state
;
30 else if (this->state_
== TAO_LF_Event::LFS_ACTIVE
)
32 // From LFS_ACTIVE we can only move to a few states
33 if (new_state
!= TAO_LF_Event::LFS_IDLE
)
35 if (new_state
== TAO_LF_Event::LFS_CONNECTION_CLOSED
)
37 this->state_
= TAO_LF_Event::LFS_FAILURE
;
41 this->state_
= new_state
;
46 else if (this->state_
== TAO_LF_Event::LFS_SUCCESS
47 || this->state_
== TAO_LF_Event::LFS_CONNECTION_CLOSED
)
49 // From the two states above we can go back to ACTIVE, as when a
50 // request is restarted.
51 if (new_state
== TAO_LF_Event::LFS_ACTIVE
)
53 this->state_
= new_state
;
57 else/* if (this->state_ == TAO_LF_Event::LFS_TIMEOUT || FAILURE */
59 // Other states are final..
65 TAO_LF_Invocation_Event::successful_i () const
67 return this->state_
== TAO_LF_Event::LFS_SUCCESS
;
71 TAO_LF_Invocation_Event::error_detected_i () const
73 return (this->state_
== TAO_LF_Event::LFS_FAILURE
74 || this->state_
== TAO_LF_Event::LFS_TIMEOUT
75 || this->state_
== TAO_LF_Event::LFS_CONNECTION_CLOSED
);
79 TAO_LF_Invocation_Event::is_state_final () const
81 if (this->state_
== TAO_LF_Event::LFS_TIMEOUT
||
82 this->state_
== TAO_LF_Event::LFS_FAILURE
)
88 TAO_END_VERSIONED_NAMESPACE_DECL