Package org.jvnet.hk2.annotations

Examples of org.jvnet.hk2.annotations.Service


    /**
     * 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


    /**
     * 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

    private void sort() {
        Collections.sort(adminCmds, new Comparator<AdminCommand>() {
            @Override
            public int compare(AdminCommand c1, AdminCommand c2) {
                Service service1 = c1.getClass().getAnnotation(Service.class);
                Service service2 = c2.getClass().getAnnotation(Service.class);
               
                String name1 = (service1 != null) ? service1.name() : "";
                String name2 = (service2 != null) ? service2.name() : "";
               
                return name1.compareTo(name2);
            }
        }
        );
View Full Code Here

    private final static String EOL = ManifestUtils.EOL_TOKEN;
   
    private static class CLICommand {
        CLICommand(AdminCommand adminCommand) {
            this.adminCommand = adminCommand;
            Service service = adminCommand.getClass().getAnnotation(Service.class);
            name = (service != null) ? service.name() : "";
        }
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

            super(new AccessCheck("unguarded/" + getCommandName(c), "execute"),"  Unguarded access control on " + c.getClass().getName());
        }
    }
   
    private static String getCommandName(final AdminCommand c) {
        final Service serviceAnno = c.getClass().getAnnotation(Service.class);
        if (serviceAnno == null) {
            return "no-name";
        }
        return serviceAnno.name();
    }
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

    private void sort() {
        Collections.sort(adminCmds, new Comparator<AdminCommand>() {
            @Override
            public int compare(AdminCommand c1, AdminCommand c2) {
                Service service1 = c1.getClass().getAnnotation(Service.class);
                Service service2 = c2.getClass().getAnnotation(Service.class);
               
                String name1 = (service1 != null) ? service1.name() : "";
                String name2 = (service2 != null) ? service2.name() : "";
               
                return name1.compareTo(name2);
            }
        }
        );
View Full Code Here

    private final static String EOL = ManifestUtils.EOL_TOKEN;
   
    private static class CLICommand {
        CLICommand(AdminCommand adminCommand) {
            this.adminCommand = adminCommand;
            Service service = adminCommand.getClass().getAnnotation(Service.class);
            name = (service != null) ? service.name() : "";
        }
View Full Code Here

            super(new AccessCheck("unguarded/" + getCommandName(c), "execute"),"  Unguarded access control on " + c.getClass().getName());
        }
    }
   
    private static String getCommandName(final AdminCommand c) {
        final Service serviceAnno = c.getClass().getAnnotation(Service.class);
        if (serviceAnno == null) {
            return "no-name";
        }
        return serviceAnno.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.