Package com.sun.hk2.component

Examples of com.sun.hk2.component.InhabitantIntrospectionScanner


    }

    public void populate(InhabitantsParsingContextGenerator ipcgen) {
        logger.log(Level.FINER, "Starting to introspect");
        ParsingContext context = ipcgen.getContext();
        InhabitantIntrospectionScanner is = new InhabitantIntrospectionScanner(context);
        try {
            ip.parse(is, classLoaderHolder);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
View Full Code Here


                            parser.awaitTermination();
                        } catch (InterruptedException e) {
                            throw new IOException(e);
                        }

                        return new InhabitantIntrospectionScanner(context);
                    }                   
                });
            }
            for( File svc : fixNull(new File(dir, InhabitantsFile.PATH).listFiles())) {
                if(svc.isDirectory())
View Full Code Here

        // deliberate no-op
    }

    @Override
    protected InhabitantsParser createInhabitantsParser(Habitat habitat) {
        InhabitantsParser parser = super.createInhabitantsParser(habitat);
        ServiceLoader<InhabitantsParserDecorator> decorators = ServiceLoader.load(
                InhabitantsParserDecorator.class, Thread.currentThread().getContextClassLoader());
        for (InhabitantsParserDecorator decorator : decorators) {
            if (decorator.getName().equalsIgnoreCase(getName())) {
                decorator.decorate(parser);
View Full Code Here

    /**
     * Creates {@link InhabitantsParser} to fill in {@link Habitat}.
     * Override for customizing the behavior.
     */
    protected InhabitantsParser createInhabitantsParser(Habitat habitat) {
        return new InhabitantsParser(habitat);
    }
View Full Code Here

        }
    }
   
    @Override
    public InhabitantsParser createInhabitantsParser(Habitat h) {
      return new InhabitantsParser(h);
    }
View Full Code Here

                //}
                DirectoryBasedRepository ejb = new DirectoryBasedRepository("ejb", ejbLib);
                ejb.initialize();
                modulesRegistry.addRepository(ejb);

                InhabitantsParser parser = new InhabitantsParser(habitat);
                for (ModuleDefinition md : ejb.findAll()) {
                    Module module = modulesRegistry.makeModuleFor(md.getName(), md.getVersion());
                    if (module != null) {
                        ((AbstractModulesRegistryImpl) modulesRegistry).parseInhabitants(module, "default", parser);
                    }
View Full Code Here

    public String getSystemId() {
        return systemId;
    }

    public Iterable<InhabitantParser> createScanner() throws IOException {
        return new InhabitantsScanner(new ByteArrayInputStream(data), systemId);
    }
View Full Code Here

   * Loads an existing file.
   */
  public void load(File f) throws IOException {
    FileInputStream in = new FileInputStream(f);
    try {
      InhabitantsScanner scanner = new InhabitantsScanner(in, f.getPath());
      for (InhabitantParser kvpp : scanner) {
        put(kvpp.getImplName(), kvpp.getLine());
      }
    } finally {
      if (null != in) {
View Full Code Here

        // make the listeners available very early in lifecycle
        addHabitatListener(new SelfListener());

        // add the set of injection resolvers
        add(new ExistingSingletonInhabitant<InjectionResolver>(InjectionResolver.class,
                new InjectInjectionResolver(this)));
        add(new ExistingSingletonInhabitant<InjectionResolver>(InjectionResolver.class,
                new LeadInjectionResolver(this)));
       
        // make the habitat itself available
        add(new ExistingSingletonInhabitant<Habitat>(Habitat.class,this));
View Full Code Here

        // inject resolver with command parameters...
        final InjectionManager manager = new InjectionManager();

        CrudResolver resolver = habitat.getComponent(resolverType);

        final InjectionResolver paramResolver = getInjectionResolver();

        manager.inject(resolver, paramResolver);

        final ConfigBeanProxy target = resolver.resolve(context, targetType);
        if (target==null) {
View Full Code Here

TOP

Related Classes of com.sun.hk2.component.InhabitantIntrospectionScanner

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.