18 #define DATASVC_RECORDDATASVC_CPP
48 sc = service(m_persSvcName, m_cnvSvc,
true);
57 sc = setDataLoader( m_cnvSvc );
59 log <<
MSG::ERROR <<
"Failed to attach dataloader RecordPersistencySvc." <<
endmsg;
69 if( !m_incidentSvc ) {
78 m_incidentSvc->addListener(
this,
"FILE_OPEN_READ");
79 m_incidentSvc->addListener(
this,m_saveIncidentName);
91 if( m_incidentSvc ) m_incidentSvc->removeListener(
this);
92 if( m_cnvSvc ) m_cnvSvc->release();
100 if ( incident.
type() ==
"FILE_OPEN_READ" ) {
102 const Ctxt* inc =
dynamic_cast<const Ctxt*
>(&incident);
104 registerRecord(inc->source(),inc->tag());
105 if ( !m_incidentName.empty() ) {
106 StringV incidents(m_incidents);
108 for( StringV::const_iterator
i=incidents.begin();
i!=incidents.end();++
i)
109 m_incidentSvc->fireIncident(
Incident(*
i,m_incidentName));
116 else if ( incident.
type() == m_saveIncidentName ) {
125 typedef vector<IRegistry*> Leaves;
133 sc = objectLeaves(pObj, leaves);
135 for ( Leaves::const_iterator
i=leaves.begin();
i != leaves.end();
i++ )
147 if ( !data.empty() && 0 != pAddr ) {
162 else if ( !data.empty() && 0 == pAddr ) {
164 log <<
MSG::INFO <<
"Failed to register record for:" << data <<
" [Invalid Address]" <<
endmsg;
Definition of the MsgStream class used to transmit messages.
std::string m_persSvcName
Property: name of the persistency service.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
virtual StatusCode reinitialize()
Service reinitialisation.
const std::string & type() const
Access to the incident type.
std::string m_incidentName
Property: name of incident to be fired if new record arrives.
bool isSuccess() const
Test for a status code of SUCCESS.
bool m_autoLoad
Property: autoload of records (default: true)
std::string m_rootName
Name of root event.
virtual void handle(const Incident &incident)
IIncidentListener override: Inform that a new incident has occured.
virtual unsigned long release()=0
release reference to object
A RecordDataSvc is the base class for event services.
virtual StatusCode finalize()
Service finalization.
#define DECLARE_COMPONENT(type)
std::string m_saveIncidentName
Property: name of the "save" incident.
virtual IRegistry * registry() const =0
Update branch name.
This class is used for returning status codes from appropriate routines.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
virtual StatusCode initialize()
Service initialization.
virtual ~RecordDataSvc()
Standard Destructor.
Base class for all Incidents (computing events).
Templated class to add the standard messaging functionalities.
RecordDataSvc(const std::string &name, ISvcLocator *svc)
Standard Constructor.
virtual const id_type & identifier() const =0
Full identifier (or key)
void registerRecord(const std::string &data, IOpaqueAddress *pAddr)
Load new record into the data store if necessary.
Opaque address interface definition.
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
A DataObject is the base class of any identifiable object on any data store.
std::vector< std::string > StringV
virtual StatusCode finalize()
Service initialization.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
void loadRecords(IRegistry *pReg)
Load dependent records into memory.