Package com.sun.enterprise.module.common_impl

Examples of com.sun.enterprise.module.common_impl.Tokenizer


    MavenModuleDefinition(MavenProjectRepository repository, File location) throws IOException {
        super(location);

        try {
            String classpath = mainAttributes.getValue(ManifestConstants.CLASS_PATH_ID);
            for( String id : new Tokenizer(classpath," ")) {
                File jar = repository.resolveArtifact(id);
                classPath.add(jar.toURI());
            }
        } catch (IOException e) {
            throw new IOException2("Failed to process "+ManifestConstants.CLASS_PATH_ID+" for "+location,e);
View Full Code Here


            }
        }
        if (m!=null) {
            String importedBundles = m.getMainAttributes().getValue(ManifestConstants.BUNDLE_IMPORT_NAME);
            if (importedBundles!=null) {
                for( String token : new Tokenizer(importedBundles,",")) {
                    Collection<Module> modules = modulesRegistry.getModules(token);
                    if (modules.size() ==1) {
                        defs.add(modules.iterator().next().getModuleDefinition());
                    } else {
                        throw new ResolveError("Not able to locate a unique module by name " + token);
                    }
                }
            }

      // Applications can add an additional osgi repos...
            String additionalRepo = m.getMainAttributes().getValue(org.glassfish.api.ManifestConstants.GLASSFISH_REQUIRE_REPOSITORY);
      if (additionalRepo != null) {
                for (String token : new Tokenizer(additionalRepo, ",")) {
        // Each entry should be name=path
        int equals = token.indexOf('=');
        if (equals == -1) {
      // Missing '='...
      throw new IllegalArgumentException("\""
          + org.glassfish.api.ManifestConstants.GLASSFISH_REQUIRE_REPOSITORY
          + ": " + additionalRepo + "\" is missing an '='.  "
          + "It must be in the format: name=path[,name=path]...");
        }
        String name = token.substring(0, equals);
        String path = token.substring(++equals);
        addRepository(name, resolver.translate(path));
    }
      }

      // Applications can also request to be wired to implementors of certain services.
      // That means that any module implementing the requested service will be accessible
      // by the parent class loader of the application.
            String requestedWiring = m.getMainAttributes().getValue(org.glassfish.api.ManifestConstants.GLASSFISH_REQUIRE_SERVICES);
            if (requestedWiring!=null) {
                for (String token : new Tokenizer(requestedWiring, ",")) {
                    for (Object impl : habitat.getAllServices(BuilderHelper.createContractFilter(token))) {
                        Module wiredBundle = modulesRegistry.find(impl.getClass());
                        if (wiredBundle!=null) {
                            defs.add(wiredBundle.getModuleDefinition());
                        }
View Full Code Here

            }
        }
        if (m!=null) {
            String importedBundles = m.getMainAttributes().getValue(ManifestConstants.BUNDLE_IMPORT_NAME);
            if (importedBundles!=null) {
                for( String token : new Tokenizer(importedBundles,",")) {
                    Collection<Module> modules = modulesRegistry.getModules(token);
                    if (modules.size() ==1) {
                        defs.add(modules.iterator().next().getModuleDefinition());
                    } else {
                        throw new ResolveError("Not able to locate a unique module by name " + token);
                    }
                }
            }

      // Applications can add an additional osgi repos...
            String additionalRepo = m.getMainAttributes().getValue(org.glassfish.api.ManifestConstants.GLASSFISH_REQUIRE_REPOSITORY);
      if (additionalRepo != null) {
                for (String token : new Tokenizer(additionalRepo, ",")) {
        // Each entry should be name=path
        int equals = token.indexOf('=');
        if (equals == -1) {
      // Missing '='...
      throw new IllegalArgumentException("\""
          + org.glassfish.api.ManifestConstants.GLASSFISH_REQUIRE_REPOSITORY
          + ": " + additionalRepo + "\" is missing an '='.  "
          + "It must be in the format: name=path[,name=path]...");
        }
        String name = token.substring(0, equals);
        String path = token.substring(++equals);
        addRepository(name, resolver.translate(path));
    }
      }

      // Applications can also request to be wired to implementors of certain services.
      // That means that any module implementing the requested service will be accessible
      // by the parent class loader of the application.
            String requestedWiring = m.getMainAttributes().getValue(org.glassfish.api.ManifestConstants.GLASSFISH_REQUIRE_SERVICES);
            if (requestedWiring!=null) {
                for (String token : new Tokenizer(requestedWiring, ",")) {
                    for (Inhabitant<?> impl : habitat.getInhabitantsByContract(token)) {
                        Module wiredBundle = modulesRegistry.find(impl.get().getClass());
                        if (wiredBundle!=null) {
                            defs.add(wiredBundle.getModuleDefinition());
                        }
View Full Code Here

        return !Inhabitants.getNamesFor(command, "mode").isEmpty();
    }
   
    private static boolean metadataContains(String md, String nev) {
        boolean contains = false;
        Tokenizer st = new Tokenizer(md, ","); //TODO
        for (String pair : st) {
            if (pair.trim().equals(nev)) {
                contains = true;
                break;
            }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.module.common_impl.Tokenizer

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.