Package org.jvnet.hk2.component.classmodel

Examples of org.jvnet.hk2.component.classmodel.ClassPath


    if (!sourceInhabitantFile.exists()) {
      logger.log(Level.INFO, "Nothing to do.");
      return;
    }
    File targetInhabitantFile = InhabitantsGenerator.getInhabitantFile(PARAM_INHABITANT_TARGET_FILE, false);
    ClassPath targetClassPath = InhabitantsGenerator.getScopedInhabitantCodeSources();
    CodeSourceFilter filter = new CodeSourceFilter(targetClassPath);
    logger.log(Level.FINE, "filter is {0}", filter);
   
    InhabitantsDescriptor inDescriptor = new InhabitantsDescriptor();
    logger.log(Level.FINE, "source file is {0}", sourceInhabitantFile);
View Full Code Here


      } else {
        logger.log(Level.FINE, "ignoring {0}", file);
      }
    }
   
    ClassPath newClassPath = ClassPath.create(null, newFiles);
    return newClassPath;
  }
View Full Code Here

    return ipcGen;
  }
 
  public static void main(String [] args) throws Exception {
    File targetInhabitantFile = getInhabitantFile(PARAM_INHABITANT_TARGET_FILE, false);
    ClassPath inhabitantsSourceFiles = getScopedInhabitantCodeSources();
    ClassPath inhabitantsClassPath = getFullInhabitantsClassPath();
    boolean sort = Boolean.getBoolean(PARAM_INHABITANTS_SORTED);
   
    if (inhabitantsSourceFiles.getEntries().isEmpty()) {
      System.err.println("WARNING: nothing to do!");
      return;
View Full Code Here

    generator.generate(targetInhabitantFile, sort);
  }

  static ClassPath getFullInhabitantsClassPath() {
    String arg;
    ClassPath inhabitantsClassPath = null;
    arg = System.getProperty(PARAM_INHABITANTS_CLASSPATH);
    if (null == arg || arg.isEmpty()) {
      inhabitantsClassPath = ClassPath.create(null, false);
      System.err.println("WARNING: sysprop " + PARAM_INHABITANTS_CLASSPATH +
          " is missing; defaulting to system classpath; this may result in an invalid inhabitants file being created.");
      if (logger.isLoggable(Level.FINER)) {
        logger.log(Level.FINER, "classpath={0}", inhabitantsClassPath.getFileEntries());
      }
    } else {
      inhabitantsClassPath = ClassPath.create(null, arg);
    }
    return inhabitantsClassPath;
View Full Code Here

        sourceFiles.add(source);
      } else {
        System.err.println("WARNING: can't find " + sourceFile);
      }
    }
    ClassPath inhabitantsSourceFiles = ClassPath.create(null, sourceFiles);
    return inhabitantsSourceFiles;
  }
View Full Code Here

          }
      };

      InhabitantsParsingContextGenerator ipcgen;
      try {
        InhabitantsFeed feed = InhabitantsFeed.create(habitat, ip);
        ipcgen = (USE_CACHE) ? ipcgCache.get(classpath, populator) : populator.call();
        feed.populate(ipcgen);
 
        if (logger.isLoggable(Level.FINER)) {
          Iterator<String> contracts = habitat.getAllContracts();
          while (contracts.hasNext()) {
              String contract = contracts.next();
View Full Code Here

    protected void populateHabitat(final Habitat habitat, InhabitantsParser ip) {
      final ClassPath classpath = ClassPath.create(habitat, true);
      Callable<InhabitantsParsingContextGenerator> populator = new Callable<InhabitantsParsingContextGenerator>() {
          @Override
          public InhabitantsParsingContextGenerator call() throws Exception {
            InhabitantsParsingContextGenerator ipcgen = InhabitantsParsingContextGenerator.create(habitat);
            Set<String> cpSet = classpath.getEntries();
            for (String fileName : cpSet) {
                File f = new File(fileName);
                if (f.exists()) {
                  try {
                    ipcgen.parse(f);
                  } catch (IOException e) {
                    e.printStackTrace();
                  }
                }
            }
            return ipcgen;
          }
      };

      InhabitantsParsingContextGenerator ipcgen;
      try {
        InhabitantsFeed feed = InhabitantsFeed.create(habitat, ip);
        ipcgen = (USE_CACHE) ? ipcgCache.get(classpath, populator) : populator.call();
        feed.populate(ipcgen);
 
View Full Code Here

                new CompanionSeed.Registerer(this)));
        add(new ExistingSingletonInhabitant<CageBuilder.Registerer>(CageBuilder.Registerer.class,
                new CageBuilder.Registerer(this)));

        // the default RunLevelService
        DefaultRunLevelService rls = new DefaultRunLevelService(this);
        ExistingSingletonInhabitant<RunLevelService> rlsI =
          new ExistingSingletonInhabitant<RunLevelService>(RunLevelService.class, rls);
        add(rlsI);
        addIndex(rlsI, RunLevelService.class.getName(), DefaultRunLevelService.NAME);
    }
View Full Code Here

    return filter;
  }
 
  public InhabitantTrackerContextBuilder ldapFilter(String ldapExpression)
        throws ComponentException {
    SimpleLdapMatcher matcher = SimpleLdapMatcher.create(ldapExpression);
    Set<String> classNames = matcher.getTheAndSetFor(Constants.OBJECTCLASS, true);
    if (classNames.isEmpty()) throw new IllegalArgumentException("invalid expression");
    for (String item : classNames) {
      if (hasWildcard(item)) {
        throw new ComponentException("no wilcards permitted");
      }
View Full Code Here

                Set<String> attributeNames = configBean.model.getAttributeNames();
                for (String attributeName : attributeNames) {
                    String methodName = getAttributeMethodName(attributeName);
                    try {
                        Method method = configBeanProxy.getMethod(methodName);
                        Attribute attribute = method.getAnnotation(Attribute.class);
                        if (attribute != null) {
                            ParameterMetaData parameterMetaData =
                                getParameterMetaData(attribute);

                            if (pamameterType == Constants.QUERY_PARAMETER) {
View Full Code Here

TOP

Related Classes of org.jvnet.hk2.component.classmodel.ClassPath

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.