Package org.jvnet.hk2.config

Examples of org.jvnet.hk2.config.InjectionManager


    InjectionResolver paramResolver;
    Class<? extends CrudResolver> resolverType;
   
    void prepareInjection(final AdminCommandContext ctx) {
        // inject resolver with command parameters...
        manager = new InjectionManager();

        resolver = habitat.getService(resolverType);

        paramResolver = getInjectionResolver();
View Full Code Here


                    }
                    for (final Map.Entry<Object, Object> entry : props.entrySet()) {
                        ConfigBeanProxy child = (ConfigBeanProxy) component;
                        try {
                            ConfigBeanProxy cc = child.createChild(itemType);
                            new InjectionManager().inject(cc, itemType, new InjectionResolver<Attribute>(Attribute.class) {

                                @Override
                                public boolean isOptional(AnnotatedElement annotated, Attribute annotation) {
                                    return true;   
                                }
View Full Code Here

    private ActionReport.ExitCode inject(SupplementalCommand cmd,
            InjectionResolver<Param> injector, ActionReport subActionReport) {
        ActionReport.ExitCode result = ActionReport.ExitCode.SUCCESS;
        try {
            new InjectionManager().inject(cmd.getCommand(), injector);
        } catch (Exception e) {
            result = ActionReport.ExitCode.FAILURE;
            subActionReport.setActionExitCode(result);
            subActionReport.setMessage(e.getMessage());
            subActionReport.setFailureCause(e);
View Full Code Here

    private ActionReport.ExitCode inject(SupplementalCommand cmd,
            InjectionResolver<Param> injector, ActionReport subActionReport) {
        ActionReport.ExitCode result = ActionReport.ExitCode.SUCCESS;
        try {
            new InjectionManager().inject(cmd.getCommand(), injector);
        } catch (Exception e) {
            result = ActionReport.ExitCode.FAILURE;
            subActionReport.setActionExitCode(result);
            subActionReport.setMessage(e.getMessage());
            subActionReport.setFailureCause(e);
View Full Code Here

    InjectionResolver paramResolver;
    Class<? extends CrudResolver> resolverType;
   
    void prepareInjection(final AdminCommandContext ctx) {
        // inject resolver with command parameters...
        manager = new InjectionManager();

        resolver = habitat.getService(resolverType);

        paramResolver = getInjectionResolver();
View Full Code Here

                    }
                    for (final Map.Entry<Object, Object> entry : props.entrySet()) {
                        ConfigBeanProxy child = (ConfigBeanProxy) component;
                        try {
                            ConfigBeanProxy cc = child.createChild(itemType);
                            new InjectionManager().inject(cc, itemType, new InjectionResolver<Attribute>(Attribute.class) {

                                @Override
                                public boolean isOptional(AnnotatedElement annotated, Attribute annotation) {
                                    return true;   
                                }
View Full Code Here

    InjectionResolver paramResolver;
    Class<? extends CrudResolver> resolverType;
   
    void prepareInjection(final AdminCommandContext ctx) {
        // inject resolver with command parameters...
        manager = new InjectionManager();

        resolver = habitat.getService(resolverType);

        paramResolver = getInjectionResolver();
View Full Code Here

                    }
                    for (final Map.Entry<Object, Object> entry : props.entrySet()) {
                        ConfigBeanProxy child = (ConfigBeanProxy) component;
                        try {
                            ConfigBeanProxy cc = child.createChild(itemType);
                            new InjectionManager().inject(cc, itemType, new InjectionResolver<Attribute>(Attribute.class) {

                                @Override
                                public boolean isOptional(AnnotatedElement annotated, Attribute annotation) {
                                    return true;   
                                }
View Full Code Here

                try {
                    boolean wasAdded = ports.add(Integer.parseInt(val));

                    if (!wasAdded) //TODO unit test
                        throw new TransactionFailure(Strings.get("PortUtils.duplicate_port", val, server.getName()));
                }
                catch(TransactionFailure tf) {
                    // don't re-wrap the same Exception type!
                    throw tf;
                }
                catch (Exception e) {  //TODO unit test
                    throw new TransactionFailure(Strings.get("PortUtils.non_int_port", val, server.getName()));
                }
            }
        }
        checkForLegalPorts(ports, server.getName());
    }
View Full Code Here

     * @return a message if error, nu8ll means A-OK
     */
    private static void checkForLegalPorts(Set<Integer> ports, String serverName) throws TransactionFailure {
        for (int port : ports)
            if (!NetUtils.isPortValid(port))
                throw new TransactionFailure(Strings.get("PortUtils.illegal_port_number", port, serverName, MAX_PORT));
    }
View Full Code Here

TOP

Related Classes of org.jvnet.hk2.config.InjectionManager

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.