Package org.openbp.core.model.modelmgr

Examples of org.openbp.core.model.modelmgr.ModelNotificationService


   */
  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);
View Full Code Here


      {
        try
        {
          ClientSession session = ServerConnection.getInstance().getSession();

          ModelNotificationService mns = (ModelNotificationService) serverConnection.lookupService(ModelNotificationService.class);
          mns.requestModelReset(session);

          String message = getPluginResourceCollection().getRequiredString("okmessage");
          JMsgBox.show(null, message, JMsgBox.ICON_INFO);
        }
        catch (OpenBPException e)
View Full Code Here

TOP

Related Classes of org.openbp.core.model.modelmgr.ModelNotificationService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.