I need to start karaf from a web application. I have it embedded, however I
need to include sshd, and hot deploy services. Here's the code I have so
far:

private void initOSGIContainer() {
        org.apache.karaf.main.Main m = new org.apache.karaf.main.Main(
                new String[] { "server" });

        String KARAF_HOME = "/opt/tomcat/webapps/osgi/";

        Path homeDir = Paths.get(KARAF_HOME);
        if (!homeDir.toFile().exists())
            homeDir.toFile().mkdirs();

        System.setProperty(Main.PROP_KARAF_HOME, KARAF_HOME);
        try {
            m.launch();
        } catch (Exception e1) {
            e1.printStackTrace();
        }

    }


Any advice about how to include the sshd shell and be able to deploy
bundles by copying them to the "/deploy" directory.
Thank you.

Reply via email to