You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2017/09/11 14:07:21 UTC

[1/2] karaf git commit: [KARAF-5080] Use the full ttop command from gogo-jline

Repository: karaf
Updated Branches:
  refs/heads/master c5d3a882c -> 7f43c83b5


[KARAF-5080] Use the full ttop command from gogo-jline

Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/edb4e2b9
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/edb4e2b9
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/edb4e2b9

Branch: refs/heads/master
Commit: edb4e2b96e0cf0e4f62394dbc79857d04e201646
Parents: c5d3a88
Author: Guillaume Nodet <gn...@apache.org>
Authored: Mon Apr 3 10:36:08 2017 +0200
Committer: Guillaume Nodet <gn...@gmail.com>
Committed: Mon Sep 11 09:11:52 2017 +0200

----------------------------------------------------------------------
 .../karaf/shell/commands/impl/TTopAction.java   | 68 --------------------
 .../services/org/apache/karaf/shell/commands    |  1 -
 .../shell/impl/console/SessionFactoryImpl.java  |  2 +-
 3 files changed, 1 insertion(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/edb4e2b9/shell/commands/src/main/java/org/apache/karaf/shell/commands/impl/TTopAction.java
----------------------------------------------------------------------
diff --git a/shell/commands/src/main/java/org/apache/karaf/shell/commands/impl/TTopAction.java b/shell/commands/src/main/java/org/apache/karaf/shell/commands/impl/TTopAction.java
deleted file mode 100644
index 3da38ce..0000000
--- a/shell/commands/src/main/java/org/apache/karaf/shell/commands/impl/TTopAction.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.shell.commands.impl;
-
-import org.apache.karaf.shell.api.action.Action;
-import org.apache.karaf.shell.api.action.Command;
-import org.apache.karaf.shell.api.action.Option;
-import org.apache.karaf.shell.api.action.lifecycle.Reference;
-import org.apache.karaf.shell.api.action.lifecycle.Service;
-import org.apache.karaf.shell.api.console.Session;
-import org.jline.builtins.TTop;
-import org.jline.terminal.Terminal;
-
-import java.util.Arrays;
-
-
-/**
- * Display threads infos in a table.
- */
-@Command(scope = "shell", name = "ttop", description = "Display threads information")
-@Service
-public class TTopAction implements Action {
-
-    @Option(name = "--order" , aliases = { "-o" }, description = "Comma separated list of sorting keys")
-    String order;
-
-    @Option(name = "--stats" , aliases = { "-t" }, description = "Comma separated list of stats to display")
-    String stats;
-
-    @Option(name = "--seconds" , aliases = { "-s" }, description = "Delay between updates in seconds")
-    Integer seconds;
-
-    @Option(name = "--millis" , aliases = { "-m" }, description = "Delay between updates in milliseconds")
-    Integer millis;
-
-    @Option(name = "--nthreads", aliases = { "-n" }, description = "Only display up to NTHREADS threads")
-    int nthreads = -1;
-
-    @Reference
-    Session session;
-
-    @Override
-    public Object execute() throws Exception {
-        TTop ttop = new TTop((Terminal) session.get(".jline.terminal"));
-        ttop.sort = order != null ? Arrays.asList(order.split(",")) : null;
-        ttop.delay = seconds != null ? seconds * 1000 : ttop.delay;
-        ttop.delay = millis != null ? millis : ttop.delay;
-        ttop.stats = stats != null ? Arrays.asList(stats.split(",")) : null;
-        ttop.nthreads = nthreads;
-        ttop.run();
-        return null;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/karaf/blob/edb4e2b9/shell/commands/src/main/resources/META-INF/services/org/apache/karaf/shell/commands
----------------------------------------------------------------------
diff --git a/shell/commands/src/main/resources/META-INF/services/org/apache/karaf/shell/commands b/shell/commands/src/main/resources/META-INF/services/org/apache/karaf/shell/commands
index 483823b..16e8a3c 100644
--- a/shell/commands/src/main/resources/META-INF/services/org/apache/karaf/shell/commands
+++ b/shell/commands/src/main/resources/META-INF/services/org/apache/karaf/shell/commands
@@ -23,5 +23,4 @@ org.apache.karaf.shell.commands.impl.PrintfAction
 org.apache.karaf.shell.commands.impl.PrintStackTracesAction
 org.apache.karaf.shell.commands.impl.SourceAction
 org.apache.karaf.shell.commands.impl.ThreadsAction
-org.apache.karaf.shell.commands.impl.TTopAction
 org.apache.karaf.shell.commands.impl.WatchAction

http://git-wip-us.apache.org/repos/asf/karaf/blob/edb4e2b9/shell/core/src/main/java/org/apache/karaf/shell/impl/console/SessionFactoryImpl.java
----------------------------------------------------------------------
diff --git a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/SessionFactoryImpl.java b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/SessionFactoryImpl.java
index 840e23a..e6c5a20 100644
--- a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/SessionFactoryImpl.java
+++ b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/SessionFactoryImpl.java
@@ -72,7 +72,7 @@ public class SessionFactoryImpl extends RegistryImpl implements SessionFactory,
         }
 
         Posix posix = new Posix(commandProcessor);
-        for (String name : new String[]{"cat", "echo", "grep", "sort", "sleep", "cd", "pwd", "ls", "less", "watch", "nano", "head", "tail", "clear", "wc", "date"}) {
+        for (String name : new String[]{"cat", "echo", "grep", "sort", "sleep", "cd", "pwd", "ls", "less", "watch", "nano", "head", "tail", "clear", "wc", "date", "tmux", "ttop"}) {
             register(new ShellCommand(name, null, posix, name));
         }
     }


[2/2] karaf git commit: [KARAF-5080] This closes #353

Posted by jb...@apache.org.
[KARAF-5080] This closes #353


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/7f43c83b
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/7f43c83b
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/7f43c83b

Branch: refs/heads/master
Commit: 7f43c83b5b7462bafcd69a3d273a6ca2dad9b56d
Parents: c5d3a88 edb4e2b
Author: Jean-Baptiste Onofré <jb...@apache.org>
Authored: Mon Sep 11 16:07:14 2017 +0200
Committer: Jean-Baptiste Onofré <jb...@apache.org>
Committed: Mon Sep 11 16:07:14 2017 +0200

----------------------------------------------------------------------
 .../karaf/shell/commands/impl/TTopAction.java   | 68 --------------------
 .../services/org/apache/karaf/shell/commands    |  1 -
 .../shell/impl/console/SessionFactoryImpl.java  |  2 +-
 3 files changed, 1 insertion(+), 70 deletions(-)
----------------------------------------------------------------------