Package org.openbp.guiclient.remote

Examples of org.openbp.guiclient.remote.ServerConnection


    // Add these plugins first, they will create menu items for the global menu
    pm.createInstance(ErrorDialogPlugin.class, this);

    // Try to connect to the server
    // By default, use an anonymous login
    ServerConnection connection = ServerConnection.getInstance();
    connection.setLoginInfo(new ClientLoginInfo("Anonymous", null));
    try
    {
      connection.connect(true);
    }
    catch (OpenBPException e)
    {
      // Show dialog box if the user has not chose to skip it before
      if (! SettingUtil.getBooleanSetting("openbp.cockpit.connectionwarning.hide", false))
      {
        // Hide splash screen.
        if (splashScreen != null)
        {
          splashScreen.setVisible(false);
        }

        int response = JMsgBox.show(null, getPluginResourceCollection().getRequiredString(
          "connectionerror.title"), ResourceCollectionUtil.formatMsg(getPluginResourceCollection(),
          "connectionerror.description", new Object[]
          {
            connection.getConnectionInfo().getRmiServerHost(),
            new Integer(connection.getConnectionInfo().getRmiServerPort()), e.getMessage()
          }), JMsgBox.ICON_INFO | JMsgBox.TYPE_OK | JMsgBox.DEFAULT_OK | JMsgBox.TYPE_DO_NOT_SHOW_AGAIN);

        if ((response & JMsgBox.TYPE_DO_NOT_SHOW_AGAIN) != 0)
        {
          // Skip this dialog the next time
View Full Code Here


     * @param jae Event
     * @return The event status code
     */
    public JaspiraEventHandlerCode reload(JaspiraActionEvent jae)
    {
      ServerConnection serverConnection = ServerConnection.getInstance();

      if (! serverConnection.isConnected())
      {
        try
        {
          // If we are not connected, try to connect to the server
          serverConnection.connect(true);

          JaspiraEventMgr.fireGlobalEvent("plugin.serverconnection.reconnect");

          String message = getPluginResourceCollection().getRequiredString("reconnect.okmessage");
          JMsgBox.show(null, message, JMsgBox.ICON_INFO);
        }
        catch (OpenBPException e)
        {
          ExceptionUtil.printTrace(e);
          String message = getPluginResourceCollection().getRequiredString("reconnect.failedmessage");
          String exceptionMessage = ExceptionUtil.getNestedMessage(e);
          JMsgBox.showFormat(null, message, exceptionMessage, JMsgBox.ICON_ERROR);
        }
      }
      else
      {
        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);
        }
View Full Code Here

TOP

Related Classes of org.openbp.guiclient.remote.ServerConnection

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.