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