Package org.apache.karaf.shell.impl.action.command

Examples of org.apache.karaf.shell.impl.action.command.ManagerImpl


        return sessionFactory.create(in, out, err, terminal, null, null);
    }

    protected SessionFactory createSessionFactory(ThreadIO threadio) {
        SessionFactoryImpl sessionFactory = new SessionFactoryImpl(threadio);
        sessionFactory.register(new ManagerImpl(sessionFactory, sessionFactory));
        return sessionFactory;
    }
View Full Code Here


    public String getDiscoveryResource() {
        return "META-INF/services/org/apache/karaf/shell/commands";
    }

    protected void discoverCommands(Session session, ClassLoader cl, String resource) throws IOException, ClassNotFoundException {
        Manager manager = new ManagerImpl(session.getRegistry(), session.getFactory().getRegistry(), true);
        Enumeration<URL> urls = cl.getResources(resource);
        while (urls.hasMoreElements()) {
            URL url = urls.nextElement();
            BufferedReader r = new BufferedReader(new InputStreamReader(url.openStream()));
            String line = r.readLine();
            while (line != null) {
                line = line.trim();
                if (line.length() > 0 && line.charAt(0) != '#') {
                    final Class<?> actionClass = cl.loadClass(line);
                    manager.register(actionClass);
                }
                line = r.readLine();
            }
            r.close();
        }
View Full Code Here

            eventAdminListener = listener;
        } catch (NoClassDefFoundError error) {
            // Ignore the listener if EventAdmin package isn't present
        }

        sessionFactory.register(new ManagerImpl(sessionFactory, sessionFactory));

        sessionFactoryRegistration = context.registerService(SessionFactory.class.getName(), sessionFactory, null);

        actionExtender = new CommandExtender(sessionFactory);
        actionExtender.start(context);
View Full Code Here

    private Registry registry;

    public CommandExtender(Registry registry) {
        setSynchronous(true);
        this.registry = registry;
        this.registry.register(new ManagerImpl(this.registry, this.registry));
    }
View Full Code Here

            }
            manager = null;
        }
        if (isSatisfied) {
            Registry reg = new RegistryImpl(registry);
            manager = new ManagerImpl(reg, registry);
            reg.register(bundle.getBundleContext());
            reg.register(manager);
            for (Map.Entry<Class, Object> entry : state.getSingleServices().entrySet()) {
                reg.register(entry.getValue());
            }
View Full Code Here

TOP

Related Classes of org.apache.karaf.shell.impl.action.command.ManagerImpl

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.