Package org.apache.felix.scrplugin.description

Examples of org.apache.felix.scrplugin.description.ServiceDescription


        }

        // generate ServiceDescription if required
        final boolean generateService = cad.getBooleanValue("generateService", true);
        if (generateService) {
            final ServiceDescription sd = new ServiceDescription(cad);
            sd.addInterface(HealthCheck.class.getName());
            classDescription.add(sd);
        }

        // generate HC PropertyDescriptions
        generateStringPropertyDescriptor(cad, classDescription, metatype, "name", HealthCheck.NAME, "Name", "Name", false);
View Full Code Here


     *            The service annotations.
     * @param scannedClass
     *            The scanned class
     */
    private ServiceDescription createService(final List<ClassAnnotation> descs, final ScannedClass scannedClass) {
        final ServiceDescription service = new ServiceDescription(descs.get(0));

        final List<String> listedInterfaces = new ArrayList<String>();
        for (final ClassAnnotation d : descs) {
            if (d.getBooleanValue("serviceFactory", false)) {
                service.setServiceFactory(true);
            }
            if (d.getValue("value") != null) {
                final String[] interfaces = (String[]) d.getValue("value");
                for (String t : interfaces) {
                    listedInterfaces.add(t);
                }
            }
        }

        if (listedInterfaces.size() > 0 && !listedInterfaces.contains(AutoDetect.class.getName())) {
            for (final String i : listedInterfaces) {
                service.addInterface(i);
            }
        } else {
            // auto detection
            addInterfaces(service, scannedClass.getScannedClass());
        }
View Full Code Here

        }

        // generate ServiceDescription if required
        final boolean generateService = cad.getBooleanValue("generateService", true);
        if (generateService) {
            final ServiceDescription sd = new ServiceDescription(cad);
            sd.addInterface("javax.servlet.Servlet");
            classDescription.add(sd);
        }

        // generate PropertyDescriptions
View Full Code Here

        }

        // generate ServiceDescription if required
        final boolean generateService = cad.getBooleanValue("generateService", true);
        if (generateService) {
            final ServiceDescription sd = new ServiceDescription(cad);
            sd.addInterface("javax.servlet.Filter");
            classDescription.add(sd);
        }

        // generate PropertyDescriptions
        // property order = service.ranking
View Full Code Here

                    // TODO: implement the properties tag

                } else if (localName.equals(SERVICE)) {

                    this.currentService = new ServiceDescription(null);
                    this.currentClass.add(this.currentService);

                    if (attributes.getValue(SERVICE_ATTR_FACTORY) != null) {
                        this.currentService.setServiceFactory(Boolean.valueOf(attributes.getValue(SERVICE_ATTR_FACTORY)));
                    }
View Full Code Here

    /**
     * Process service directives
     */
    private void processServices(final ClassDescription current, final ComponentContainer component) {

        final ServiceDescription serviceDesc = current.getDescription(ServiceDescription.class);
        if ( serviceDesc != null ) {
            ServiceDescription service = component.getServiceDescription();
            if ( service == null ) {
                service = new ServiceDescription(serviceDesc.getAnnotation());
                service.setServiceFactory(false);
                component.setServiceDescription(service);
            }
            if ( serviceDesc.isServiceFactory() ) {
                service.setServiceFactory(true);
            }
            for(final String className : serviceDesc.getInterfaces()) {
                service.addInterface(className);
            }
        }
    }
View Full Code Here

        } else {
            // scan directly implemented interfaces
            this.searchInterfaces(listedInterfaces, scannedClass.getScannedClass());
        }
        if ( listedInterfaces.size() > 0 ) {
            final ServiceDescription serviceDesc = new ServiceDescription(cad);
            describedClass.add(serviceDesc);

            for(final String name : listedInterfaces) {
                serviceDesc.addInterface(name);
            }
            serviceDesc.setServiceFactory(cad.getBooleanValue("servicefactory", false));
        }

        // factory
        component.setFactory(cad.getStringValue("factory", null));
View Full Code Here

        }

        // generate ServiceDescription if required
        final boolean generateService = cad.getBooleanValue("generateService", true);
        if (generateService) {
            final ServiceDescription sd = new ServiceDescription(cad);
            sd.addInterface("javax.servlet.Servlet");
            classDescription.add(sd);
        }

        // generate PropertyDescriptions
View Full Code Here

        }

        // generate ServiceDescription if required
        final boolean generateService = cad.getBooleanValue("generateService", true);
        if (generateService) {
            final ServiceDescription sd = new ServiceDescription(cad);
            sd.addInterface("javax.servlet.Filter");
            classDescription.add(sd);
        }

        // generate PropertyDescriptions
        // property order = service.ranking
View Full Code Here

TOP

Related Classes of org.apache.felix.scrplugin.description.ServiceDescription

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.