Skip to content

Commit

Permalink
move abstractsystemplugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdiknight committed Nov 1, 2021
1 parent 3b387f6 commit d2d803e
Show file tree
Hide file tree
Showing 30 changed files with 37 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.perfma.xlab.xpocket.command.impl;
package com.perfma.xlab.xpocket.command;

import com.perfma.xlab.xpocket.spi.command.AbstractXPocketCommand;
import org.jline.reader.impl.LineReaderImpl;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.spi.command.CommandInfo;
import com.perfma.xlab.xpocket.spi.context.SessionContext;
import com.perfma.xlab.xpocket.spi.process.XPocketProcess;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.framework.spi.impl.XPocketStatusContext;
import com.perfma.xlab.xpocket.plugin.manager.PluginManager;
import com.perfma.xlab.xpocket.spi.command.CommandInfo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.spi.command.CommandInfo;
import com.perfma.xlab.xpocket.spi.process.XPocketProcess;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.spi.command.CommandInfo;
import com.perfma.xlab.xpocket.spi.command.XPocketProcessTemplate;
import com.perfma.xlab.xpocket.spi.context.SessionContext;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.spi.command.CommandInfo;
import com.perfma.xlab.xpocket.spi.process.XPocketProcess;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.spi.command.CommandInfo;
import com.perfma.xlab.xpocket.spi.process.XPocketProcess;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.framework.spi.impl.XPocketStatusContext;
import com.perfma.xlab.xpocket.plugin.context.FrameworkPluginContext;
import com.perfma.xlab.xpocket.plugin.manager.CommandManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.spi.command.CommandInfo;
import com.perfma.xlab.xpocket.spi.process.XPocketProcess;
import org.jline.reader.History;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.localjvm.JvmPid;
import com.perfma.xlab.xpocket.spi.command.CommandInfo;
import com.perfma.xlab.xpocket.spi.process.XPocketProcess;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.spi.command.CommandInfo;
import com.perfma.xlab.xpocket.spi.command.XPocketProcessTemplate;
import com.perfma.xlab.xpocket.spi.process.XPocketProcess;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.plugin.context.FrameworkPluginContext;
import com.perfma.xlab.xpocket.plugin.manager.CommandManager;
import com.perfma.xlab.xpocket.plugin.manager.PluginManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.framework.spi.impl.CommandProcessor;
import com.perfma.xlab.xpocket.spi.command.CommandInfo;
import com.perfma.xlab.xpocket.spi.process.XPocketProcess;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.framework.spi.execution.pipeline.DefaultProcessInfo;
import com.perfma.xlab.xpocket.framework.spi.impl.CommandProcessor;
import com.perfma.xlab.xpocket.plugin.manager.ExecutionManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.framework.spi.impl.CommandProcessor;
import com.perfma.xlab.xpocket.spi.command.CommandInfo;
import com.perfma.xlab.xpocket.spi.process.XPocketProcess;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.framework.spi.execution.pipeline.DefaultProcessInfo;
import com.perfma.xlab.xpocket.framework.spi.execution.pipeline.DefaultXPocketProcess;
import com.perfma.xlab.xpocket.framework.spi.impl.CommandProcessor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.console.EndOfInputException;
import com.perfma.xlab.xpocket.spi.command.CommandInfo;
import com.perfma.xlab.xpocket.spi.process.XPocketProcess;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.framework.spi.impl.XPocketStatusContext;
import com.perfma.xlab.xpocket.spi.command.CommandInfo;
import com.perfma.xlab.xpocket.spi.process.XPocketProcess;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.spi.command.CommandInfo;
import com.perfma.xlab.xpocket.spi.process.XPocketProcess;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.spi.command.CommandInfo;
import com.perfma.xlab.xpocket.spi.process.XPocketProcess;
import com.perfma.xlab.xpocket.utils.TerminalUtil;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.spi.command.CommandInfo;
import com.perfma.xlab.xpocket.spi.command.XPocketProcessTemplate;
import com.perfma.xlab.xpocket.spi.command.callback.SimpleProcessCallback;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.spi.command.CommandInfo;
import com.perfma.xlab.xpocket.spi.process.XPocketProcess;
import org.jline.keymap.BindingReader;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.spi.command.CommandInfo;
import com.perfma.xlab.xpocket.spi.process.XPocketProcess;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.framework.spi.impl.XPocketStatusContext;
import com.perfma.xlab.xpocket.plugin.context.FrameworkPluginContext;
import com.perfma.xlab.xpocket.plugin.manager.PluginManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.perfma.xlab.xpocket.command.impl;

import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.spi.command.CommandInfo;
import com.perfma.xlab.xpocket.spi.process.XPocketProcess;
import com.perfma.xlab.xpocket.utils.XPocketConstants;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.perfma.xlab.xpocket.framework.spi.impl;

import com.perfma.xlab.xpocket.command.impl.AbstractSystemCommand;
import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.completer.CommandCompleter;
import com.perfma.xlab.xpocket.completer.GroupStringCompleter;
import com.perfma.xlab.xpocket.completer.ParamsCompleter;
Expand Down Expand Up @@ -241,6 +241,7 @@ private DefaultPluginContext initSystemPlugin() {
sysPluginContext.setTips(tips);

HashMap<String, DefaultCommandContext> cmdMap = new HashMap<>();

for (String cmd : XPocketConstants.XPOCKET_COMMANDS) {
try {
Class pluginClass = Class.forName(XPocketConstants.XPOCKET_COMMAND_PACKAGE + cmd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import java.io.FileInputStream;
import java.io.FilenameFilter;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.lang.instrument.Instrumentation;
import java.net.URL;
import java.nio.charset.Charset;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.perfma.xlab.xpocket.framework.spi.impl.agent;

import com.perfma.xlab.xpocket.command.impl.AbstractSystemCommand;
import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.completer.CommandCompleter;
import com.perfma.xlab.xpocket.completer.GroupStringCompleter;
import com.perfma.xlab.xpocket.completer.ParamsCompleter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.perfma.xlab.xpocket.framework.spi.impl.once;

import com.perfma.xlab.xpocket.command.impl.AbstractSystemCommand;
import com.perfma.xlab.xpocket.command.AbstractSystemCommand;
import com.perfma.xlab.xpocket.console.EndOfInputException;
import com.perfma.xlab.xpocket.framework.spi.execution.pipeline.DefaultNode;
import com.perfma.xlab.xpocket.framework.spi.execution.pipeline.DefaultProcessInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void run() {
try {
int ret_read = 0, index = 0;
char[] line = new char[1024];
boolean print = false;
boolean print = false,firstLine = false;
LOOP:
for (;;) {
ret_read = instr.read();
Expand All @@ -156,19 +156,25 @@ public void run() {
}

switch (ret_read) {
case '\r':
case '\n':
String lineStr = new String(line, 0, index);
if (!lineStr.trim().equalsIgnoreCase(process.getCmd())
&& print) {
process.output(lineStr + "\n");
}
if(firstLine) {
print = true;
firstLine = false;
}
index = 0;
break;
case '>':
line = put(line, index++, (char) ret_read);
String flag = new String(line, 0, index);
if (flag.contains("XPocket [")) {
print = true;
firstLine = true;
print = false;
process.end();
process = null;
index = 0;
Expand Down

0 comments on commit d2d803e

Please sign in to comment.