Package org.glassfish.hk2.utilities

Examples of org.glassfish.hk2.utilities.InjecteeImpl


        injectionMgr.inject(result, injector);
        return result;
    }
   
    private void parseInHk2LocatorOrig(BufferedReader reader, Map<String, String> cliCommandNames) throws IOException {
        DescriptorImpl desc = new DescriptorImpl();
        while (desc.readObject(reader)) {
            if (StringUtils.ok(desc.getName()) && desc.getAdvertisedContracts().contains(CLICommand.class.getName())) {
                cliCommandNames.put(desc.getName(), desc.getImplementation());
            }
        }
    }
View Full Code Here


        if (requestedType == null) {
            return getServiceHandleImpl(activeDescriptor, null);
        }

        return getServiceHandleImpl(activeDescriptor, new InjecteeImpl(requestedType));
    }
View Full Code Here

        checkState();

        ActiveDescriptor<T> ad = internalGetDescriptor(null, contractOrImpl, null, null, qualifiers);
        if (ad == null) return null;

        return getServiceHandle(ad, new InjecteeImpl(contractOrImpl));
    }
View Full Code Here

        checkState();

        ActiveDescriptor<T> ad = internalGetDescriptor(null, contractOrImpl, null, unqualified, qualifiers);
        if (ad == null) return null;

        return getServiceHandle(ad, new InjecteeImpl(contractOrImpl));
    }
View Full Code Here

        if (requestedType == null) {
            return getServiceHandleImpl(activeDescriptor, null);
        }

        return getServiceHandleImpl(activeDescriptor, new InjecteeImpl(requestedType));
    }
View Full Code Here

        checkState();

        ActiveDescriptor<T> ad = internalGetDescriptor(null, contractOrImpl, null, null, qualifiers);
        if (ad == null) return null;

        return getServiceHandle(ad, new InjecteeImpl(contractOrImpl));
    }
View Full Code Here

        checkState();

        ActiveDescriptor<T> ad = internalGetDescriptor(null, contractOrImpl, null, unqualified, qualifiers);
        if (ad == null) return null;

        return getServiceHandle(ad, new InjecteeImpl(contractOrImpl));
    }
View Full Code Here

        this.unqualified = unqualified;
        this.originalInjectee = originalInjectee;
    }
   
    private void justInTime() {
        InjecteeImpl injectee = new InjecteeImpl(originalInjectee);
        injectee.setRequiredType(requiredType);
        injectee.setRequiredQualifiers(requiredQualifiers);
        if (unqualified != null) {
            injectee.setUnqualified(unqualified);
        }
       
        // This does nothing more than run the JIT resolvers
        locator.getInjecteeDescriptor(injectee);
    }
View Full Code Here

            return null;
        }
    });

    private static Injectee getInjectee(final Parameter parameter) {
        return new InjecteeImpl() {

            private final Class<?> rawType = parameter.getRawType();

            {
                setRequiredType(parameter.getType());
View Full Code Here

        Object arguments[] = new Object[subscriptionInfo.otherInjectees.length];
       
        List<ServiceHandle<?>> destroyMe = new LinkedList<ServiceHandle<?>>();
        try {
            for (int lcv = 0; lcv < subscriptionInfo.otherInjectees.length; lcv++) {
                InjecteeImpl injectee = subscriptionInfo.otherInjectees[lcv];
                if (injectee == null) {
                    arguments[lcv] = message;
                }
                else {
                    if (injectee.isSelf()) {
                        arguments[lcv] = injectee.getInjecteeDescriptor();
                        continue;
                    }
                   
                    ActiveDescriptor<?> injecteeDescriptor = locator.getInjecteeDescriptor(injectee);
                    if (injecteeDescriptor == null) {
                        if (injectee.isOptional()) {
                            arguments[lcv] = null;
                            continue;
                        }
                       
                        throw new IllegalStateException("Could not find injectee " + injectee + " for subscriber " +
View Full Code Here

TOP

Related Classes of org.glassfish.hk2.utilities.InjecteeImpl

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.