*/
protected void fireEvent(ModelConnectorEvent event)
{
observerMgr.fireEvent(event);
ModelNotificationService mns = (ModelNotificationService) ServerConnection.getInstance()
.lookupOptionalService(ModelNotificationService.class);
if (mns != null)
{
try
{
ClientSession session = ServerConnection.getInstance().getSession();
ModelQualifier qualifier = event.getQualifier();
String eventType = event.getEventType();
// Notify the server from the model changes
if (eventType == ModelConnectorEvent.MODEL_ADDED || eventType == ModelConnectorEvent.ITEM_ADDED)
{
mns.modelUpdated(session, qualifier, ModelNotificationService.ADDED);
}
else if (eventType == ModelConnectorEvent.MODEL_UPDATED || eventType == ModelConnectorEvent.ITEM_UPDATED)
{
mns.modelUpdated(session, qualifier, ModelNotificationService.UPDATED);
}
else if (eventType == ModelConnectorEvent.MODEL_REMOVED || eventType == ModelConnectorEvent.ITEM_REMOVED)
{
mns.modelUpdated(session, qualifier, ModelNotificationService.REMOVED);
}
else if (eventType == ModelConnectorEvent.MODEL_RENAMED || eventType == ModelConnectorEvent.ITEM_RENAMED)
{
ModelQualifier prevQualifier = event.getPreviousQualifier();
mns.modelUpdated(session, prevQualifier, ModelNotificationService.REMOVED);
mns.modelUpdated(session, qualifier, ModelNotificationService.ADDED);
}
}
catch (ModelException e)
{
ExceptionUtil.printTrace(e);