|
Lines 18-23
Link Here
|
| 18 |
import org.eclipse.hyades.logging.adapter.util.Messages; |
18 |
import org.eclipse.hyades.logging.adapter.util.Messages; |
| 19 |
import org.eclipse.hyades.logging.events.cbe.CommonBaseEvent; |
19 |
import org.eclipse.hyades.logging.events.cbe.CommonBaseEvent; |
| 20 |
import org.eclipse.hyades.logging.events.cbe.Situation; |
20 |
import org.eclipse.hyades.logging.events.cbe.Situation; |
|
|
21 |
import org.eclipse.hyades.logging.adapter.impl.Component; |
| 21 |
/** |
22 |
/** |
| 22 |
* BasicContext provide the simplest possible implementation of a Context. |
23 |
* BasicContext provide the simplest possible implementation of a Context. |
| 23 |
* It is a good example for other custom context implementation |
24 |
* It is a good example for other custom context implementation |
|
Lines 316-324
Link Here
|
| 316 |
/* Don't let the listener break us */ |
317 |
/* Don't let the listener break us */ |
| 317 |
} |
318 |
} |
| 318 |
} |
319 |
} |
|
|
320 |
ISensor sensor= ((ISensor) getComponents()[0]); |
| 321 |
|
| 319 |
|
322 |
|
| 320 |
Object[] flushedSensorContent=((ISensor) getComponents()[0]).flush(); |
323 |
Object[] flushedSensorContent=((ISensor) getComponents()[0]).flush(); |
| 321 |
|
324 |
|
|
|
325 |
|
| 322 |
if(listener!=null && !isHardStop()) { |
326 |
if(listener!=null && !isHardStop()) { |
| 323 |
try { |
327 |
try { |
| 324 |
listener.postProcessEventItems(getComponents()[0], flushedSensorContent); |
328 |
listener.postProcessEventItems(getComponents()[0], flushedSensorContent); |
|
Lines 329-335
Link Here
|
| 329 |
} |
333 |
} |
| 330 |
|
334 |
|
| 331 |
flushMessages(flushedSensorContent, 1); |
335 |
flushMessages(flushedSensorContent, 1); |
|
|
336 |
//bugziila 135531, If the itemes processed by sensor is bigger than 0, |
| 337 |
//but output is 0. Then the log file could be wrong type. |
| 338 |
IComponent compentets[] = getComponents(); |
| 339 |
if (((Component) (getComponents()[compentets.length - 1])) != null) { |
| 340 |
|
| 341 |
if (((Component) (getComponents()[0])).getItemsProcessedCount() > 0 |
| 342 |
&& ((Component) (compentets[compentets.length - 1])) |
| 343 |
.getItemsProcessedCount() == 0) { |
| 344 |
|
| 345 |
CommonBaseEvent event = getEventFactory() |
| 346 |
.createCommonBaseEvent(); |
| 347 |
event.setMsg(Messages.getString("INVALID_LOG_TYPE_INFO_")); |
| 348 |
event.setSeverity(CommonBaseEvent.SEVERITY_FATAL); |
| 349 |
log(event); |
| 350 |
|
| 351 |
} |
| 352 |
} |
| 332 |
super.stop(); |
353 |
super.stop(); |
|
|
354 |
|
| 333 |
} |
355 |
} |
| 334 |
/** |
356 |
/** |
| 335 |
* flushMessages flushes any messages cached by a component to the next component. |
357 |
* flushMessages flushes any messages cached by a component to the next component. |