Package org.glassfish.hk2.api

Examples of org.glassfish.hk2.api.Filter


        rawClass = Utilities.translatePrimitiveType(rawClass);
       
        name = getName(name, qualifiers);
       
        boolean useCache = false;
        Filter filter;
        if (unqualified == null) {
            filter = BuilderHelper.createNameAndContractFilter(rawClass.getName(), name);
            useCache = true;
        }
        else {
View Full Code Here


        if (rawClass == null) {
            throw new MultiException(new IllegalArgumentException("Type must be a class or parameterized type, it was " + contractOrImpl));
        }
       
        boolean useCache = false;
        Filter filter;
        if (unqualified == null) {
            filter = BuilderHelper.createContractFilter(rawClass.getName());
            useCache = true;
        }
        else {
View Full Code Here

            }
           
            allQualifiers.add(addMe);
        }
       
        return getAllServiceHandles(new Filter() {

            @Override
            public boolean matches(Descriptor d) {
                return d.getQualifiers().containsAll(allQualifiers);
            }
View Full Code Here

   
    private void reupInjectionResolvers() {
        HashMap<Class<? extends Annotation>, InjectionResolver<?>> newResolvers =
                new HashMap<Class<? extends Annotation>, InjectionResolver<?>>();
       
        Filter injectionResolverFilter = BuilderHelper.createContractFilter(
                InjectionResolver.class.getName());
       
        List<ActiveDescriptor<?>> resolverDescriptors = protectedGetDescriptors(injectionResolverFilter);
       
        for (ActiveDescriptor<?> resolverDescriptor : resolverDescriptors) {
View Full Code Here

            throw new ClassNotFoundException(cname);
        }
    }

    private  List<ActiveDescriptor<?>> getDescriptors(final String cname) throws ClassNotFoundException {
        return serviceLocator.getDescriptors(new Filter() {
            @Override
            public boolean matches(Descriptor d) {
                return d.getImplementation().equals(cname);
            }
        });
View Full Code Here

                   
                });
            }
            final ClassLoader binderClassLoader = loader;
           
            defaultLoader = new HK2Loader() {
                @Override
                public Class<?> loadClass(String className) throws MultiException {
                    try {
                        return binderClassLoader.loadClass(className);
                    } catch (ClassNotFoundException e) {
View Full Code Here

        };
       
    }

    protected Class<?> loadClass(String type) throws ClassNotFoundException {
        HK2Loader loader = myself.getLoader();
       
        if (loader == null) {
            return getClass().getClassLoader().loadClass(type);
        }
       
        try {
            return loader.loadClass(type);
        }
        catch (MultiException me) {
            for (Throwable th : me.getErrors()) {
                if (th instanceof ClassNotFoundException) {
                    throw (ClassNotFoundException) th;
View Full Code Here

        }
       
        final String fContract = contract;
        final String fName = name;
       
        return new IndexedFilter() {

            @Override
            public boolean matches(Descriptor d) {
                if (qualifiers.isEmpty()) return true;
               
View Full Code Here

                return annotationClass.getDeclaredMethods();
            }
           
      });
      for (Method annotationMethod : annotationMethods) {
          Metadata metadataAnno = annotationMethod.getAnnotation(Metadata.class);
          if (metadataAnno == null) continue;
         
          String key = metadataAnno.value();
         
          Object addMe;
          try {
              addMe = ReflectionHelper.invoke(annotation, annotationMethod, new Object[0]);
          }
View Full Code Here

          Object addMe;
          try {
              addMe = ReflectionHelper.invoke(annotation, annotationMethod, new Object[0]);
          }
          catch (Throwable th) {
              throw new MultiException(th);
          }
         
          if (addMe == null) continue;
         
          String addMeString;
View Full Code Here

TOP

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

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.