Package org.glassfish.hk2.api

Examples of org.glassfish.hk2.api.ActiveDescriptor


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

            {
                setRequiredType(parameter.getType());
                setRequiredQualifiers(Collections.<Annotation>emptySet());
                final ActiveDescriptor proxyDescriptor = descriptorCache.compute(parameter);
                if (proxyDescriptor != null) {
                    setInjecteeDescriptor(proxyDescriptor);
                }
            }
View Full Code Here


        final LinkedHashMap<ActiveDescriptor, ServiceHandle<T>> providerMap =
                new LinkedHashMap<ActiveDescriptor, ServiceHandle<T>>();

        for (final ServiceHandle<T> provider : providers) {
            final ActiveDescriptor key = provider.getActiveDescriptor();
            if (!providerMap.containsKey(key)) {
                providerMap.put(key, provider);
            }
        }
View Full Code Here

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

            {
                setRequiredType(parameter.getType());
                setRequiredQualifiers(Collections.<Annotation>emptySet());
                final ActiveDescriptor proxyDescriptor = descriptorCache.compute(parameter);
                if (proxyDescriptor != null) {
                    setInjecteeDescriptor(proxyDescriptor);
                }
            }
View Full Code Here

        providers.addAll(getAllServiceHandles(locator, contract));

        LinkedHashMap<ActiveDescriptor, ServiceHandle<T>> providerMap = Maps.newLinkedHashMap();

        for (ServiceHandle<T> provider : providers) {
            ActiveDescriptor key = provider.getActiveDescriptor();
            if (!providerMap.containsKey(key)) {
                providerMap.put(key, provider);
            }
        }
View Full Code Here

        final LinkedHashMap<ActiveDescriptor, ServiceHandle<T>> providerMap =
                new LinkedHashMap<ActiveDescriptor, ServiceHandle<T>>();

        for (final ServiceHandle<T> provider : providers) {
            final ActiveDescriptor key = provider.getActiveDescriptor();
            if (!providerMap.containsKey(key)) {
                providerMap.put(key, provider);
            }
        }
View Full Code Here

   
    /**
     * Mallory cannot un-advertise ServiceLocator!
     */
    public void tryToUnAdvertiseAService() {
        final Descriptor locatorService = locator.getBestDescriptor(BuilderHelper.createContractFilter(ServiceLocator.class.getName()));
       
        // This filter matches ServiceLocator itself!
        Filter unbindFilter = new Filter() {

            @Override
            public boolean matches(Descriptor d) {
                if (d.getServiceId().equals(locatorService.getServiceId())) {
                    if (d.getLocatorId().equals(locator.getLocatorId())) {
                        return true;
                    }
                }
               
View Full Code Here

    }

    private boolean isSecureAnnotated(ValidationInformation info) {

        Descriptor d = info.getCandidate();

        Set<String> qualifiers = d.getQualifiers();
        if (qualifiers != null && qualifiers.size() != 0) {
            for (String s : qualifiers) {
                if (Secure.class.getCanonicalName().equals(s)) {
                    if (LOG.isLoggable(Level.FINE)) {
                        LOG.fine("The instance is annotated with \'Secure\': "
View Full Code Here

       
        Set<String> contracts = ReflectionHelper.getContractsFromClass(clazz, Contract.class);
        String name = ReflectionHelper.getName(clazz);
        String scope = ReflectionHelper.getScopeFromClass(clazz, PerLookup.class).getName();
        Set<String> qualifiers = ReflectionHelper.getQualifiersFromClass(clazz);
        DescriptorType type = DescriptorType.CLASS;
        if (Factory.class.isAssignableFrom(clazz)) {
            type = DescriptorType.PROVIDE_METHOD;
        }
       
        Boolean proxy = null;
View Full Code Here

            else {
                proxyForSameScope = Boolean.FALSE;
            }
        }
       
        DescriptorVisibility visibility = DescriptorVisibility.NORMAL;
        Visibility vi = constant.getClass().getAnnotation(Visibility.class);
        if (vi != null) {
            visibility = vi.value();
        }
       
View Full Code Here

        ProxyForSameScope pfss = clazz.getAnnotation(ProxyForSameScope.class);
        if (pfss != null) {
            proxyForSameScope = new Boolean(pfss.value());
        }
       
        DescriptorVisibility visibility = DescriptorVisibility.NORMAL;
        Visibility vi = clazz.getAnnotation(Visibility.class);
        if (vi != null) {
            visibility = vi.value();
        }
       
View Full Code Here

TOP

Related Classes of org.glassfish.hk2.api.ActiveDescriptor

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.