protected void doExecute() { if (command == null || timer == null) return; log().i(name,"execute",command); StreamToLogAdapter out = new StreamToLogAdapter(LEVEL.INFO, null); StreamToLogAdapter err = new StreamToLogAdapter(LEVEL.ERROR, null); try { SessionFactory commandProcessor=MOsgi.getService(SessionFactory.class); ByteArrayInputStream in = new ByteArrayInputStream(new byte[0]); Session commandSession=commandProcessor.create(in,out,err); commandSession.put("interactive.mode", false); commandSession.put("APPLICATION",System.getProperty("karaf.name","root")); commandSession.put("USER","karaf"); commandSession.execute(command); } catch (Throwable t) { log().w(name,t); } out.close(); err.close(); }