public void onEvent(final WorkItem wi)
{
if (wi instanceof EventReceivedWorkItem)
{
EventReceivedWorkItem item = (EventReceivedWorkItem)wi;
Agent agent = item.getAgent();
QmfEvent event = item.getEvent();
String className = event.getSchemaClassId().getClassName();
if (className.equals("clientConnect") ||
className.equals("clientDisconnect"))
{
_stateChanged = true;
}
}
else if (wi instanceof AgentRestartedWorkItem)
{
_stateChanged = true;
}
else if (wi instanceof AgentHeartbeatWorkItem)
{
AgentHeartbeatWorkItem item = (AgentHeartbeatWorkItem)wi;
Agent agent = item.getAgent();
if (_stateChanged && agent.getName().contains("qpidd"))
{
logConnectionInformation();
_stateChanged = false;
}
}