Package io.fabric8.api

Examples of io.fabric8.api.FabricException


          traceList.addBackLogTraceMessages(traceMessages);
        } else {
          // TODO should we highlight in the UI that there's no tracer enabled?
        }
      } else {
        CamelFabricTracerMBean fabricTracer = (CamelFabricTracerMBean)tracer;
        if (fabricTracer != null) {
          String traceXml = fabricTracer.dumpAllTracedMessagesAsXml();
          List<BacklogTracerEventMessage> traceMessages;
          if (id == null) {
            traceMessages = getTraceMessagesFromXml(traceXml);
          } else {
            traceMessages = getTraceMessagesFromXml(traceXml, id);
View Full Code Here


  }

  @Override
  public INodeStatistics getNodeStats(String nodeId) {
    if (nodeId != null) {
      CamelProcessorMBean processorMBean = camelContextNode.getProcessorMBean(nodeId);
      if (processorMBean != null) {
        return new ProcessorNodeStatistics(processorMBean);
      }
    }
    return null;
View Full Code Here

   * @see
   * org.eclipse.jface.viewers.ColumnLabelProvider#getImage(java.lang.Object)
   */
  @Override
  public Image getImage(Object element) {
    LogEvent le = LogViewTabSection.toLogEvent(element);
    if (le != null) {
      return getLevelImage(le);
    }
    return super.getImage(element);
  }
View Full Code Here

   * @see
   * org.eclipse.jface.viewers.ColumnLabelProvider#getText(java.lang.Object)
   */
  @Override
  public String getText(Object element) {
    LogEvent le = LogViewTabSection.toLogEvent(element);
    if (le != null) {
      return le.getLevel();
    }
    return super.getText(element);
  }
View Full Code Here

   * org.eclipse.jface.viewers.CellLabelProvider#getToolTipText(java.lang.
   * Object)
   */
  @Override
  public String getToolTipText(Object element) {
    LogEvent le = LogViewTabSection.toLogEvent(element);
    if (le != null) {
      return le.getMessage();
    }
    return super.getToolTipText(element);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.eclipse.jface.viewers.ColumnLabelProvider#getBackground(java.lang.Object)
   */
  @Override
  public Color getBackground(Object element) {
    LogEvent le = LogViewTabSection.toLogEvent(element);
    if (le != null) {
      return getBackgroundForLevel(le);
    }
    return super.getBackground(element);
  }
View Full Code Here

    int column = 0;
    clearColumns();
    Function1 function = new Function1() {
      @Override
      public Object apply(Object element) {
        LogEvent log = toLogEvent(element);
        if (log != null) {
          return log.getTimestamp();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Time");
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        LogEvent log = toLogEvent(element);
        if (log != null) {
          return log.getHost();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Host");
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        LogEvent log = toLogEvent(element);
        if (log != null) {
          return log.getContainerName();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Container");
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        LogEvent log = toLogEvent(element);
        if (log != null) {
          return log.getLevel();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Level", new LogLevelImageProvider());
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        LogEvent log = toLogEvent(element);
        if (log != null) {
          return log.getLogger();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Logger");
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        LogEvent log = toLogEvent(element);
        if (log != null) {
          return log.getThread();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Thread");
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        LogEvent log = toLogEvent(element);
        if (log != null) {
          return log.getMessage();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Message");
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        return element;
      }
    };
    column = addColumnFunction(bounds, column, function, "Location", new LocationLabelProvider());
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        LogEvent log = toLogEvent(element);
        if (log != null) {
          return log.getProperties();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Properties");
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        LogEvent log = toLogEvent(element);
        if (log != null) {
          return log.getSeq();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "ID");
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        LogEvent log = toLogEvent(element);
        if (log != null && log.getException() != null) {
          StringBuffer sb = new StringBuffer();
          for (String s : log.getException()) {
            sb.append(s);
            sb.append('\n');
          }
          return sb.toString();
        }
View Full Code Here

    this.view = view;
  }

  @Override
  public void run() {
    LogEvent event = view.getSelectedEvent();
    if (event == null) {
      return;
    }
    StringBuffer buf = new StringBuffer();
    String[] lines = event.getException();
    if (lines != null && lines.length > 0) {
      for (int i = 0; i < lines.length; i++) {
        buf.append(lines[i]).append(NEW_LINE);
      }
    } else {
      // lets use the location of the
      String className = event.getClassName();
      String methodName = event.getMethodName();
      String fileName = event.getFileName();
      String lineNumber = event.getLineNumber();
      if (Strings.isBlank(className) || Strings.isBlank(methodName)
          || Strings.isBlank(fileName) || Strings.isBlank(lineNumber)) {
        return;
      }
      buf.append(event.getMessage()).append(NEW_LINE);
      buf.append("\tat " + className + "." + methodName + "(" + fileName + ":" + lineNumber + ")").append(NEW_LINE);
      ;
    }
    // check that the user did not remove our console from the ConsoleView
    boolean stillRegistered = checkRegistration();
View Full Code Here

   * @see org.eclipse.jface.viewers.StyledCellLabelProvider#update(org.eclipse.jface.viewers.ViewerCell)
   */
  @Override
  public void update(ViewerCell cell) {
    Object element = cell.getElement();
    LogEvent log = LogViewTabSection.toLogEvent(element);
    if (log != null) {
      String className = log.getClassName();
      // we don't want to display ? as location
      if (className.trim().equals("?"))
        className = null;
      if (className != null) {
        Styler style = null;
        StyledString styledString = new StyledString(className, style);
        String fileName = log.getFileName();
        if (fileName != null) {
          styledString.append(fileName, StyledString.COUNTER_STYLER);
        }
        cell.setText(styledString.toString());
        cell.setStyleRanges(styledString.getStyleRanges());
View Full Code Here

          Long seq = JsonHelper.getAsLong(ev, IFabric8JsonConstants.PROPERTY_LOGEVENT_SEQ);
          String threadName = JsonHelper.getAsString(ev, IFabric8JsonConstants.PROPERTY_LOGEVENT_THREAD);
          Date eventTimestamp = new Date(JsonHelper.getAsLong(ev, IFabric8JsonConstants.PROPERTY_LOGEVENT_TIMESTAMP));
          Map<String, String> propertiesMap = JsonHelper.getAsPropertiesMap(ev, IFabric8JsonConstants.PROPERTY_LOGEVENT_PROPERTIES);
         
          LogEvent event = new LogEvent();
          event.setClassName(className);
          event.setContainerName(container);
          event.setException(exception);
          event.setFileName(fileName);
          event.setHost(Strings.isBlank(eventhost) ? host : eventhost);
          event.setLevel(logLevel);
          event.setLineNumber(lineNo);
          event.setLogger(logger);
          event.setMessage(logMessage);
          event.setMethodName(methodName);
          event.setSeq(seq);
          event.setThread(threadName);
          event.setTimestamp(eventTimestamp);
          event.setProperties(propertiesMap);
         
          res.addEvent(event);
        }
       
        return res.getEvents();
View Full Code Here

TOP

Related Classes of io.fabric8.api.FabricException

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.