Package org.apache.karaf.shell.api.action.lifecycle

Examples of org.apache.karaf.shell.api.action.lifecycle.Service


        return instantiate(clazz, dependencies);
    }

    public <T> T instantiate(Class<? extends T> clazz, Registry registry) throws Exception {
        if (!allowCustomServices) {
            Service reg = clazz.getAnnotation(Service.class);
            if (reg == null) {
                throw new IllegalArgumentException("Class " + clazz.getName() + " is not annotated with @Service");
            }
        }
        T instance = clazz.newInstance();
View Full Code Here


    }

    public void release(Object instance) throws Exception {
        Class<?> clazz = instance.getClass();
        if (!allowCustomServices) {
            Service reg = clazz.getAnnotation(Service.class);
            if (reg == null) {
                throw new IllegalArgumentException("Class " + clazz.getName() + " is not annotated with @Service");
            }
        }
        for (Method method : clazz.getDeclaredMethods()) {
View Full Code Here

    }

    @Override
    public void register(Class<?> clazz) {
        if (!allowCustomServices) {
            Service reg = clazz.getAnnotation(Service.class);
            if (reg == null ) {
                throw new IllegalArgumentException("Class " + clazz.getName() + " is not annotated with @Service");
            }
        }
        if (Action.class.isAssignableFrom(clazz)) {
View Full Code Here

            }
        }
    }

    private void inspectClass(final Class<?> clazz) throws Exception {
        Service reg = clazz.getAnnotation(Service.class);
        if (reg == null) {
            return;
        }
        // Create trackers
        for (Class<?> cl = clazz; cl != Object.class; cl = cl.getSuperclass()) {
View Full Code Here

TOP

Related Classes of org.apache.karaf.shell.api.action.lifecycle.Service

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.