Package org.apache.karaf.eik.ui.internal

Examples of org.apache.karaf.eik.ui.internal.KarafRemoteShellConnectJob


                    credentials,
                    noAvailableInputStream,
                    outputStream,
                    outputStream);

            final KarafRemoteShellConnectJob job = new KarafRemoteShellConnectJob(name, shellConnection);
            job.addJobChangeListener(new JobChangeAdapter() {
                @Override
                public void done(final IJobChangeEvent event) {
                    if (!event.getResult().isOK()) {
                        final Throwable t = event.getResult().getException();
                        writeTo(outputStream, "Unable to connect to SSH server: " + (t != null ? t.getLocalizedMessage() : "Unknown error"));
                    }
                }
            });

            DebugPlugin.getDefault().addDebugEventListener(new IDebugEventSetListener() {

                @Override
                public void handleDebugEvents(final DebugEvent[] events) {

                    for (final DebugEvent event : events) {
                        if (   process != null
                            && process.equals(event.getSource())
                            && event.getKind() == DebugEvent.TERMINATE)
                        {
                            job.cancel();
                        }
                    }
                }
            });

            job.schedule(15 * 1000);
        } else {
            writeTo(outputStream, "The Karaf remote shell is disabled. Enable it in the launch configuration dialog.");
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.karaf.eik.ui.internal.KarafRemoteShellConnectJob

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.