NAME
Oorb::StateMgrTask - State-manager task for the oorb library
SYNOPSIS
-loorb $(ORBLIBS)
#include "oorb.h"
namespace Oorb
class StateMgrTask
DESCRIPTION
The
StateMgrTask class is used internally by the
Oorb(3)
library. The
Oorb::Master(3) class within an
Oorb(3)-library
based program automatically instantiates and calls the
run method
on an object of the
StateMgrTask class.
The
StateMgrTask's main job is to read and write information
on the state of each orb connection to a
statefile designated by the
program. If the
statefile parameter (see below) of the
StateMgrTask is empty, no state information is read or written.
The
StateMgrTask will attempt to upgrade state files from older
orb2orb(1) state-file formats to the current format. State file information
not currently being used by active connections will be preserved if they
are not too old. State-file entries with
last_update time older
than the configured
retain_unused_stateinfo_sec parameter will be purged.
CONSTRUCTORS
-
StateMgrTask( void )
The StateMgrTask constructor is invoked automatically from
within the Oorb::Master(3) run method and should not
need to be called by application programmers.
METHODS
-
void run( void );
The StateMgrTask's run method is invoked automatically from
within the Oorb::Master(3) run method and should not
need to be called by application programmers.
-
std::shared_ptr<StateVector> getStateVector( std::string taskName, std::string orbname );
The getStateVector method retrieves a shared_ptr to a StateVector for the
given task taskName and orbserver(1) orbname, creating a new
StateVector if necessary. If the orbserver(1) is an forbserver(1) file or
if the orbname is for a write connection, the m_enabled flag of the StateVector
is set to false.
OBJECT CONFIGURATION PARAMETERS
The
StateMgrTask object contains a public member
struct of name
m_stateParams which is defined as follows:
typedef struct stateParamsStruct {
char* statefile;
double retain_unused_stateinfo_sec;
} stateParamsStruct;
-
statefile
The char* statefile parameter contains the string name of
a file in the filesystem in which to save and retrieve information
on the state of each orbserver(1) connection.
-
retain_unused_stateinfo_sec
The double-precision retain_unused_stateinfo_sec parameter
gives the length of time unused blocks of state information in the
statefile should be retained from one run of the program to the
next before flushing them out of the statefile.
LIBRARY
-loorb $(ORBLIBS)
ATTRIBUTES
MT-Safe
SEE ALSO
Oorb(3), Oorb::Task(3), Oorb::Master(3)
BUGS AND CAVEATS
Note that if no
statefile is specified, the
StateMgrTask will shut down its
run method
and thereby relinquish its thread since it doesn't need to write our regular state files. That given,
internally the
StateMgrTask structures will still be used to track connection state, for all
StateVector objects with member
m_enabled set to
true.
AUTHOR
Kent Lindquist