diff options
author | bala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-11-12 18:49:19 +0000 |
---|---|---|
committer | bala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-11-12 18:49:19 +0000 |
commit | 2bf202d5d14b50d78f0a763086a0c6c8250542a8 (patch) | |
tree | 0cc3c26b5c6f6833ce11a7212d9165f1205f22d9 /TAO/tao/LF_Invocation_Event.cpp | |
parent | 0d8e4ec1c7da4b9a15175090826dbfb953de2bd4 (diff) | |
download | ATCD-2bf202d5d14b50d78f0a763086a0c6c8250542a8.tar.gz |
ChangeLogTag: Tue Nov 12 12:47:31 2002 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu>
Diffstat (limited to 'TAO/tao/LF_Invocation_Event.cpp')
-rw-r--r-- | TAO/tao/LF_Invocation_Event.cpp | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/TAO/tao/LF_Invocation_Event.cpp b/TAO/tao/LF_Invocation_Event.cpp new file mode 100644 index 00000000000..4394098e2fb --- /dev/null +++ b/TAO/tao/LF_Invocation_Event.cpp @@ -0,0 +1,93 @@ +// -*- C++ -*- +#include "LF_Invocation_Event.h" + + +#if !defined (__ACE_INLINE__) +# include "tao/LF_Invocation_Event.inl" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(tao, + LF_Invocation_Event, + "$Id$") + +TAO_LF_Invocation_Event::TAO_LF_Invocation_Event (void) + : TAO_LF_Event () +{ +} + +TAO_LF_Invocation_Event::~TAO_LF_Invocation_Event (void) +{ +} + +void +TAO_LF_Invocation_Event::state_changed_i (int new_state) +{ + if (this->state_ == new_state) + return; + + // Validate the state change + if (this->state_ == TAO_LF_Event::LFS_IDLE) + { + // From the LFS_IDLE state we can only become active. + if (new_state == TAO_LF_Event::LFS_ACTIVE + || new_state == TAO_LF_Event::LFS_CONNECTION_CLOSED) + this->state_ = new_state; + return; + } + else if (this->state_ == TAO_LF_Event::LFS_ACTIVE) + { + // From LFS_ACTIVE we can only move to a few states + if (new_state != TAO_LF_Event::LFS_IDLE) + { + if (new_state == TAO_LF_Event::LFS_CONNECTION_CLOSED) + { + this->state_ = TAO_LF_Event::LFS_FAILURE; + } + else + { + this->state_ = new_state; + } + } + return; + } + else if (this->state_ == TAO_LF_Event::LFS_SUCCESS + || this->state_ == TAO_LF_Event::LFS_CONNECTION_CLOSED) + { + // From the two states above we can go back to ACTIVE, as when a + // request is restarted. + if (new_state == TAO_LF_Event::LFS_ACTIVE) + { + this->state_ = new_state; + } + return; + } + else/* if (this->state_ == TAO_LF_Event::LFS_TIMEOUT || FAILURE */ + { + // Other states are final.. + } + +} + +int +TAO_LF_Invocation_Event::successful (void) const +{ + return this->state_ == TAO_LF_Event::LFS_SUCCESS; +} + +int +TAO_LF_Invocation_Event::error_detected (void) const +{ + return (this->state_ == TAO_LF_Event::LFS_FAILURE + || this->state_ == TAO_LF_Event::LFS_TIMEOUT + || this->state_ == TAO_LF_Event::LFS_CONNECTION_CLOSED); +} + +int +TAO_LF_Invocation_Event::is_state_final (void) +{ + if (this->state_ == TAO_LF_Event::LFS_TIMEOUT || + this->state_ == TAO_LF_Event::LFS_FAILURE) + return 1; + + return 0; +} |