60{
61
62
63
64
65
66
67
68 if(m_outLev<=3) std::cout<<"efpsc::SC::configure "<<"SC configuration started."<<std::endl;
70
71
72
73
74 if(m_outLev<=2) std::cout<<"efpsc::SC::configure "<<"---> Create Pesa Application Manager:"
75 <<m_isCreated<<std::endl;
76 if(!m_isCreated){
78 m_pesaAppMgr = Gaudi::createApplicationMgr(m_config->
dllName(),m_config->
factoryName());
79 if(m_outLev<=3)std::cout<<"Gaudi::createApplicationMgr(m_config->dllName(),m_config->factoryName())"
80 <<std::endl;
81 } else {
82 m_pesaAppMgr = Gaudi::createApplicationMgr();
83 if(m_outLev<=3)std::cout<<"Gaudi::createApplicationMgr()"<<std::endl;
84 }
85 }
86
87
88
89
90 if(m_outLev<=2) std::cout<<"efpsc::SC::configure "<<"---> Configure Pesa Property Manager"<<std::endl;
91 StatusCode sc ;
92 SmartIF<IProperty> propMgr ( m_pesaAppMgr );
93 SmartIF<IAppMgrUI> appMgr ( m_pesaAppMgr );
94 if( !appMgr.isValid() || !propMgr.isValid() ) {
95
96
97 if(m_outLev<=5) std::cout<<"efpsc::SC::configure "<<"While creating the ApplicationMgr"<<std::endl;
98 return false;
99 }
100
101
102 std::string opts = "jobOptions.txt";
103 ::setenv("efJobPath","",1);
106 if (opts.rfind("/") < opts.size()) {
107 ::setenv("efJobPath",opts.substr(0,opts.rfind("/")).c_str(),1);
108 }
109 }
110
111
112 if(m_outLev<=2) std::cout<<"efpsc::SC::configure "<<"---> Pesa JobOptions file is = " << opts<<std::endl
113 <<" "<<"---> Pesa JobOptions path = "
114 << ::getenv("efJobPath")<<std::endl;
115 propMgr->setProperty( "JobOptionsPath", opts );
116
117 propMgr->setProperty( "EventLoop",m_nameEventLoopMgr );
118
119
120
121
123 propMgr->setProperty(
"MessageSvcType", m_config->
messageSvcType());
124 }
125
126
127 if (m_config->
evtSel().size() != 0) {
128 propMgr->setProperty(
"EvtSel", m_config->
evtSel());
129 } else {
130 propMgr->setProperty( "EvtSel", "NONE" );
131 }
132
133
134
135 if(m_outLev<=3) std::cout<<"efpsc::SC::configure "<<"finish property set--->start configure"<<std::endl;
136 if(m_outLev<=2) std::cout<<"efpsc::SC::configure "<<"Configuring ApplicationMgr: "
137 << appMgr->FSMState() << " Status : " << sc.getCode()<<std::endl;
138
139 if( opts.substr( opts.length() - 3, 3 ) == ".py" ) {
140
141
142
143 if(m_outLev<=5) std::cout<<"efpsc::SC::configure "
144 <<"Error: Don't support python config files"<<std::endl;
145 return false;
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185 } else {
186
187
188
189 sc = appMgr->configure();
190 if( sc.isFailure() ) {
191
192
193 if(m_outLev<=5) std::cout<<"efpsc::SC::configure "<<"While configuring the ApplicationMgr"<<std::endl;
194 return false;
195 }
196 }
197
198
199 if(m_outLev<=2) std::cout<<"efpsc::SC::configure "<<"Configuring ApplicationMgr: "
200 << appMgr->FSMState() << " Status : " << sc.getCode()<<std::endl;
201
202 sc = appMgr->initialize();
203
204
205
206 if(m_outLev<=2) std::cout<<"efpsc::SC::configure "<<"Initialize ApplicationMgr : "
207 << appMgr->FSMState() << " Status : " << sc.getCode()<<std::endl;
208 if( sc.isFailure() ) {
209 EFPSC_ERROR(
"efpsc::SC::configure",
"While intializing the ApplicationMgr");
210 return false;
211 }
212
213
214 std::string value ;
215
216 sc = propMgr->getProperty( "EventLoop", value );
217
218 if( sc.isFailure() ) {
219
220 if(m_outLev<=4) std::cout<<"efpsc::SC::configure "<<"While retrieving Property EventLoop "<<std::endl;
221 } else {
222 m_nameEventLoopMgr.assign(value, value.find_first_of("\"")+1,
223 value.find_last_of("\"")-value.find_first_of("\"")-1) ;
224 }
225
226 SmartIF<ISvcLocator> svcLoc( m_pesaAppMgr );
227 if (svcLoc.isValid()) {
228
229 if(m_outLev<=2) std::cout<<"efpsc::SC::configure "<<"Name for EventLoopManager:"
230 <<m_nameEventLoopMgr<<std::endl;
231 StatusCode sc ;
232 IEventProcessor* processingMgr = 0 ;
233
234 sc = svcLoc->service( m_nameEventLoopMgr , processingMgr);
235 m_eventLoopMgr=processingMgr;
236
237 if( !sc.isSuccess() ) {
238
239 if(m_outLev<=5) std::cout<<"efpsc::SC::configure "<<"Error Retrieving Processing manager!"<<std::endl;
240 return false;
241 }
242
243 } else {
244
245 if(m_outLev<=5) std::cout<<"efpsc::SC::configure "<<"Error Retrieving Service Locator!"<<std::endl;
246 return false;
247 }
248
249 m_isCreated=true;
250
251 if(m_outLev<=3) std::cout<<"efpsc::SC::configure "<<"SC configuration finished."<<std::endl;
252 return true;
253}
#define EFPSC_ERROR(p, m)
const std::string & evtSel() const
const std::string & jobOptionsPath() const
const std::string & dllName() const
const std::string & factoryName() const
const std::string & messageSvcType() const