47 {
48 StatusCode sc = ConversionSvc::initialize();
49
50 MsgStream log(
msgSvc(),
"CalibXmlCnvSvc" );
51
52 if ( !sc.isSuccess() ) return sc;
53
54
55
56
57
58 IDataProviderSvc* pCDS = 0;
59
60
61 sc = serviceLocator()->getService( "CalibDataSvc", IDataProviderSvc::interfaceID(),
62 (IInterface*&)pCDS );
63 if ( !sc.isSuccess() )
64 {
65 log << MSG::ERROR << "Could not locate CalibDataSvc" << endmsg;
66 return sc;
67 }
68
69
70 sc = setDataProvider( pCDS );
71 if ( !sc.isSuccess() )
72 {
73 log << MSG::ERROR << "Could not set data provider" << endmsg;
74 return sc;
75 }
76
77
78
79
80
81 sc = serviceLocator()->service( "DetectorPersistencySvc", m_detPersSvc, true );
82 if ( !sc.isSuccess() )
83 {
84 log << MSG::ERROR << "Cannot locate IConversionSvc interface of DetectorPersistencySvc"
85 << endmsg;
86 return sc;
87 }
88 else
89 {
90 log << MSG::DEBUG << "Retrieved IConversionSvc interface of DetectorPersistencySvc"
91 << endmsg;
92 }
93
94
95 IAddressCreator* iAddrCreator;
96
97
98 sc = m_detPersSvc->queryInterface( IAddressCreator::interfaceID(), (void**)&iAddrCreator );
99 if ( !sc.isSuccess() )
100 {
101 log << MSG::ERROR << "Cannot query IAddressCreator interface of DetectorPersistencySvc"
102 << endmsg;
103 return sc;
104 }
105 else
106 {
107 log << MSG::DEBUG << "Retrieved IAddressCreator interface of DetectorPersistencySvc"
108 << endmsg;
109 }
110 log << MSG::DEBUG << "Set it as the address creator of the CalibXmlCnvSvc" << endmsg;
111 sc = setAddressCreator( iAddrCreator );
112 if ( !sc.isSuccess() )
113 {
114 log << MSG::ERROR << "Cannot set the address creator" << endmsg;
115 return sc;
116 }
117
118
119
120 m_parser = new xmlBase::XmlParser();
121
122 if ( m_parser == 0 )
123 { log << MSG::FATAL << "Unable to create XML parser instance \n" << endmsg; }
124
125
126
127 return sc;
128}