Search in sources :

Example 1 with ApplicationModel

use of com.kyj.bci.monitor.ApplicationModel in project Gargoyle by callakrsos.

the class JavaProcessMonitor method menuInjectionOnAction.

public void menuInjectionOnAction(ActionEvent e) {
    CodeItem selectedItem = injectionItemListComposite.getSelectedItem();
    ApplicationModel applicationItem = tbJavaApplication.getSelectionModel().getSelectedItem();
    if (ValueUtil.isNotEmpty(selectedItem) && ValueUtil.isNotEmpty(applicationItem)) {
        LOGGER.debug("application pid : {}  codeitem :{}", applicationItem.getProcessId(), selectedItem.getName());
        BtraceRunner.run(applicationItem, selectedItem.getFile());
    }
}
Also used : ApplicationModel(com.kyj.bci.monitor.ApplicationModel)

Example 2 with ApplicationModel

use of com.kyj.bci.monitor.ApplicationModel in project Gargoyle by callakrsos.

the class JavaProcessMonitor method menuThreadDumpOnAction.

/**
	 * Thread Dump
	 * @작성자 : KYJ
	 * @작성일 : 2017. 1. 23.
	 * @param e
	 * @throws Exception
	 */
public void menuThreadDumpOnAction(ActionEvent e) {
    ApplicationModel selectedItem = getSelectedItem(item -> item);
    if (selectedItem == null) {
        Window window = FxUtil.getWindow(this.getParent(), () -> {
            return SharedMemory.getPrimaryStage();
        });
        DialogUtil.showMessageDialog(window, "덤프를 출력할 프로세스를 선택.");
        return;
    }
    Integer selectedProcessId = selectedItem.getProcessId();
    String applicationName = selectedItem.getApplicationName();
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    Monitors.runStackTool(selectedProcessId, out);
    ThreadDumpTextArea parent = new ThreadDumpTextArea();
    parent.setContent(out.toString());
    FxUtil.createStageAndShow(parent, stage -> {
        stage.initOwner(getParent().getScene().getWindow());
        stage.setWidth(1200d);
        stage.setHeight(800d);
        stage.setTitle("App - " + applicationName);
    });
//		FxUtil.createSimpleTextAreaAndShow(out.toString(), stage -> {
//
//
//		});
}
Also used : Window(javafx.stage.Window) ThreadDumpTextArea(com.kyj.fx.voeditor.visual.component.text.ThreadDumpTextArea) ApplicationModel(com.kyj.bci.monitor.ApplicationModel) ByteArrayOutputStream(org.apache.commons.io.output.ByteArrayOutputStream)

Aggregations

ApplicationModel (com.kyj.bci.monitor.ApplicationModel)2 ThreadDumpTextArea (com.kyj.fx.voeditor.visual.component.text.ThreadDumpTextArea)1 Window (javafx.stage.Window)1 ByteArrayOutputStream (org.apache.commons.io.output.ByteArrayOutputStream)1