Package org.jvnet.hk2.annotations

Examples of org.jvnet.hk2.annotations.Service


     *
     * @param c The class to get the analyzer name from
     * @return The name of the analyzer (null for default)
     */
    public static String getAutoAnalyzerName(Class<?> c) {
        Service s = c.getAnnotation(Service.class);
        if (s == null) return null;
       
        return s.analyzer();
    }
View Full Code Here


        for (Deployer deployer : containerInfosByDeployers.keySet()) {
            if (deployer.getMetaData()!=null) {
                for (Class dependency : deployer.getMetaData().requires()) {
                    if (!typeByDeployer.containsKey(dependency) && !typeByProvider.containsKey(dependency)) {
                        Service s = deployer.getClass().getAnnotation(Service.class);
                        String serviceName;
                        if (s!=null && s.name()!=null && s.name().length()>0) {
                            serviceName = s.name();
                        } else {
                            serviceName = deployer.getClass().getSimpleName();
                        }
                        report.failure(logger, serviceName + " deployer requires " + dependency + " but no other deployer provides it", null);
                        return null;
View Full Code Here

        @Override
        public Void visitType(TypeElement element, Void aVoid) {
            if (debug) {
                printNote("Visiting " + element.getQualifiedName());
            }
            Service service = element.getAnnotation(Service.class);
            if (debug) {
                printNote("Service annotation = " + service);
            }
            if (service != null) {
View Full Code Here

        for (Deployer deployer : containerInfosByDeployers.keySet()) {
            if (deployer.getMetaData()!=null) {
                for (Class dependency : deployer.getMetaData().requires()) {
                    if (!typeByDeployer.containsKey(dependency) && !typeByProvider.containsKey(dependency)) {

                        Service s = deployer.getClass().getAnnotation(Service.class);
                        String serviceName;
                        if (s!=null && s.name()!=null && s.name().length()>0) {
                            serviceName = s.name();
                        } else {
                            serviceName = deployer.getClass().getSimpleName();
                        }
                        report.failure(logger, serviceName + " deployer requires " + dependency + " but no other deployer provides it", null);
                        return null;
View Full Code Here

     *
     * @param c The class to get the analyzer name from
     * @return The name of the analyzer (null for default)
     */
    public static String getAutoAnalyzerName(Class<?> c) {
        Service s = c.getAnnotation(Service.class);
        if (s == null) return null;
       
        return s.analyzer();
    }
View Full Code Here

        for (Deployer deployer : containerInfosByDeployers.keySet()) {
            if (deployer.getMetaData()!=null) {
                for (Class dependency : deployer.getMetaData().requires()) {
                    if (!typeByDeployer.containsKey(dependency) && !typeByProvider.containsKey(dependency)) {

                        Service s = deployer.getClass().getAnnotation(Service.class);
                        String serviceName;
                        if (s!=null && s.name()!=null && s.name().length()>0) {
                            serviceName = s.name();
                        } else {
                            serviceName = deployer.getClass().getSimpleName();
                        }
                        report.failure(logger, serviceName + " deployer requires " + dependency + " but no other deployer provides it", null);
                        return null;
View Full Code Here

                    RestEndpoints endpoints = clazz.getAnnotation(RestEndpoints.class);
                    if (endpoints != null) {
                        RestEndpoint[] list = endpoints.value();
                        if ((list != null) && (list.length > 0)) {
                            for (RestEndpoint endpoint : list) {
                                Service service = clazz.getAnnotation(Service.class);
                                String configBean = endpoint.configBean().getSimpleName();

                                CommandResourceMetaData metaData = new CommandResourceMetaData();
                                metaData.command = service.name();
                                metaData.httpMethod = endpoint.opType().name();
                                metaData.resourcePath = endpoint.path().isEmpty() ? service.name() : endpoint.path();
                                metaData.displayName = endpoint.description().isEmpty() ? metaData.resourcePath : endpoint.description();

                                metaData.commandParams = new ParameterMetaData[endpoint.params().length];
                                int index = 0;
                                for (RestParam param : endpoint.params()) {
View Full Code Here

    /**
     * Constructor used by subclasses when instantiated by HK2.
     * ProgramOptions and Environment are injected.  name is set here.
     */
    protected CLICommand() {
        Service service = this.getClass().getAnnotation(Service.class);

        if (service == null)
            name = "unknown-command";   // should never happen
        else
            name = service.name();
    }
View Full Code Here

    final private LocalStringManager localStrings;
    private boolean managedJob;

    public CommandModelImpl(Class<?> commandType) {

        Service service = commandType.getAnnotation(Service.class);
        commandName = service != null ? service.name() : null;
        commandClass = commandType;
        i18n = commandType.getAnnotation(I18n.class);
        execOn = commandType.getAnnotation(ExecuteOn.class);
        localStrings = new LocalStringManagerImpl(commandType);
        managedJob = AnnotationUtil.presentTransitive(ManagedJob.class, commandType);
View Full Code Here

    /**
     * Constructor used by subclasses when instantiated by HK2.
     * ProgramOptions and Environment are injected.  name is set here.
     */
    protected CLICommand() {
        Service service = this.getClass().getAnnotation(Service.class);

        if (service == null)
            name = "unknown-command";   // should never happen
        else
            name = service.name();
    }
View Full Code Here

TOP

Related Classes of org.jvnet.hk2.annotations.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.