Package io.fabric8.gateway.handlers.detecting.protocol.openwire.command

Examples of io.fabric8.gateway.handlers.detecting.protocol.openwire.command.Message$Expression


   * 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

        indexer.setCacheDirectory(new File(targetDir(), "mavenIndexer"));
        indexer.start();

        List<Repository> repos = Aether.defaultRepositories();
        repos.add(new Repository("ea.repository.jboss.org", "http://repository.jboss.org/nexus/content/groups/ea"));
        aether = new Aether(Aether.USER_REPOSITORY, repos);
    }
View Full Code Here

        this.xsdDir = xsdDir;
    }

    protected void downloadArtifact(ArtifactDTO artifact, String version) {
        try {
            AetherResult result = aether.resolve(artifact.getGroupId(), artifact.getArtifactId(), version, "jar", null);
            if (result != null) {
                List<File> files = result.getResolvedFiles();
                if (files != null && files.size() > 0) {
                    File file = files.get(0);
                    //for (File file : files) {
                    File newFile = new File(archetypeDir, file.getName());
                    FileInputStream input = new FileInputStream(file);
View Full Code Here

        }
    }

    protected String[] downloadProperties(ArtifactDTO artifact, String version) {
        try {
            AetherResult result = aether.resolve(artifact.getGroupId(), artifact.getArtifactId(), version, "properties", "camelComponent");
            if (result != null) {
                List<File> files = result.getResolvedFiles();
                if (files != null && files.size() > 0) {
                    File file = files.get(0);
                    Properties p = new Properties();
                    p.load(new FileInputStream(file));
                    String comps = p.getProperty("components", "");
View Full Code Here

        indexer.setRepositories(repositories);
        indexer.setCacheDirectory(new File(targetDir(), "mavenIndexer"));
        indexer.start();

        List<Repository> repos = Aether.defaultRepositories();
        repos.add(new Repository("ea.repository.jboss.org", "http://repository.jboss.org/nexus/content/groups/ea"));
        aether = new Aether(Aether.USER_REPOSITORY, repos);
    }
View Full Code Here

          CreateJCloudsContainerOptions opts = args.withUser(args.getUser(), args.getPassword(), "admin").build();

          FabricPlugin.getLogger().debug("Compute Service: " + opts.getComputeService());

          // finally create the image
          final CreateJCloudsContainerMetadata metadata = provider.create(opts, new CreationStateListener() {
            @Override
            public void onStateChange(String message) {
              monitor.subTask(message);
            }
          });

          // on failure we don't add the cloud image to the navigator
          Throwable failure = metadata.getFailure();
          if (failure != null) {
            return new Status(Status.ERROR, FabricPlugin.PLUGIN_ID, "Failed to create Fabric: " + fabricName, failure);
          }

          // now extract the public IP from the meta data
          final StringBuilder urisBuilder = new StringBuilder();
          for(String address:metadata.getPublicAddresses()) {
            urisBuilder.append(address).append(",");
          }

          final CreateJCloudsContainerOptions.Builder arguments = args;
          Viewers.async(new Runnable() {
View Full Code Here

TOP

Related Classes of io.fabric8.gateway.handlers.detecting.protocol.openwire.command.Message$Expression

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.