Ejemplo n.º 1
0
  /**
   * ************************************************************************* Update context
   * information ************************************************************************
   */
  private void updateContext(boolean connectionLost) {
    if (s_contextInfo != null) {
      String ctxName = s_contextInfo.getName();
      String domain = s_contextInfo.getSC();
      m_context.setText(" " + ctxName + " ");
      m_context.setBackground(s_okColor);

      m_domain.setText(" " + domain + " ");
      m_domain.setBackground(s_okColor);

      m_driver.setText(" " + s_contextInfo.getDriver() + " ");
      m_driver.setBackground(s_okColor);

      m_family.setText(" " + s_contextInfo.getFamily() + " ");
      m_family.setBackground(s_okColor);

      m_key.setText(s_proxy.getClientKey());
      m_key.setBackground(s_okColor);

      if (s_serverInfo != null) {
        ServerInfo.ServerRole role = s_serverInfo.getRole();
        m_mode.setText(role.equals(ServerInfo.ServerRole.COMMANDING) ? "CMD" : "MON");
        m_mode.setBackground(s_okColor);
      }
    } else {
      m_mode.setText(ConnectionStatusConstants.UNKNOWN);
      m_domain.setText(ConnectionStatusConstants.UNKNOWN);
      m_driver.setText(ConnectionStatusConstants.UNKNOWN);
      m_family.setText(ConnectionStatusConstants.UNKNOWN);
      m_key.setText("?");
      if (connectionLost) {
        m_context.setText(ConnectionStatusConstants.FAILURE);
        m_context.setBackground(s_errorColor);
      } else {
        m_context.setText(ConnectionStatusConstants.UNKNOWN);
        m_context.setBackground(s_warnColor);
      }
      m_mode.setBackground(s_warnColor);
      m_domain.setBackground(s_warnColor);
      m_driver.setBackground(s_warnColor);
      m_family.setBackground(s_warnColor);
      m_key.setBackground(s_warnColor);
    }
    m_base.getParent().pack();
  }
Ejemplo n.º 2
0
 /**
  * *************************************************************************
  *
  * <p>************************************************************************
  */
 @Override
 public void removeSharedScope(String scope) {
   if (scope.equals(GLOBAL_SCOPE)) return;
   if (m_tables.containsKey(scope)) {
     SPELLmessage msg = new SPELLmessageRemoveSharedVariableScope(s_proxy.getClientKey(), scope);
     SPELLmessage response;
     try {
       response = s_proxy.sendRequest(msg);
       if (response != null) {
         if (SPELLmessageRemoveSharedVariableScope.isSuccess(response)) {
           Logger.info("Remove shared scope " + scope, Level.PROC, this);
           m_tables.remove(scope);
         }
       }
     } catch (Exception ex) {
       ex.printStackTrace();
     }
   }
 }